Skip to main content
Glama
lucianoon

mcp-brasil

by lucianoon

mcp-brasil

一个 MCP(模型上下文协议) 服务器,将巴西公共数据作为工具提供给 AI 助手: Claude Desktop、Claude Code、Cursor 以及任何 MCP 客户端。

可用工具

来源

工具

描述

IBGE/SIDRA

ibge_populacao, ibge_pib, ibge_municipios, ibge_sidra

人口、GDP、城市搜索以及任意 SIDRA 聚合的通用查询

Banco Central

bcb_serie, bcb_cambio, bcb_moedas, bcb_focus

SGS 时间序列(Selic、IPCA...)、PTAX 汇率、货币列表以及 Focus 公报预期

INMET

inmet_estacoes, inmet_dados

气象站列表和每小时观测数据(观测数据需要令牌)

Câmara dos Deputados

camara_deputados, camara_detalhes_deputado, camara_proposicoes, camara_votacoes_proposicao

议员、立法提案和投票

所有来源均为官方开放 API——无需 API 密钥,但 INMET 的每小时数据除外(见下文)。

Related MCP server: ibge-data-mcp

安装

要求:uv(或 Python 3.12+ 及 pip)。

git clone https://github.com/lucianoon/mcp-brasil
cd mcp-brasil
uv sync

配置

Claude Desktop / Cursor

添加到配置文件(claude_desktop_config.jsonmcp.json):

{
  "mcpServers": {
    "mcp-brasil": {
      "command": "uv",
      "args": ["run", "--directory", "/caminho/para/mcp-brasil", "mcp-brasil"]
    }
  }
}

Claude Code

claude mcp add mcp-brasil -- uv run --directory /caminho/para/mcp-brasil mcp-brasil

可选的 INMET 令牌

站点列表(inmet_estacoes)是开放的。但每小时观测数据inmet_dados)需要 INMET 提供的令牌——请在 portal.inmet.gov.br 申请,并在 MCP 客户端中配置环境变量:

{
  "mcpServers": {
    "mcp-brasil": {
      "command": "uv",
      "args": ["run", "--directory", "/caminho/para/mcp-brasil", "mcp-brasil"],
      "env": { "INMET_TOKEN": "seu-token" }
    }
  }
}

没有令牌,其余 13 个工具正常工作。

使用示例

配置后,直接向助手提问:

  • "过去 6 个月的 IPCA 是多少?"

  • "市场对接下来几次会议的 Selic 预期是什么?"(Focus 公报)

  • "X 党的米纳斯吉拉斯州联邦议员有哪些?"

  • "2022 年圣保罗的人口是多少?GDP 呢?"

  • "最近几天 PTAX 美元汇率如何?"

  • "搜索 2025 年关于心理健康的法案"

  • "亚马逊州有哪些 INMET 自动站?"

开发

uv sync --dev
uv run pytest
uv run ruff check .
uv run mypy src

架构

src/mcp_brasil/
├── server.py        # Servidor MCP e registro das tools
├── http.py          # Cliente HTTP compartilhado, retry e tratamento de erros
├── cache.py         # Cache TTL em memória para as respostas das APIs
└── tools/
    ├── ibge.py      # SIDRA v3 + localidades v1
    ├── bcb.py       # SGS + Olinda (PTAX e Boletim Focus)
    ├── inmet.py     # Estações e dados observacionais
    └── camara.py    # Dados Abertos da Câmara v2
  • stdio 传输(MCP 桌面标准)

  • 相同请求的 10 分钟 TTL 缓存

  • 网络故障时自动重试

  • 输出格式化为模型可读的文本

路线图

  • v0.2 — INMET(站点 + 带令牌的观测数据)和 Focus 公报

  • DOU:在联邦官方公报中搜索(等待稳定的公共 API)

  • TSE:选举结果

  • 在 PyPI 上发布(uvx mcp-brasil

  • 可选的 streamable-http 传输

许可证

MIT

Install Server
A
license - permissive license
A
quality
A
maintenance

Maintenance

Maintainers
Response time
0dRelease cycle
2Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    Connects AI agents to 28 Brazilian public APIs, providing over 200 tools to access data on economy, legislation, transparency, and the judiciary. It enables complex queries and cross-referencing of government datasets like IBGE, the Central Bank, and the National Congress through natural language.
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables LLMs to access Brazilian IBGE statistical data (population, economy, agriculture) via natural language, with tools for querying aggregated data and metadata.
  • A
    license
    A
    quality
    C
    maintenance
    Exposes the BrasilAPI as MCP tools, enabling AI agents to query Brazilian public data such as CEP, CNPJ, DDD, IBGE, banks, PIX, FIPE, NCM, exchange rates, taxes, weather, CVM information, holidays, ISBN, domains, stock tickers, and TUSS.
    41
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • Cross-asset market data for AI agents: forex, equities, Brazil macro (BCB/B3), crypto.

  • Brazilian Open Finance MCP — 30+ banks (Itaú, Nubank, etc.) to Claude/Cursor. Read-only.

  • Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lucianoon/mcp-brasil'

If you have feedback or need assistance with the MCP directory API, please join our Discord server