Skip to main content
Glama

mcp-dados-br

CI MCP License: MIT

An MCP (Model Context Protocol) server that gives Claude and other AI assistants access to Brazilian public data: official exchange rates, interest rates, inflation, unemployment, postal codes, company registry and holidays.

No API keys. Data comes straight from Banco Central do Brasil and BrasilAPI.

"How much is US$ 5,000 in reais today?" → converter_moeda → R$ 27,843.00 (PTAX 5.5686, Dec 1 2026)

Tools

Tool

What it does

Source

cotacao_ptax

Official PTAX rate for any currency and date; on weekends/holidays it returns the previous business day

BCB PTAX

converter_moeda

Converts between BRL and foreign currencies (or two foreign ones) with the PTAX selling rate

BCB PTAX

serie_bcb

Selic target, effective Selic, CDI, IPCA (monthly and 12-month), IGP-M, unemployment, or any SGS series by code

BCB SGS

consultar_cep

Address and coordinates for a postal code

BrasilAPI

consultar_cnpj

Company registry data: legal name, status, CNAE, size, location

Receita Federal via BrasilAPI

feriados_nacionais

National holidays for a year, including movable ones

BrasilAPI

Also exposes:

  • Resource dados-br://indicadores: the indicator catalog (SGS code, unit, frequency)

  • Prompt panorama_economico: a short briefing on Selic, inflation, unemployment and the dollar

Related MCP server: mcp-mercado-financeiro-brasil

Install

Claude Code

claude mcp add dados-br -- npx -y github:DanielCamucatto/mcp-dados-br

Claude Desktop / other MCP clients

{
  "mcpServers": {
    "dados-br": {
      "command": "npx",
      "args": ["-y", "github:DanielCamucatto/mcp-dados-br"]
    }
  }
}

Requires Node.js 20+.

Example prompts

  • "Qual foi a PTAX do euro no último dia útil de 2025?"

  • "Como a Selic e o IPCA 12 meses evoluíram nos últimos 6 meses?"

  • "Quais feriados de 2027 caem em dia de semana?"

  • "Consulta o CNPJ 00.000.000/0001-91 e me diz a atividade principal."

Design notes

  • Errors are returned as data (isError: true) with a readable message, so the model can recover (e.g. ask for a valid CEP) instead of the call crashing.

  • Validation before network: inputs are validated with Zod; CNPJ check digits are verified locally, including the new alphanumeric CNPJ (Receita Federal, July 2026).

  • Privacy by default: consultar_cnpj drops partner (QSA) personal data from the response.

  • Business-day aware: PTAX looks back up to 10 days and prefers the closing bulletin; dates use Brasília time.

  • Future-dated points filtered: the BCB publishes some series ahead (e.g. the Selic target until the next Copom), so serie_bcb only returns values up to today.

  • Read-only tools annotated with readOnlyHint, an in-memory TTL cache to avoid hammering public APIs, and timeouts on every request.

  • Each tool returns both a JSON text block and structuredContent.

Development

npm install
npm test          # Vitest: unit tests + in-memory MCP client/server tests with mocked fetch
npm run build
npm run inspect   # opens the MCP Inspector against the built server
src/
├── index.ts          # stdio entry point
├── server.ts         # McpServer: tools, resource and prompt
├── tools/bcb.ts      # PTAX, conversion, SGS series
├── tools/brasilapi.ts# CEP, CNPJ, holidays
├── series.ts         # indicator catalog
├── cnpj.ts           # CNPJ normalization + check digits
├── dates.ts          # date formats and Brasília "today"
├── http.ts           # fetch with timeout, errors and TTL cache
└── result.ts         # tool result helpers

License

MIT · Built by Daniel Camuçatto

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables 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.
      15
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables 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.
      8
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Exposes 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.
      1
      MIT