brasilapi-mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@brasilapi-mcp-server List the national holidays for 2025"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
brasilapi-mcp-server
Servidor MCP que expõe a BrasilAPI (pública, sem autenticação) como ferramentas para LLMs: consulta de CNPJ, CEP, bancos e feriados nacionais.
Serve dois papéis:
Standalone: conectado ao Claude Desktop/Claude Code via stdio, permite que o modelo consulte dados públicos brasileiros durante uma conversa.
Serviço de enriquecimento: usado por outros projetos deste portfólio (
lead-router) para enriquecer leads com dados de CNPJ/CEP.
Ferramentas expostas
Tool | Descrição |
| Razão social, endereço, situação cadastral e CNAE de uma empresa |
| Endereço e coordenadas de um CEP |
| Lista de bancos registrados no Banco Central (códigos COMPE/ISPB) |
| Feriados nacionais de um ano |
Related MCP server: brasilapi-mcp
Rodando localmente
uv sync
uv run brasilapi-mcp-serverConectando no Claude Desktop
Adicione em claude_desktop_config.json:
{
"mcpServers": {
"brasilapi": {
"command": "uv",
"args": ["--directory", "/caminho/para/brasilapi-mcp-server", "run", "brasilapi-mcp-server"]
}
}
}Rodando como serviço HTTP (streamable-http)
Para ser chamado por outros serviços deste portfólio (lead-router) sem um
processo MCP dedicado por cliente:
MCP_TRANSPORT=streamable-http MCP_HTTP_PORT=8001 uv run brasilapi-mcp-serverOu via Docker:
docker build -t brasilapi-mcp-server .
docker run -p 8001:8001 brasilapi-mcp-serverResiliência
Cache em memória (1h de TTL) para respostas de sucesso — ver
cache.py.Retry com backoff exponencial (2 tentativas) em 429/5xx; um 404 nunca é re-tentado — ver
client.py.Erros tipados:
NotFoundError,RateLimitedError,BrasilAPIError— ver AGENTS.md para o contrato completo de comportamento.Logs estruturados (JSON-lines em stderr) —
logging_config.py.
Testes
uv sync --group dev
uv run pytest
uv run ruff check .Roadmap
Cobertura de mais endpoints da BrasilAPI (DDD, tabela FIPE, câmbio)
Cache compartilhado (Redis) se rodar com mais de uma réplica
Available Tools
4 toolsget_holidaysARead-onlyIdempotent
List Brazilian national holidays for a given year.
Args: year: Four-digit year (e.g. 2026).
Inputs: year (required). Returns: result
list_banksARead-onlyIdempotent
List all Brazilian banks registered with the Central Bank, with their codes (COMPE/ISPB).
Inputs: no named parameters. Returns: result
lookup_cepARead-onlyIdempotent
Look up a Brazilian postal code (CEP) — street, neighborhood, city, state, and coordinates.
Args: cep: CEP number, with or without formatting (e.g. "01310930" or "01310-930").
Inputs: cep (required).
lookup_cnpjARead-onlyIdempotent
Look up a Brazilian company (CNPJ) — legal name, address, status, and business activity.
Args: cnpj: CNPJ number, with or without formatting (e.g. "19131243000197" or "19.131.243/0001-97").
Inputs: cnpj (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a completely distinct resource: companies (CNPJ), postal codes (CEP), banks, and holidays. There is no overlap in purpose or potential for misselection.
Naming is readable and noun-focused, but verbs are inconsistent: 'lookup_' for two tools, then 'list_', and 'get_'. The pattern is not uniform, though the differences are minor and contextually acceptable.
Four tools is slightly thin for a general Brazil data API but reasonable for a focused utility server. Each tool covers a meaningful public data lookup without redundancy.
The server covers a few common lookups but lacks many obvious BrasilAPI endpoints such as CPF (individual taxpayer), state/IBGE data, FIPE vehicle pricing, or DDD area codes. Agents needing these will hit dead ends.
Maintenance
Related MCP Connectors
Brazil CNPJ, CEP, Selic/IPCA/PTAX, holidays, banks/ISPB for agents. Pay per call in USDC (x402).
Find Brazilian companies by business activity (CNAE), location, company size, and registration status, using data from Brazil’s Federal Revenue Service. The Oportunidados MCP connector offers 24 tools to search and consult companies, view account information, and work in the account’s CRM. It reads company data and reads and writes CRM records, including deletions. Write and delete tools are labeled as such, so your AI client can ask for confirmation.
Open Finance API and MCP discovery for developers and AI agents building in Brazil.
Brazilian company data & sanctions screening for AI agents. Certified. Pay-per-call x402.
Related MCP Servers
- AlicenseAqualityDmaintenanceExposes 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.41Apache 2.0
- AlicenseAqualityCmaintenanceEnables LLM clients to query public Brazilian data through tools for CEP addresses, CNPJ registrations, banks, FIPE vehicle prices, national holidays, and DDD area codes, with no API key required.8MIT
- AlicenseAqualityCmaintenanceExposes Brazilian public data — postal codes (CEP), company registrations (CNPJ), CPF/CNPJ validation, banks, national holidays, municipalities, and DDD area codes — as MCP tools and resources, backed by BrasilAPI, ViaCEP, and IBGE with caching, fallback, and rate limiting. Any MCP client such as Claude Desktop or Claude Code can query and validate this reference and registration data through natural language or programmatic calls.1MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to query Brazilian public data through MCP tools: resolve postal codes to addresses, validate and look up company registry records, list national holidays, count business days between dates, and retrieve official PTAX exchange rates. Validation and upstream failures are returned as recoverable tool errors rather than crashes, so models can explain or retry problems in conversation.6MIT