npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cnpjaberto

v0.1.0

Published

SDK em TypeScript e servidor MCP para o cnpjaberto.com.br, cadastro aberto de empresas brasileiras (CNPJ).

Readme

cnpjaberto

SDK em TypeScript 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.

npm install cnpjaberto

Servidor MCP (Claude Desktop, Cursor, Cline)

Adicione no config do seu cliente MCP. O npx -y cnpjaberto baixa o pacote sob demanda, sem precisar instalar globalmente.

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

{
  "mcpServers": {
    "cnpjaberto": {
      "command": "npx",
      "args": ["-y", "cnpjaberto"],
      "env": { "CNPJABERTO_API_KEY": "sua_chave_aqui" }
    }
  }
}

Reinicie o Claude Desktop e pergunte:

  • "Consulta o CNPJ 18.236.120/0001-58 e me diz quando foi fundado."
  • "Quantas empresas brasileiras abriram em 2024 vs 2023?"
  • "Acha empresas onde 'Maria Silva' aparece como sócia."

A chave de API é obrigatória e gratuita. Crie em cnpjaberto.com.br/planos.

SDK

import { Client } from "cnpjaberto";

const cnpj = new Client();                           // lê CNPJABERTO_API_KEY do ambiente

const empresa = await cnpj.lookup("18.236.120/0001-58");
console.log(empresa.razao_social);

const snap = await cnpj.panoramaYear(2024);
console.log(`${snap.abertas} abertas em 2024`);

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 | | 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 | | panorama_overview() | Estatísticas nacionais | | panorama_year(year) | Recorte anual |

Erros tipados

import { Client, NotFoundError, RateLimitError, AuthError } from "cnpjaberto";

const cnpj = new Client();
try {
  await cnpj.lookup("00000000000000");
} catch (e) {
  if (e instanceof NotFoundError) { /* ... */ }
  if (e instanceof RateLimitError) console.log("cota:", e.payload);
  if (e instanceof AuthError) { /* ... */ }
}

Fonte de dados

Todos os dados vêm do dump público de CNPJ da Receita Federal, atualizado mensalmente.

Licença

MIT.