Skip to main content
Glama
cnpjaberto

cnpjaberto

Official
by cnpjaberto

cnpjaberto

Python SDK and Model Context Protocol (MCP) server for cnpjaberto.com.br, the open registry of Brazilian companies (CNPJ). It allows for company lookups, partner graphs, joins by address and contact, CNAE statistics, and national/annual overviews.

pip install cnpjaberto          # apenas SDK
pip install cnpjaberto[mcp]     # SDK + servidor MCP para Claude Desktop e similares

Quick start with the SDK

from cnpjaberto import Client

with Client() as cnpj:                       # lê CNPJABERTO_API_KEY do ambiente
    empresa = cnpj.lookup("18.236.120/0001-58")
    print(empresa["razao_social"])

    achados = cnpj.search("nubank", per_page=5)
    for h in achados["results"]:
        print(h["cnpj"], h["razao_social"])

    snap = cnpj.panorama_year(2024)
    print(f"{snap['abertas']:,} abertas, {snap['fechadas']:,} fechadas em 2024")

Anonymous calls work, subject to public rate limits. For the Pro plan daily quota, generate a key at cnpjaberto.com.br/planos and export it:

export CNPJABERTO_API_KEY=sua_chave_aqui

Related MCP server: mcp-server-brasil

MCP Server (Claude Desktop, Cursor, Cline)

Install the extra and add this config to your client.

pip install cnpjaberto[mcp]

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "cnpjaberto": {
      "command": "cnpjaberto-mcp",
      "env": { "CNPJABERTO_API_KEY": "sua_chave_aqui" }
    }
  }
}

Restart Claude Desktop. Now you can ask things like:

  • "Look up CNPJ 18.236.120/0001-58 and tell me when it was founded."

  • "How many Brazilian companies opened in 2024 vs 2023? Which states grew the most?"

  • "Find companies where 'Maria Silva' appears as a partner, grouped by state."

  • "What other companies are registered at the same address as the Magazine Luiza headquarters?"

Exposed Tools

Tool

What it returns

lookup_cnpj(cnpj)

Full record: company name, capital, partners, with estabelecimentos[] (headquarters and branches, address, phone numbers, CNAEs)

list_filiais(cnpj)

Branches of a headquarters, paginated, optional filter by state (UF)

search_companies(query)

Search by company name, trade name, or CNPJ digits (minimum 3 chars)

companies_by_owner(name)

Companies where the person appears as a partner; cpf helps disambiguate homonyms

companies_at_same_address(cep, logradouro, numero)

Other companies registered at the same address

`companies_by_contact(email

ddd+telefone)`

Companies that share the same email or phone number

cnae_stats(codigo)

Aggregated statistics for a CNAE (count, top states, top municipalities)

panorama_overview()

National statistics: top states and CNAEs, capital ranges, age, 10-year history

panorama_year(year)

Annual snapshot: openings and closings, monthly series, MEI share

Typed errors

from cnpjaberto import Client, NotFoundError, RateLimitError, AuthError

with Client() as cnpj:
    try:
        cnpj.lookup("00000000000000")
    except NotFoundError:
        ...
    except RateLimitError as e:
        print("Cota diária:", e.payload)
    except AuthError:
        ...

Data source

All data comes from the public CNPJ dump from the Federal Revenue Service, updated monthly. cnpjaberto.com.br ingests, indexes, and serves with sub-second lookups, plus value-added joins (partner graph, shared addresses, CNAE aggregates) covering about 70 million establishments and 67 million companies.

License

MIT.

A
license - permissive license
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • CNPJ Brazil MCP — Brazilian company-registry (Receita Federal) lookup via

  • MCP server for live, sourced Brazilian public data from the official IBGE APIs.

  • MCP server for Brazilian Federal Senate open data (legislative, administrative, e-Cidadania).

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cnpjaberto/cnpjaberto-py'

If you have feedback or need assistance with the MCP directory API, please join our Discord server