BrasilAPI (CNPJ, CEP, validation, holidays)

io.github.renatoctti由 GitHub 账号 renatoctti 发布v0.1.0更新于 Nov 11, 2026

Brazilian public data via BrasilAPI: CNPJ and partners, CEP, CNPJ/CPF validation, holidays

发布方自己的服务:cnpj.ai

已验证STDIO仅桌面位置与生活商业与电商

概览

AI 生成的概览

通过 BrasilAPI 为助手提供巴西公开数据:CNPJ 企业查询(含股东)、CEP 地址查询、离线 CNPJ/CPF 校验和全国节假日。

可以做什么
  • 按 CNPJ 查询企业:法定名称、登记状态、主营业务、地址、规模、税务制度及股东(QSA)
  • 在本地校验 CNPJ 与 CPF 的格式和校验位,无需联网
  • 按 CEP 查询地址:街道、街区、城市、州、IBGE 代码和坐标
  • 列出某年的全国节假日及其星期
适用场景
适合巴西企业尽职调查与 KYC 核查,确认供应商或客户是否存在且处于营业状态,用 CEP 补全或核对地址数据,或在采信 CNPJ/CPF 号码前先做校验。
运行要求
通过 npx 以 stdio 在本地运行,需要 Node 20 或更高版本;无需账号、API 密钥或环境变量。CNPJ、CEP 和节假日查询需要访问 BrasilAPI 的网络;校验类工具可离线使用。
安装前请注意
查询会把所查的 CNPJ 或 CEP 发送给第三方服务 BrasilAPI,该服务是免费社区聚合服务,有速率限制,数据可能落后于巴西联邦税务局;结果应作为初步核查而非证明。股东 CPF 以掩码形式返回,服务器不在调用之间保存任何状态。

安装

在 SourceWeft 中

  1. 打开 控制台中的 BrasilAPI (CNPJ, CEP, validation, holidays),将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

brasilapi-mcp

An MCP server that gives AI assistants Brazilian public data through BrasilAPI: company registry lookups by CNPJ (including partners), addresses by CEP, offline CNPJ/CPF validation and national holidays.

It was built from experience with company due-diligence (KYC) workflows, where an agent has to check that a company exists, is active and who its partners are, and must not trust a number that fails its check digits. It is an independent project and is not affiliated with BrasilAPI or the Receita Federal.

Tools

ToolWhat it doesNetwork
lookup_cnpjLegal name, registration status, main activity, address, size, tax regime and partners (QSA) of a company. Accepts CNPJ with or without punctuation, numeric or alphanumeric.BrasilAPI
validate_cnpjChecks format and check digits, numeric and alphanumeric CNPJ.none
validate_cpfChecks format and check digits of a CPF. Nothing is stored or sent.none
lookup_cepStreet, neighborhood, city, state, IBGE code and coordinates for a CEP.BrasilAPI
list_holidaysNational holidays of a year, with weekdays.BrasilAPI

lookup_cnpj rejects a number with wrong check digits before making any request, so a typo costs nothing and never reaches the API. Partner CPFs come masked by the registry (***123456**); the server does not unmask or store anything.

Example, lookup_cnpj with include_partners: false:

json
{  "cnpj": "00000000000191",  "razaoSocial": "BANCO DO BRASIL SA",  "situacaoCadastral": { "descricao": "ATIVA", "desde": "2005-11-03", "motivo": "SEM MOTIVO" },  "tipo": "MATRIZ",  "naturezaJuridica": "Sociedade de Economia Mista",  "cnaePrincipal": { "codigo": 6422100, "descricao": "Bancos múltiplos, com carteira comercial" },  "endereco": { "municipio": "BRASILIA", "uf": "DF", "cep": "70040912", "...": "..." },  "totalSocios": 41}

Install

Requires Node 20 or newer.

Claude Code:

bash
claude mcp add brasilapi -- npx -y @renatoctti/brasilapi-mcp

Claude Desktop, Cursor and other clients that read an mcpServers block:

json
{  "mcpServers": {    "brasilapi": {      "command": "npx",      "args": ["-y", "@renatoctti/brasilapi-mcp"]    }  }}

From source:

bash
git clone https://github.com/renatoctti/brasilapi-mcpcd brasilapi-mcpnpm installnpm run buildnode dist/src/index.js   # speaks MCP over stdio

Notes

  • Data source. BrasilAPI is a free community service that aggregates public data. It has rate limits, and the server reports a 429 in plain words instead of retrying. Each request has a 10 second timeout.
  • Identification. BrasilAPI sits behind a firewall that refuses requests from anonymous default HTTP agents, so every request carries User-Agent: brasilapi-mcp/<version> (+repo url).
  • Alphanumeric CNPJ. Since 2026 the Receita Federal issues CNPJs with letters. The validator follows the published check-digit rule (the value of a character is its ASCII code minus 48). Whether a lookup finds the company depends on BrasilAPI having it.
  • Freshness. Registry data can be days behind the Receita Federal. Treat it as a first check, not as a certificate.
  • No state. The server keeps nothing between calls and writes no logs of the numbers you ask about; the only output on stderr is a start-up line.

Development

bash
npm test        # builds, then runs the unit and protocol tests (no network)npm run smoke   # starts the built server over stdio and calls every tool on the real API

The tests cover the check-digit rules (numeric and alphanumeric CNPJ, CPF), the reshaping of each answer, the error paths (not found, rate limit, unreachable) and the server itself through an in-memory MCP client, with a fake fetch standing in for BrasilAPI.

License

MIT

来源:README.md,提交 bd7b861

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Nov 11, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Cnpj 集成