mcp-brasil-data
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., "@mcp-brasil-data Which city is CEP 01310-100 located in?"
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.
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
Available Tools
6 toolsbusiness_days_betweenCount business daysARead-only
Counts business days between two dates (inclusive), excluding weekends and Brazilian national holidays.
Inputs: end (required), start (required).
get_ptax_rateGet the PTAX exchange rateARead-only
Returns the official PTAX closing rate (BRL per unit of foreign currency) published by Banco Central do Brasil. If the date has no quote (weekend or holiday), returns the latest previous quote.
Inputs: date, currency.
list_holidaysList Brazilian national holidaysARead-only
Lists national holidays in Brazil for a given year, using BrasilAPI.
Inputs: year (required).
lookup_cepLook up a Brazilian postal codeARead-only
Returns street, neighborhood, city and state for a Brazilian CEP (postal code), using ViaCEP.
Inputs: cep (required).
lookup_cnpjLook up a company by CNPJBRead-only
Returns public registration data for a Brazilian company (legal name, status, main activity, location) using BrasilAPI.
Inputs: cnpj (required).
validate_cnpjValidate a CNPJARead-only
Checks the CNPJ check digits offline. Supports both the classic numeric format and the alphanumeric format introduced by Receita Federal.
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 6 tools
Each tool targets a clearly distinct resource and action: postal code lookup, CNPJ validation (offline check digits), CNPJ registry lookup, holiday listing, business-day counting, and PTAX rate retrieval. The only near-pair, validate_cnpj vs lookup_cnpj, is explicitly differentiated in their descriptions as offline checksum vs online registration data.
Most names follow a clean verb_noun convention (lookup_cep, validate_cnpj, lookup_cnpj, list_holidays, get_ptax_rate) with consistent snake_case. business_days_between breaks the pattern by using a noun phrase with no leading verb, a minor but noticeable deviation.
Six tools is a tight, well-scoped set for a Brazilian data utility server, with no filler entries. Every tool covers a distinct data source or computation and earns its place.
Coverage spans postal codes, company validation and lookup, holidays, business-day math, and exchange rates, forming a coherent utility surface. However, CPF validation/lookup is a glaring omission for a Brazilian data toolkit, and there is no direct 'is this date a holiday' check to complement the range-based tools.
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.
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.
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
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 LLMs to access Brazilian public data through MCP tools for querying CNPJ, CEP, banks, and national holidays.4MIT
- 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