The repository or configuration that created this release differ from a previous release. View details.
cnpjaberto
SDK em Python e servidor Model Context Protocol (MCP) para o cnpjaberto.com.br, o cadastro aberto de empresas brasileiras (CNPJ). Permite consulta de empresa, grafo de sócios, joins por endereço e contato, estatísticas por CNAE, e panoramas nacional e anual.
pip install cnpjaberto # apenas SDK
pip install cnpjaberto[mcp] # SDK + servidor MCP para Claude Desktop e similares
Início rápido com o 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")
A chave de API é obrigatória. Crie uma conta gratuita em cnpjaberto.com.br/planos, copie sua chave e exporte:
export CNPJABERTO_API_KEY=sua_chave_aqui
Servidor MCP (Claude Desktop, Cursor, Cline)
Instale o extra e adicione esta config no seu cliente.
pip install cnpjaberto[mcp]
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) ou %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"cnpjaberto": {
"command": "cnpjaberto-mcp",
"env": { "CNPJABERTO_API_KEY": "sua_chave_aqui" }
}
}
}
Reinicie o Claude Desktop. Agora dá para perguntar coisas como:
- "Consulta o CNPJ 18.236.120/0001-58 e me diz quando foi fundado."
- "Quantas empresas brasileiras abriram em 2024 vs 2023? Quais estados mais cresceram?"
- "Acha empresas onde 'Maria Silva' aparece como sócia, agrupando por estado."
- "Que outras empresas estão registradas no mesmo endereço da matriz da Magazine Luiza?"
Tools expostas
| Tool | O que retorna |
|---|---|
lookup_cnpj(cnpj) |
Registro completo: razão social, capital, sócios, com estabelecimentos[] (matriz e filiais, endereço, telefones, CNAEs) |
list_filiais(cnpj) |
Filiais de uma matriz, paginado, filtro opcional por UF |
search_companies(query) |
Busca por razão social, fantasia ou dígitos do CNPJ (mínimo 3 chars) |
companies_by_owner(name) |
Empresas onde a pessoa aparece como sócia; cpf ajuda a desambiguar homônimos |
companies_at_same_address(cep, logradouro, numero) |
Outras empresas registradas no mesmo endereço |
companies_by_contact(email | ddd+telefone) |
Empresas que compartilham o mesmo email ou telefone |
cnae_stats(codigo) |
Estatísticas agregadas de um CNAE (contagem, top UFs, top municípios) |
panorama_overview() |
Estatísticas nacionais: top UFs e CNAEs, faixas de capital, idade, histórico de 10 anos |
panorama_year(year) |
Recorte anual: aberturas e fechamentos, série mensal, fatia MEI |
Erros tipados
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:
...
Fonte de dados
Todos os dados vêm do dump público de CNPJ da Receita Federal, atualizado mensalmente. O cnpjaberto.com.br ingere, indexa e serve com lookups sub-segundo, mais joins de valor agregado (grafo de sócios, endereços compartilhados, agregados por CNAE) sobre cerca de 70 milhões de estabelecimentos e 67 milhões de empresas.
Licença
MIT.
Metadata
Release files for cnpjaberto 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Change of provenance
The repository or configuration that created these release files differ from that of a previous release.
We recommend inspecting the repository and configuration before proceeding. View details.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cnpjaberto-0.1.1.tar.gz | 9.4 kB | With provenance | Details for cnpjaberto-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cnpjaberto-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for cnpjaberto-0.1.1-py3-none-any.whl |
Total release size: 17.7 kB
Release files / cnpjaberto-0.1.1.tar.gz
Change of provenance
This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.
We recommend inspecting the repository and configuration before proceeding. View details.
| Download URL | cnpjaberto-0.1.1.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
65fbb3a743fdb92ec24859396cae9d75bcbebf9cedbe3bc16ba9f93fdeba61b0
|
|
BLAKE2b-256 checksum How to use checksums |
93ceea340288d048cd5acf1f2904127c26d9be896c2126e74938b375dafef617
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 29, 2026.
Transparency logRelease files / cnpjaberto-0.1.1-py3-none-any.whl
Change of provenance
This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.
We recommend inspecting the repository and configuration before proceeding. View details.
| Download URL | cnpjaberto-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
99e22909ef004dce5e9d8d4760d25d6257f897f0fa7e1453cef8a0dc5d88e6c0
|
|
BLAKE2b-256 checksum How to use checksums |
0db6b5d34540c31985329956ac245622a313e091a7871d3c9d0de6632921e2e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 29, 2026.
Transparency logSecurity for cnpjaberto 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Change of provenance
The repository and configuration that created this release differ from a previous release.
While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.
Repository
- Removed 0.1.0 github.com/iagoassis-dev/cnpjaberto-py
- Added 0.1.1 github.com/cnpjaberto/cnpjaberto-py
Attestation for cnpjaberto-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.