Skip to main content
Glama
MCP Brazil Public Data

MCP Brazil Public Data

by devantage

Logo

MCP Brazil Public Data

A modern Model Context Protocol server for Brazilian public data, backed by BrasilAPI — no API key required. Exposes 15 tools and 2 guided prompts covering companies (CNPJ), postal codes (CEP), banking, economy, geography, and more.

Inspired by the project alanpcf/brasil-data-mcp, but adding Streamable-HTTP transport.

Requirements

  • Python 3.10+

  • uv (or Docker, for the containerized setup)

Related MCP server: brasilapi-mcp

Installation

uv venv

uv pip install -e ".[dev]"

Running

The server supports two transports, selected via the MCP_TRANSPORT environment variable (see Configuration).

STDIO

The server speaks MCP over stdio by default (the transport used by most MCP clients such as Claude Desktop and Claude Code):

source .venv/bin/activate

mcp-brazil-public-data

Streamable HTTP

To serve over streamable HTTP instead:

source .venv/bin/activate

MCP_TRANSPORT=http mcp-brazil-public-data

The HTTP endpoint is then available at http://0.0.0.0:8080/mcp/.

Docker

Build the image and run it in HTTP mode (the image defaults to HTTP on port 8080):

docker build -t mcp-brazil-public-data .

docker run --rm -p 8080:8080 mcp-brazil-public-data

Override any setting at runtime with -e, e.g. a different port:

docker run --rm -p 9000:9000 -e MCP_PORT=9000 mcp-brazil-public-data

Configuration

Variable

Default

Description

MCP_TRANSPORT

stdio

Transport to use: stdio or http (streamable HTTP).

MCP_HOST

0.0.0.0

Host/interface to bind when using HTTP. Use 0.0.0.0 to expose it.

MCP_PORT

8080

Port to listen on when using HTTP.

Available Tools

Companies & Finance

Tool

Description

Source

lookup_cnpj

Company registration data (legal name, status, partners, CNAE)

Federal Revenue

lookup_broker

CVM-authorized brokerage firm by CNPJ

CVM

list_banks

List of ~250 registered banks

BACEN

get_bank

Bank data by COMPE code

BACEN

Location & Geography

Tool

Description

Source

lookup_cep

Full address from a postal code (CEP)

Correios/ViaCEP

lookup_ddd

State and cities served by an area code (DDD)

—

list_states

27 states (UFs) with IBGE codes

IBGE

list_municipalities

Municipalities of a state with IBGE codes

IBGE

Economy

Tool

Description

Source

list_rates

Current economic indices (SELIC, CDI, IPCA)

BACEN

get_rate

Current value of an index by symbol

BACEN

list_currencies

Foreign currencies available for quotes

BACEN

get_exchange_rate

PTAX quote of a currency on a date

BACEN

Reference

Tool

Description

Source

list_holidays

National holidays for a year

—

lookup_isbn

Book metadata by ISBN

CBL/Google Books

check_br_domain

Status of a .br domain

Registro.br

Guided Prompts

Prompt

Description

analyze_company

Looks up a CNPJ and produces a structured company analysis

economic_overview

Combines current economic rates with the year's holidays

Development

Testing

Run the test suite with:

pytest

License

MIT

Available Tools

15 tools
check_br_domainA

Check the status of a .br domain at Registro.br.

Returns the status (available, registered, etc.), suggestions and, for registered domains, the creation, expiration and last-processed dates.

Inputs: domain (required). Returns: object

get_bankA

Get a bank's data by its COMPE code.

Returns ISPB, name, full name and bank code.

Inputs: code (required). Returns: object

get_exchange_rateA

Get the buy/sell exchange rate of a currency on a specific date.

Returns the Central Bank's PTAX rates (buy/sell) for the given date. Note: quotes are only available on business days.

Inputs: date (required), currency (required). Returns: object

get_rateB

Get the current value of an economic rate/index by its symbol.

Returns the name and the current value of the indicator.

Inputs: symbol (required). Returns: object

list_banksA

List all banks registered in Brazil (~250 institutions).

Each item includes the COMPE code (code), ISPB, name and full name. Useful to discover a bank's code before calling get_bank.

Inputs: no named parameters. Returns: result

list_currenciesA

