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 整合