brasilapi-mcp
Click on "Install 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-mcpwhat's the address for CEP 01001-000?"
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
An authored Model Context Protocol (MCP) server that exposes the public BrasilAPI as tools an LLM client (Claude Desktop, Claude Code, or any MCP host) can call: look up a CEP, a CNPJ, banks, FIPE vehicle prices, national holidays, and DDD area codes.
Why this exists
Consuming someone else's MCP server is easy; I wanted to prove I can build one — tool schemas, a typed HTTP client, and a boundary that keeps the whole thing testable. BrasilAPI is a good fit: it needs no API key and serves public data, so anyone can clone this and run it immediately, and every tool is exercised in tests without touching the network.
Related MCP server: MCP Brasil API
Tools
Tool | What it returns |
| Address for a Brazilian postal code (accepts |
| Company registration for a CNPJ (legal name, address, activity, status) |
| Every bank registered at the Brazilian Central Bank |
| A single bank by its numeric code (e.g. |
| National holidays for a given year |
| State and cities served by a two-digit phone area code |
| FIPE vehicle brands for |
| FIPE reference price table for a model code |
Install
pip install -e .Dependencies are just mcp (the official Python SDK, v2) and httpx.
Run it
brasilapi-mcp # runs the MCP server over stdio (what an MCP client launches)
brasilapi-mcp --help # prints usage and exits, without opening a socketThe server speaks MCP over stdio — you normally don't run it by hand; an MCP client launches it and
talks to it. python -m brasilapi_mcp.server works too.
Wire it into a client
Claude Desktop — add to claude_desktop_config.json:
{
"mcpServers": {
"brasilapi": {
"command": "brasilapi-mcp"
}
}
}If brasilapi-mcp isn't on your PATH, point command at your venv's script (e.g.
.../.venv/Scripts/brasilapi-mcp on Windows) or use "command": "python", "args": ["-m", "brasilapi_mcp.server"].
Claude Code — one command:
claude mcp add brasilapi -- brasilapi-mcpThen ask, in plain language: "what's the address for CEP 01001-000?" or "list the national holidays in 2026", and the model will call the matching tool.
Design — why it tests offline
The network sits behind an injectable boundary. BrasilAPIClient takes an optional
httpx.Client/transport, so the test suite passes an httpx.MockTransport with canned JSON and runs
with no real network I/O. The tool bodies are thin wrappers over plain, synchronous functions
that take the client explicitly, so the logic is unit-testable in isolation, and a BrasilAPIError
becomes a clean message the model can read instead of a traceback.
Testing
pip install -e ".[dev]"
pytest -qThe suite covers the client (every endpoint, input normalization, 404/500 handling) against a mock transport, the tool logic functions, and the server's tool registration. Nothing hits the network.
A note on the data
BrasilAPI is a public service and needs no key; this server stores no secrets and reads no environment variables. Live responses are owned by BrasilAPI and its upstream sources.
License
MIT — see LICENSE.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- FlicenseBqualityDmaintenanceQuery a variety of data from Brasil resources seamlessly. Access information on postal codes, area codes, banks, holidays, taxes, and more through a unified interface. Enhance your AI agents and applications with rich and updated data from BrasilAPI effortlessly.67
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to query Brazilian public data such as CEP, CNPJ, DDD, exchange rates, banks, and holidays via the Model Context Protocol.12MIT
- AlicenseAqualityCmaintenanceExposes 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
- AlicenseNot gradedqualityCmaintenanceBrazilian company-registry lookup via Receita Federal, allowing AI agents to query CNPJ data.6MIT
Related MCP Connectors
Validate LatAm IDs: Mexican CLABE, Brazilian CNPJ/CPF checksums + BrasilAPI company/CEP/bank lookups
IBGE: geography, census, economy and health from the official APIs, with provenance. 21 tools.
Free Brazilian CNPJ lookup (legal name, status, partners) + lawsuit discovery. Public data, no login
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/monkaS013/brasilapi-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server