# CGU Transparency MCP

> Portal da Transparência (CGU) MCP Server gives your AI client direct access to Brazilian government data. Query social benefit payments (Bolsa Família, Auxílio Emergencial), track public spending by beneficiary or company, and list official SIAFI organizations using CPF, NIS, or municipality codes.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** transparency, brazil-government, public-spending, social-benefits, fiscal-audit

## Description

You'll get direct access to **Portal da Transparência (CGU)** data using your AI client. This server lets you audit Brazilian public spending and social programs without having to manually click through pages on government websites.

### **Individual Benefit Status**

You can check an individual’s benefit status with specific tools. To see if someone is eligible for, or has withdrawn, benefits like Bolsa Família or Auxílio Emergencial, your agent checks the current availability using either a CPF or NIS identifier through `get_bolsa_familia_disponivel_por_cpf_ou_nis` or `get_auxilio_emergencial_por_cpf_ou_nis`. If you need to track withdrawal status for Bolsa Família specifically, run `get_bolsa_familia_sacado_por_nis` using just the NIS. For a broader look at social benefits across regions, you can get general Bolsa Família distribution information by municipality using `get_bolsa_familia_por_municipio`, or for Auxílio Emergencial, you've got both `get_auxilio_emergencial_beneficiario_por_municipio` and its alternative call, `get_auxilio_emergencial_por_municipio`. These tools let you map out who gets what payments across entire Brazilian municipalities.

### **Auditing Spending & Records**

To get deep into spending records, use `get_despesas_documentos_por_favorecido` to retrieve specific expense documents and payment history. You just need to give it a beneficiary name or company name, and the tool pulls those detailed records for you. For specialized grants, like Seguro Defeso, you run `get_seguro_defeso_codigo` with its unique identification code to pull up those particular records. 

### **Government Indexing & Mapping**

When you need to map out the bureaucracy, you can list all government organizations registered in the SIAFI system using `get_orgaos_siafi`; this tool handles pagination so you can search through every entry available. It’s a way for your agent to pull up details on official entities that run public programs across Brazil.

Your AI client doesn't just read data; it executes these steps. When you prompt, say, 'Check the spending records for Acme Corp.' and include this server, your agent knows exactly which tool—`get_despesas_documentos_por_favorecido`—to fire up, what parameters to use (Acme Corp.), and what structured data set is coming back. This capability lets you compare payment status against listed government organizations or specific benefit availability across regions in one single workflow.

## Tools

### get_auxilio_emergencial_beneficiario_por_municipio
Gets a list of Auxílio Emergencial beneficiaries for an entire Brazilian municipality.

### get_auxilio_emergencial_por_cpf_ou_nis
Checks the status of Auxílio Emergencial payments using either a CPF or NIS identifier.

### get_auxilio_emergencial_por_municipio
Gets a list of Auxílio Emergencial beneficiaries for an entire Brazilian municipality (alternative call).

### get_bolsa_familia_disponivel_por_cpf_ou_nis
Checks the current availability status of Bolsa Família benefits using a CPF or NIS.

### get_bolsa_familia_por_municipio
Gets general information on Bolsa Família distribution for an entire Brazilian municipality.

### get_bolsa_familia_sacado_por_nis
Checks the withdrawal status of Bolsa Família benefits using a NIS identifier.

### get_despesas_documentos_por_favorecido
Retrieves specific expense documents and payment records for a given beneficiary name or company.

### get_orgaos_siafi
Lists all government organizations indexed in the SIAFI system, supporting pagination.

### get_seguro_defeso_codigo
Retrieves records for Seguro Defeso using its unique identification code.

## Prompt Examples

**Prompt:** 
```
Check Bolsa Família availability for CPF 000.000.000-00.
```

**Response:** 
```
I've checked the records for that CPF. There is an available benefit for the current month in the amount of R$ 600.00. Would you like to see the payment history?
```

**Prompt:** 
```
List all SIAFI organizations on page 1.
```

**Response:** 
```
Fetching the first page of SIAFI organizations... I found entries including the Ministry of Education (MEC), Ministry of Health, and the Presidency of the Republic. Do you need details on a specific one?
```

**Prompt:** 
```
Show expense documents for beneficiary 'Empresa Exemplo LTDA'.
```

**Response:** 
```
I found 3 expense documents for 'Empresa Exemplo LTDA'. The most recent is a payment of R$ 50,000.00 for technical services. Would you like the document IDs?
```

## Capabilities

### Check Individual Benefit Status
Determines if an individual (via CPF/NIS) is eligible for or has withdrawn specific social benefits like Bolsa Família or Auxílio Emergencial.

### Audit Public Spending Records
Retrieves detailed expense documents and payment histories linked to a given beneficiary or company name.

### List Government Entities
Searches the SIAFI database to list and find details on official government organizations in Brazil.

