MCP Brasil
Connect MCP-compatible AI clients to Brazilian government and public-institution data.
- Source repo
- Mcp-Brasil/mcp-brasil
- Stars
- ★ 1.9k
- Last updated
- 3mo ago v0.14.0
- FARS reviewed
- Nov 08, 2026
- License
- MIT
- Primary language
- Python
- FA score
- 55/100 · Major gaps
At a glance
- How it runs
- Works with
- Universal · cross-platformClaude Code · Claude.ai
- Cost
- Free, no paid service needed
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- An economic analyst can retrieve Banco Central Selic, IPCA, exchange-rate, and GDP time series for comparative analysis.
- Not a fit if
- Teams that need fully offline operation with no external API calls
- Users who require official government endorsement or guaranteed data accuracy
- Teams unwilling to self-host and maintain their own server
- Maintenance
- Commits in the last 6 monthslast commit 2026-08-19latest release v0.14.0 (2026-04-24)+1.1 ★/day over 7 days
- Source review
- 55/100 · Major gaps
What does this agent do, and when should you use it?
MCP Brasil is a self-hosted Python and FastMCP server spanning 15 subject areas, including economics, legislation, courts, elections, health, education, and public safety. The repository reports 70 features, 533 tools, 131 resources, and 102 prompts, with BM25 discovery used to surface contextually relevant tools. Most features call external APIs through asynchronous httpx clients, Pydantic v2 models, rate limiting, and retry backoff; selected large datasets are instead downloaded and queried through an embedded local DuckDB cache. Root-level meta-tools support feature listing, tool recommendations, multi-API query planning, parallel batch execution, and dataset discovery. It is a strong fit for teams that need broad Brazilian public-data access through MCP and can operate their own service, but it is unofficial and results intended for consequential use must be verified against the originating institution.
The mcp_brasil.server module auto-registers feature packages under data/, datasets/, and agentes/. REST features read Brazilian government and related public APIs with asynchronous HTTP clients, validate or structure responses with Pydantic, and expose the operations as MCP tools, resources, and prompts. recomendar_tools uses BM25 discovery to select relevant operations from the 533-tool catalog; planejar_consulta creates execution plans spanning multiple APIs; and executar_lote runs multiple queries in parallel within one call. Datasets enabled through MCP_BRASIL_DATASETS are downloaded from CSV or ZIP sources, ingested into a local DuckDB cache, and exposed through predefined query tools. Documented dataset examples include TSE candidates and votes, ANP fuel prices, INEP education records, and ANAC aviation data. The server runs over stdio for Claude Desktop, Claude Code, VS Code, and Cursor, or over HTTP at an /mcp endpoint.
- An economic analyst can retrieve Banco Central Selic, IPCA, exchange-rate, and GDP time series for comparative analysis.
- An investigative journalist can examine federal transparency records, contracts, suppliers, and state audit-court data, while verifying publishable findings with the official source.
- A legislative researcher can combine Câmara and Senado data on legislators, bills, votes, committees, and expenses.
- An election-research team can enable local TSE datasets to analyze candidates, declared assets, municipal voting, social links, and election-fund allocations from documented election years.
- A public-policy unit can cross-reference IBGE geography and population data with health, education, crime, or subnational fiscal indicators.
- An engineer adding another Brazilian API can follow the package-by-feature structure and validate the contribution with
make ci.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
pip install mcp-brasiluv add mcp-brasiluvx --from mcp-brasil python -m mcp_brasil.server
- Environment variables
TRANSPARENCIA_API_KEYDATAJUD_API_KEYMETA_ACCESS_TOKEN- Config files
claude_desktop_config.json.vscode/mcp.json
How do you install or deploy this agent?
Python is required. Install with pip:
pip install mcp-brasilOr with uv:
uv add mcp-brasilA documented direct launch through uvx is:
uvx --from mcp-brasil python -m mcp_brasil.serverOptional credentials include TRANSPARENCIA_API_KEY, DATAJUD_API_KEY, and META_ACCESS_TOKEN; some brapi.dev operations can also use a free token. The README gives conflicting counts for keyless APIs—66 in one section, 62 in another, and a separate reference to 36 remaining APIs—so adopters should verify credential requirements for the exact features they intend to use.
How do you use this agent?
For Claude Desktop, add an mcp-brasil entry under mcpServers in claude_desktop_config.json, set command to uvx, and use args equal to ["--from", "mcp-brasil", "python", "-m", "mcp_brasil.server"]. Add optional API keys under env.
For Claude Code, run:
claude mcp add mcp-brasil -- uvx --from mcp-brasil python -m mcp_brasil.serverFor VS Code or Cursor, create .vscode/mcp.json at the project root and configure the same uvx command and arguments.
For an HTTP client, run:
fastmcp run mcp_brasil.server:mcp --transport http --port 8000The endpoint is then available at http://localhost:8000/mcp. After connecting, issue a natural-language request such as comparing Selic and IPCA over the last 12 months. To use large local datasets, first set a value such as MCP_BRASIL_DATASETS=tse_candidatos,tse_bens,tse_votacao; the initial download and ingestion can take minutes.
Safety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
Inherits capabilities of connected MCP servers; audit third-party servers before enabling.
What are this agent's strengths and limitations?
- A single MCP server covers 70 documented features across 15 domains and exposes 533 tools, avoiding separate integrations for many Brazilian public APIs.
planejar_consultaandexecutar_loteprovide concrete support for cross-source planning and parallel batch queries.- BM25-based discovery narrows the large tool catalog to operations relevant to the current context.
- Optional DuckDB-backed datasets support repeated local analysis of large TSE, INEP, ANP, ANAC, and other published datasets.
- Documented stdio and HTTP modes, plus setup instructions for several MCP clients, reduce dependence on a single model vendor.
- The service depends on numerous third-party government and public APIs whose documentation, parameter coverage, and responses may be inconsistent.
- Optional local datasets range from roughly 100 MB to 1.6 GB and impose download time, disk usage, and initial ingestion costs.
- MIT applies only to repository code; every data source may have different licensing terms, and server use is governed by an Acceptable Use Policy.
- Health, judicial, and election data introduce legal and privacy obligations, with some personally identifiable datasets gated by
MCP_BRASIL_LGPD_ALLOW_PII. - The README contains inconsistent counts for keyless APIs and for the feature/tool catalog in different sections, so production adopters should validate the deployed inventory.
How does this agent compare with similar options?
Compared with building a separate client for every Brazilian public-data API, MCP Brasil supplies one MCP interface with automatic feature registration, cross-source planning, and batch execution. Its REST passthrough features favor lightweight online access, while the optional DuckDB path trades local storage and initial ingestion time for repeatable queries over large historical datasets.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| MCP Brasil This agent | 55 · Major gaps | MCP serverFree | ★ 1.9k | 3mo ago | Python | Claude Code · Claude.ai |
| OpenAccountants | 76 · Good | MCP serverFreemium | ★ 530 | today | HTML | ChatGPT · Claude.ai |
| World Monitor | 73 · Some gaps | Web appFree + model costs | ★ 91k | today | TypeScript | — |
| Flint Chart Language | 69 · Some gaps | Library / SDKFree | ★ 4.6k | 15d ago | TypeScript | Claude.ai |
How does FollowAgents rate this agent?
Why each dimension lost points
The README identifies the project as independent, distinguishes code licensing from data-source terms, and points users to SOURCES.md, ACCEPTABLE_USE.md, and NOTICE. It says API keys are optional and describes default PII masking; server.py shows logs recording tool names and elapsed time. The shown code does not establish least-privilege permissions for each tool or require confirmation before calls, and no per-item confirmation flow is shown for batch execution. Dataset downloads and external API calls have external effects. Dependencies use open-ended minimum versions, with no security audit evidence in the packet, so these areas lose points. The deployment workflow records the previous revision and restores it after a failed health check, supporting the rollback score.
The docs describe HTTP retries, timeouts, backoff, and cache refresh modes, providing some ordinary failure handling. However, README, Quick Start, and configuration docs disagree on API/feature/tool counts and API-key requirements (including 70/69 features and 533/525/435/205 tools, as well as differing Anthropic key guidance), reducing self-consistency. The shown server.py excerpt does not establish how API errors are surfaced clearly to users.
The README targets MCP client developers, gives examples across economic, legislative, and judicial use cases, and supports stdio, HTTP, several clients, and opt-in local datasets. The docs identify code mode as experimental, say datasets require explicit activation, and warn that AI may misinterpret results. However, tool selection and trigger conditions rely largely on natural-language discovery; the examples and search settings do not fully define capability boundaries.
The project separates features, shared code, and datasets, and provides installation, configuration, deployment, and development docs. Package metadata sets a version, and pyproject configures semantic releases and a changelog. README and Quick Start/configuration docs contain conflicting or stale counts and key requirements; FAQ and troubleshooting material are limited. License information clearly distinguishes MIT code licensing from data-source terms. Maintenance responsibility is described only as community issues and pull requests, without a named owner or support path.
The server aggregates many public data sources and provides search, planning, batch queries, and local DuckDB datasets, which can reduce the work of querying APIs separately. Tools return data for client use and the docs include sample questions. Initial dataset downloads can reach about 1.6 GB and take time, while the large tool set and changing external APIs add setup and maintenance costs, so the cost-benefit case is not uniformly strong.
The README links data-source, configuration, and disclaimer material; server.py directly supports claims about auto-registration, the health endpoint, and request logging. Conflicting counts and key requirements across README and configuration docs weaken cross-source corroboration. The disclaimer separates API-returned data from model interpretation and advises checking official sources for consequential use; some feature claims remain project assertions not corroborated by the supplied code or other materials.
- Tool, feature, and API counts and key requirements conflict across the docs; verify the feature catalog and configuration for the intended revision before relying on them.
- The README says large datasets may contain sensitive information and documents a PII allow-list setting. Review ACCEPTABLE_USE.md and SOURCES.md, and verify official sources before using datasets in sensitive, electoral, judicial, medical, or decision-making contexts.
Recent releases
Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.
-
Release notes excerpt
[0.14.0] - 2026-04-24 Bug Fixes - spu_siapa: Accent-insensitive filters + real categorical values + valores_distintos tool Documentation - datasets: Add SIAPA smoke-test report (20 real queries) - Refresh counters + add datasets guide Features - datasets: ADR-004 local DuckDB cache infrastructure + spu_siapa - tse_candidatos, tse_bens: Electoral datasets via DuckDB + cross-DB joins - tse: Multi-year TSE datasets (2014-2024) + redes sociais + FEFC <!-- generated by git-cliff -->View on GitHub ↗ -
Release notes excerpt
[0.13.0] - 2026-04-24 Documentation - Add tce_pa to README, update counters to 42 features / 367 tools - spu: Add live smoke-test report for new SPU tools Features - tce_pa: Add Diário Oficial publications feature - tce_pa: Add sessões plenárias, jurisprudência and pesquisa integrada - spu_geo: Add GeoPortal SPU integration via WMS GetFeatureInfo - spu_imoveis: Add Raio-X APF patrimônio-da-união integration - pncp: Add alienacoes_imoveis_spu prompt for SPU leilões <!-- generated by git-cliff -->View on GitHub ↗ -
Release notes excerpt
[0.12.1] - 2026-04-14 Bug Fixes - denasus: Update scraper for new gov.br page structure <!-- generated by git-cliff -->View on GitHub ↗
FAQ
Are API keys mandatory?
Is this an official Brazilian government service?
Does it download the large datasets by default?
MCP_BRASIL_DATASETS. The first activation downloads and ingests the selected files into DuckDB and may take several minutes.Can its answers be used directly for journalism, legal matters, or medical decisions?
Does the MIT license cover the returned data?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.