List the foreign currencies available for quotes (USD, EUR and others).

Each item includes the symbol, name and type of the currency. Use the returned symbol with get_exchange_rate.

Inputs: no named parameters. Returns: result

list_holidaysA

List the Brazilian national holidays for a given year.

Returns each holiday with its date (YYYY-MM-DD), name and type (national, movable, etc.). Does not include state or municipal holidays.

Inputs: year (required). Returns: result

list_municipalitiesA

List the municipalities of a state with their IBGE codes.

Returns the name and IBGE code of each municipality in the given state.

Inputs: uf (required). Returns: result

list_ratesA

List all available economic rates and indices with their current values.

Includes indicators such as SELIC, CDI and IPCA. Each item has the symbol (nome) and the value (valor). Source: BACEN via BrasilAPI.

Inputs: no named parameters. Returns: result

list_statesA

List the 27 Brazilian federative units (states) with their IBGE codes.

Each item includes the id (IBGE code), abbreviation (UF), name and region.

Inputs: no named parameters. Returns: result

lookup_brokerA

Look up a CVM-authorized brokerage firm by its CNPJ.

Returns trade name, legal name, status, address and contacts registered with the CVM (Brazilian Securities and Exchange Commission).

Inputs: cnpj (required). Returns: object

lookup_cepA

Look up the full address for a Brazilian postal code (CEP).

Returns street, neighborhood, city, state (UF) and, when available, geographic coordinates. Uses BrasilAPI's CEP v2 endpoint, which aggregates multiple providers (Correios, ViaCEP and others).

Inputs: cep (required). Returns: object

lookup_cnpjA

Look up the registration data of a Brazilian company by its CNPJ.

Returns legal name, trade name, registration status, legal nature, CNAE (primary and secondary activities), address, partners (QSA) and share capital. Source: Brazilian Federal Revenue via BrasilAPI.

Inputs: cnpj (required). Returns: object

lookup_dddA

Look up the state and cities served by a Brazilian area code (DDD).

Returns the state (UF) and the list of municipalities covered by the code.

Inputs: ddd (required). Returns: object

lookup_isbnA

Look up a book's metadata by its ISBN.

Returns title, authors, publisher, year, synopsis and dimensions when available, aggregating providers such as CBL, Mercado Editorial and Google Books.

Inputs: isbn (required). Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 15 tools

    Disambiguation3/5

    Most tools are distinct (CNPJ, CEP, DDD, ISBN, bank, broker, domain are clearly separate). However, list_rates/get_rate and list_currencies/get_exchange_rate are legitimate duos, but list_banks/get_bank alongside list_rates/get_rate create a repetitive pattern where the list/get pairing could cause an agent to pick the wrong 'get' for a given symbol/code. list_states and list_municipalities are related but distinct enough.

    Naming Consistency4/5

    The set follows a mostly consistent pattern: list_X for enumeration (list_states, list_banks, list_holidays, list_rates, list_currencies, list_municipalities), lookup_X for single-record lookups by identifier (lookup_cnpj, lookup_cep, lookup_ddd, lookup_isbn, lookup_broker), and get_X for fetching specific values (get_bank, get_rate, get_exchange_rate). The mixing of 'lookup' and 'get' for similar operations is the only inconsistency, though both are clear.

    Tool Count4/5

    15 tools is slightly on the higher side but reasonable for a broad 'public data' server covering multiple domains (geography, companies, finance, telecom, books, domains). Each tool targets a distinct data source, so none feel redundant. Could arguably be trimmed, but the scope justifies the count.

    Completeness3/5

    The server covers a broad but shallow set of disjoint domains. Within each domain there are clear gaps: holidays has no state/municipal holidays (noted in description), banks has list+get but no search-by-name, rates/currencies are read-only with no historical range beyond specific date for exchange. The domain is inherently a heterogeneous reference service, so completeness is hard to define, but several common lookups (e.g., CNPJ search by name, CEP range) are absent.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Exposes 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.
      41
      Apache 2.0
    • A
      license
      A
      quality
      C
      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
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI assistants to query Brazilian public data through BrasilAPI, including company registry details and partners by CNPJ, addresses by CEP, and national holidays. It also performs offline CNPJ/CPF validation before any network request and does not store queried numbers.
      5
      60 npm
      MIT