mcp-brasil-data
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcp-brasil-data
An MCP server that gives AI assistants (Claude Desktop, Claude Code, Cursor and any MCP client) access to Brazilian public data: postal codes, company registry, national holidays, business-day math and official exchange rates.
Tools
Tool | What it does | Source |
| Address for a CEP (postal code) | ViaCEP |
| Offline check-digit validation, including the new alphanumeric CNPJ format | — |
| Public company data: legal name, status, main activity (CNAE), location | BrasilAPI |
| National holidays for a year | BrasilAPI |
| Business days between two dates, excluding weekends and national holidays | BrasilAPI |
| Official PTAX rate (BRL per unit) for USD, EUR, GBP and others; falls back to the latest previous quote on weekends and holidays | Banco Central do Brasil (Olinda OData) |
Example prompts once it is connected:
"Which city is CEP 01310-100 in?"
"How many business days are there between 2026-11-01 and 2026-12-31?"
"Convert US$ 2,500 to BRL using today's PTAX selling rate."
"Is 11.222.333/0001-81 a valid CNPJ? Who owns it?"
Related MCP server: MCP Brazil Public Data
Install
Requires Node.js 20+.
git clone <this repo>
cd mcp-brasil-data
npm install
npm run buildClaude Code
claude mcp add brasil-data -- node /absolute/path/to/mcp-brasil-data/dist/index.jsClaude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"brasil-data": {
"command": "node",
"args": ["/absolute/path/to/mcp-brasil-data/dist/index.js"]
}
}
}Development
Command | What it does |
| Compile TypeScript to |
| Type-check without emitting |
| Unit + integration tests (Vitest) |
src/
index.ts stdio entry point
server.ts tool registration, input schemas, error mapping
http.ts fetch wrapper with timeout and typed errors
validation.ts CEP / CNPJ / date parsing and validation
services/ one module per upstream API
test/
server.test.ts end-to-end through an in-memory MCP client
services.test.ts upstream mapping with a fake fetch
validation.test.ts pure validation rulesDesign decisions
Dependency injection for I/O. Every service receives a
fetchfunction, and the server receivesfetchand a clock. Tests never hit the network and the date defaults are deterministic.End-to-end tests through the protocol.
server.test.tsconnects a real MCPClientto the server over an in-memory transport and calls tools exactly like Claude would.Errors are tool results, not crashes. Validation and upstream failures come back as
isError: truewith a readable message, so the model can recover or explain the problem.Validate before calling out. Malformed CEPs and CNPJs with wrong check digits are rejected locally, saving a network round trip.
Dates are calendar dates. All date math runs in UTC on
YYYY-MM-DDvalues; "today" is resolved in theAmerica/Sao_Paulotime zone.Holidays follow BrasilAPI. Its national list includes Carnival and Corpus Christi, which are optional days off for many employers. Business-day counts treat every listed date as a holiday, and the response says which ones were excluded.
Limitations
lookup_cnpjaccepts numeric CNPJs only. The alphanumeric format validates offline, but public lookup APIs do not serve it yet.State and municipal holidays are not included.
PTAX quotes are published on business days. Before the closing bulletin (around 1 p.m. Brasília time) the tool returns the latest intermediate bulletin and labels it.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Brazil CNPJ, CEP, Selic/IPCA/PTAX, holidays, banks/ISPB for agents. Pay per call in USDC (x402).
Brazilian company data & sanctions screening for AI agents. Certified. Pay-per-call x402.
Official remote MCP server for Brazilian company data (CNPJ): lookup, filtered search, contacts and partners with masked CPF. 70M CNPJs, base of Aug 2026; updated monthly, with the base date in every response. https://cnpj.ia.br/?utm_source=glama&utm_medium=listing
Brazilian public data API for AI agents. BCB, IBGE, CVM, B3, compliance. x402 payments on Base.
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
- AlicenseAqualityBmaintenanceEnables LLMs to access Brazilian public data through MCP tools for querying CNPJ, CEP, banks, and national holidays.4MIT