# mcp-brasil

> Open-source MCP server that connects AI agents to 70 Brazilian public data sources such as economy, legislation, transparency, judiciary, elections, health and education.

mcp-brasil is an independent, community-run MCP server from the Mcp-Brasil organization. It lets AI clients such as Claude Code, Claude Desktop, VS Code/Cursor and Google Antigravity query Brazilian government and public-interest data through natural-language questions. The README lists 533 tools, 131 resources and 102 prompts across 70 features. The latest release listed is v0.14.0.

## What It Is

mcp-brasil is a Python MCP server built on FastMCP that exposes Brazilian public APIs as tools for AI agents. Covered areas include economy and finance (Banco Central, BNDES, IPEADATA), geography and statistics (IBGE), legislative data (Câmara, Senado), transparency and audit bodies (Portal da Transparência, TCU and several state audit courts), the judiciary (DataJud, STF/STJ/TST jurisprudence), elections (TSE), environment, energy, health, public security, education and public procurement. The project states it is not an official government service, and that the MIT license covers the code only, while each data source has its own license.

## How the Workflow Works

You install the package with pip or uv and register it in an MCP client configuration, or run it over HTTP with fastmcp. You then ask questions in natural language, for example comparing Selic with IPCA, or listing the largest federal contracts. The README states that 66 APIs need no key, while a few use free keys: Portal da Transparência, DataJud, the Meta Ad Library and brapi.dev.

The root server adds meta-tools: listar_features, recomendar_tools, planejar_consulta, executar_lote and listar_datasets_disponiveis. planejar_consulta builds cross-API execution plans, and executar_lote runs queries in parallel in a single call. A BM25 search transform narrows the large tool catalog to the relevant tools.

## Local Datasets

Large datasets can be enabled through the MCP_BRASIL_DATASETS environment variable. They are downloaded into an embedded local DuckDB cache and queried through SQL-backed tools. Examples include SIAPA federal properties, TSE candidates, assets, votes and campaign funds, ANP fuel prices, INEP school census and ENEM microdata, ISP-RJ crime statistics, ANAC aircraft registry and CVM investment funds.

## Responsible Use

The project links to a data-sources file and an Acceptable Use Policy. It warns that AI models may misinterpret results and advises verifying against official sources before journalistic, judicial, medical or decision-making use.

## Features
- 533 tools across 70 features and 15 thematic areas
- Access to Brazilian economy, legislative, transparency, judiciary, electoral, environment, health, education and public security data
- Local DuckDB-cached large datasets, opt-in via environment variable
- Cross-API query planning with planejar_consulta
- Parallel batch execution with executar_lote
- BM25 smart tool discovery
- Auto-registry of features by folder
- Async HTTP with Pydantic v2 and rate limiting with backoff
- Stdio and HTTP transports

## Integrations
Claude Desktop, Claude Code, VS Code, Cursor, Google Antigravity, DuckDB, Portal da Transparência, DataJud/CNJ, IBGE, Banco Central, TSE, Meta Ad Library API, brapi.dev, BrasilAPI

## Platforms
WEB, API, VSC_EXTENSION, DEVELOPER_SDK, CLI

## Pricing
Open Source

## Version
v0.14.0

## Links
- Website: https://github.com/Mcp-Brasil/mcp-brasil
- Documentation: https://github.com/Mcp-Brasil/mcp-brasil/blob/main/docs/guide/quickstart.md
- Repository: https://github.com/Mcp-Brasil/mcp-brasil
- EveryDev.ai: https://www.everydev.ai/tools/mcp-brasil
