brasil-api-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., "@brasil-api-mcp-server get the postal code info for 01310-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 Server
Query 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.
Check the complete and official documentation from BrasilAPI here.
Tools
This server provides tools to query every endpoint available from BrasilAPI. Under the hood, it uses this JS client to communicate with the API: https://github.com/WillianAgostini/brasilapi-js
Check the Tools page in Smithery to inspect and test each one of them.
Related MCP server: MCP Brazil Public Data
Development
Install dependencies:
npm installBuild the server:
npm run buildFor development with auto-rebuild:
npm run watchDebugging
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:
npm run inspectorTo generate an updated build and inspect:
npm run build-and-inspectThe Inspector will provide a URL to access debugging tools in your browser.
Integration with AI applications
Running through Smithery
Run the server automatically via Smithery:
npx -y @smithery/cli install @mauricio-cantu/brasil-api-mcp-serverUsage with Claude
npx -y @smithery/cli@latest install @mauricio-cantu/brasil-api-mcp-server --client claudeCursor and other integrations
Check the Server page in Smithery to get other integration options such as Cursor and more.
Running the server with a local copy
After you've downloaded this project, you can run the server using node:
node /absolute/path/to/brasil-api-mcp-server/build/index.jsAt the root of the project there's also a Dockerfile to build and run the image if you'd like.
Server's capabilities inspection
You can inspect this MCP server's capabilities using Smithery:
npx -y @smithery/cli@latest inspect @mauricio-cantu/brasil-api-mcp-serverThis will show you all available tools, their parameters, and how to use them.
Project structure
src/
├── apiClient/ # BrasilAPI client
├── tools/ # Tools implementations
├── types/ # Interfaces and types
├── utils/ # Utility functions
└── index.ts # MCP main file (server setup and tools listing)Available Tools
6 toolsget_all_banksB
Get information of all banks from Brazil.
Inputs: no named parameters.
get_bank_by_codeB
Get information from a specific bank given its code. The code from each bank is returned by get_all_banks tool.
Inputs: code (required).
get_cnpjC
Get information about a company given a CNPJ.
Inputs: CNPJ (required).
get_isbnB
Get information about a book given an ISBN.
Inputs: ISBN (required).
get_postal_code_v1C
Get a location data given a CEP (postal code).
Inputs: cep (required).
get_postal_code_v2C
Version 2 of get a location data given a CEP (postal code).
Inputs: cep (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Most tools have distinct purposes targeting different Brazilian data types (banks, CNPJ, ISBN, postal code), but get_postal_code_v1 and get_postal_code_v2 create ambiguity as they appear to serve the same function with only version differences. The descriptions clarify they both get location data from CEP, which could cause confusion about which to use.
All tools follow a consistent verb_noun pattern with 'get_' prefix and descriptive suffixes (e.g., get_all_banks, get_bank_by_code, get_cnpj). The naming is perfectly uniform across all six tools, making them predictable and easy to understand.
Six tools is a reasonable count for a Brazilian API server covering multiple data domains. However, having two postal code tools for essentially the same function feels slightly redundant, making the set a bit over-scoped for its apparent purpose of providing Brazilian data lookups.
The server covers several distinct Brazilian data types (banks, CNPJ, ISBN, postal code), but there are notable gaps. For example, it lacks tools for other common Brazilian identifiers like CPF or tools for related operations like searching or filtering within these domains. The coverage feels patchy rather than comprehensive for a Brazilian data API.
Maintenance
Related MCP Connectors
Brazil CNPJ, CEP, Selic/IPCA/PTAX, holidays, banks/ISPB for agents. Pay per call in USDC (x402).
Brazilian public data API for AI agents. BCB, IBGE, CVM, B3, compliance. x402 payments on Base.
Company by CNPJ, CEP, holidays, area codes, banks, NCM, Selic, CDI and IPCA, and CPF and CNPJ checks
Argentina/Brazil data for agents: ARS dollar rates, INDEC CPI, holidays, CUIT/CPF/CNPJ, CEP, PTAX.
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 lookup of Brazilian public data including companies (CNPJ), postal codes (CEP), banking, economy, geography, and more through 15 tools and 2 guided prompts, powered by BrasilAPI with no API key required.15MIT
- 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