### Analyze Location-Based Benefits
Queries social benefit availability across specific Brazilian municipalities, providing regional spending insights.

### Look Up Specific Grants
Retrieves records for specialized grants, such as Seguro Defeso, using required identification codes.

## Use Cases

### Investigating a Corporate Payment
A reporter needs to know if 'Empresa X' received specific funds. They ask their agent, which runs `get_despesas_documentos_por_favorecido` using the company name. The agent returns payment IDs and amounts for review.

### Checking Emergency Aid Eligibility
You need to verify Auxílio Emergencial status for a group of people in Porto Alegre. You run `get_auxilio_emergencial_beneficiario_por_municipio` first, then use `get_auxilio_emergencial_por_cpf_ou_nis` on key individuals found in the initial list.

### Mapping Government Oversight
A developer needs a full list of all state-level agencies for an app. They run `get_orgaos_siafi`. The agent returns paginated results, which they can then process and filter in their code.

### Validating Family Benefit Withdrawal
A user needs to confirm if a specific Bolsa Família benefit was withdrawn. They provide the NIS, and the agent executes `get_bolsa_familia_sacado_por_nis`, giving them the exact withdrawal details.

## Benefits

- Verify benefit status instantly. Instead of navigating multiple portals, use `get_bolsa_familia_disponivel_por_cpf_ou_nis` to check Bolsa Família availability right in your agent's chat.
- Track money flow by beneficiary. Use `get_despesas_documentos_por_favorecido` to pull detailed payment records for any company or individual, eliminating spreadsheet manual data entry.
- Map out government structure. Run `get_orgaos_siafi` to get a comprehensive list of all official SIAFI organizations without leaving your current workflow.
- Compare regional spending. Use location-based tools like `get_auxilio_emergencial_por_municipio` and `get_bolsa_familia_por_municipio` to compare benefit distributions across different Brazilian cities.
- Get specialized data points. If you need records for Seguro Defeso, simply call `get_seguro_defeso_codigo` with the code; no manual database lookup required.

## How It Works

The bottom line is that your agent pulls audited, real-time public finance data directly from Brazilian records into a usable format.

1. Subscribe to the server and provide your CGU API Key.
2. Your AI client sends a request (e.g., 'Check Bolsa Família for NIS X') to the relevant tool endpoint.
3. The MCP Server executes the query against the government APIs and returns structured data on benefit status or expense documents.

## Frequently Asked Questions

**How do I check Bolsa Família availability for a person using get_bolsa_familia_disponivel_por_cpf_ou_nis?**
You provide the CPF or NIS to your agent and ask it to run `get_bolsa_familia_disponivel_por_cpf_ou_nis`. The server confirms if a benefit is available for the current month and provides the amount.

**What tools can I use to find government organizations in Brazil?**
Use the `get_orgaos_siafi` tool. It lists all SIAFI registered organizations and handles pagination, letting you search through large directories efficiently.

**Can I track expenses for a company using get_despesas_documentos_por_favorecido?**
Yes. You pass the company name or beneficiary to `get_despesas_documentos_por_favorecido`. The agent returns multiple document IDs and payment amounts linked to that entity.

**Which tool checks Auxílio Emergencial by location?**
You can use either `get_auxilio_emergencial_beneficiario_por_municipio` or `get_auxilio_emergencial_por_municipio`. Both query the benefit recipients within a specified municipality.

**Do I need an API key to run get_seguro_defeso_codigo?**
Yes. Since this tool accesses restricted government data, you must subscribe and provide your valid CGU API Key for the agent to execute `get_seguro_defeso_codigo`.

**How do I check regional benefit data using the `get_bolsa_familia_por_municipio` tool?**
This tool gets Bolsa Família availability for a whole municipality. You simply pass the geographic code to pull aggregated records, allowing you to compare benefits across different regions.

**Does the `get_orgaos_siafi` tool support listing all organizations if there are thousands of results?**
Yes, it supports pagination. If the search returns many entries, your agent can iterate through subsequent pages to collect every available SIAFI organization record.

**What should I do if `get_auxilio_emergencial_beneficiario_por_municipio` fails or hits a limit?**
If the call fails, the response will include an error code explaining why. You should check that your municipal input is correct or wait before retrying to avoid hitting API limits.

**How can I check if a specific person has Bolsa Família benefits available?**
You can use the `get_bolsa_familia_disponivel_por_cpf_ou_nis` tool by providing either the CPF or the NIS number of the individual. The agent will return the availability status and payment details.

**Is it possible to list all government agencies registered in the federal system?**
Yes, use the `get_orgaos_siafi` tool. It will fetch a paginated list of organizations registered in the SIAFI (Integrated System of Financial Administration) used by the Brazilian government.

**Can I see how much a specific company received from the government?**
Yes! Use the `get_despesas_documentos_por_favorecido` tool with the company's identifier (CNPJ or name). It will return expense documents associated with that beneficiary.