{
  "markdown": "# brdata-mcp\n\nAn **MCP (Model Context Protocol) server** for **Brazilian company & public-procurement\ndata**, for agent harnesses (Claude Code, Claude Desktop, …). It covers: CNPJ company\nregistry lookup (basic + full due-diligence), **company search/discovery** across ~28M\nactive companies by filters (CNAE activity, state/city, size, MEI, name), **public tenders\n/ licitações via PNCP** (decode Compras.gov.br IDs, resolve, header, line items, edital\ndocuments, keyword search), NF-e & boleto decoding, CEP lookup, and batch document\nvalidation — for KYB, due diligence, and B2G (public-sector) sales intelligence.\n\nPaid tools **automatically settle** the underlying x402-protected HTTP endpoints in **USDC\non Base or Solana** using a wallet you configure; a call is charged only on success. Configure a\nBase wallet (`EVM_PRIVATE_KEY`), a Solana wallet (`SOLANA_PRIVATE_KEY`), or both — the x402 layer\nsettles on whichever rail the server's 402 challenge advertises.\n\n## Tools\n\n| Tool | Endpoint | Price | Description |\n|------|----------|-------|-------------|\n| `lookup_company` | `GET /company/{cnpj}` | $0.005 | Consolidated registry profile |\n| `lookup_company_full` | `GET /company/{cnpj}/full` | $0.03 | + partners (QSA) + sanctions |\n| `screen_company_risk` | `GET /risk/company/{cnpj}` | $0.015 | Regulatory risk & compliance screen across 5 federal registries: debarment (CEIS), anti-corruption (CNEP), impeded non-profits (CEPIM), leniency & forced-labor register (\"Lista Suja\", MTE) → verdict + 0–100 score + per-source `data_as_of` |\n| `decode_nfe_key` | `GET /nfe/{key}` | $0.005 | NF-e/NFC-e 44-digit access-key decoder |\n| `decode_boleto` | `POST /boleto/decode` | $0.005 | Boleto digitable-line decoder |\n| `validate_documents` | `POST /validate/batch` | $0.001 | Batch validate CPF/CNPJ/PIS/plate/Pix (≤100) |\n| `lookup_cep` | `GET /cep/{cep}` | $0.002 | Enriched postal-code lookup |\n| `search_companies` | `POST /companies/search` | $0.015/page | Search & segment active companies by CNAE/location/size/age/name |\n| `decode_tender_id` | `GET /tender/decode/{id}` | $0.005 | Offline decode of a Compras.gov.br 17-digit tender id |\n| `resolve_tender` | `POST /tender/resolve` | $0.02 | Resolve any tender reference (id/URL/control number) to PNCP + summary |\n| `get_tender` | `GET /tender/{cnpj}/{year}/{seq}` | $0.01 | Full tender header (PNCP) |\n| `get_tender_items` | `GET /tender/{cnpj}/{year}/{seq}/items` | $0.03 | All tender items + ME/EPP-exclusive flags |\n| `get_tender_documents` | `GET /tender/{cnpj}/{year}/{seq}/documents` | $0.01 | Tender document URIs (no PDF download) |\n| `search_tenders` | `POST /tender/search` | $0.05 | Search public tenders (PNCP) by keyword |\n| `validate_cnpj` | `GET /validate/{cnpj}` | **free** | Single CNPJ check-digit validation |\n\n`search_companies` requires the Worker to have the Phase 2 database configured (Hyperdrive);\notherwise it returns a 503 (and no payment is charged). MEI contact data is redacted (LGPD).\n\n## Configuration\n\nEnvironment variables:\n\n| Var | Required | Default | Meaning |\n|-----|----------|---------|---------|\n| `BRDATA_BASE_URL` | no | `https://brdata.thomenz.me` | Base URL of a brdata Worker (defaults to the hosted production API) |\n| `EVM_PRIVATE_KEY` | for paid tools (Base) | — | `0x`-prefixed key of the paying Base wallet (holds USDC) |\n| `SOLANA_PRIVATE_KEY` | for paid tools (Solana) | — | base58 or JSON-array secret key of the paying Solana wallet (holds USDC). Configure this and/or `EVM_PRIVATE_KEY` |\n| `SOLANA_RPC_URL` | no | public RPC | Optional Solana RPC override used to build the payment (e.g. a Helius URL) |\n| `X402_NETWORK` | no | `base` | `base` (mainnet, matches the default URL) or `base-sepolia` (testnet → Solana devnet) |\n\n## ⚠️ Security\n\n`EVM_PRIVATE_KEY` controls **real funds**. Anything that can read this process'\nenvironment (or the MCP config file) can spend from that wallet.\n\n- Use a **dedicated wallet with a small balance**, funded only with what you're\n  willing to auto-spend. Never a personal or treasury key.\n- On testnet (`base-sepolia`) use test USDC only.\n- The key is read from the environment; it is never sent anywhere except to sign\n  x402 payment authorizations for `BRDATA_BASE_URL`.\n\n## Use with Claude Code / Claude Desktop\n\nAdd to your `mcpServers` configuration:\n\n```json\n{\n  \"mcpServers\": {\n    \"brdata\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"brdata-mcp\"],\n      \"env\": {\n        \"EVM_PRIVATE_KEY\": \"0x<dedicated-wallet-key-with-USDC>\"\n      }\n    }\n  }\n}\n```\n\nFor local development against `wrangler dev`, point `BRDATA_BASE_URL` at\n`http://localhost:8787` and use `X402_NETWORK=base-sepolia` with a testnet wallet.\n\nIf you run from source instead of npm, use:\n\n```json\n{\n  \"mcpServers\": {\n    \"brdata\": {\n      \"command\": \"node\",\n      \"args\": [\"/absolute/path/to/packages/brdata-mcp/dist/index.js\"],\n      \"env\": { \"BRDATA_BASE_URL\": \"http://localhost:8787\", \"EVM_PRIVATE_KEY\": \"0x...\", \"X402_NETWORK\": \"base-sepolia\" }\n    }\n  }\n}\n```\n\n## Example\n\n> \"Use brdata to run full due diligence on CNPJ 00.000.000/0001-91.\"\n\nThe agent calls `lookup_company_full`, which pays $0.03 in USDC and returns the\nconsolidated English profile with partners and sanction checks.\n\n## Build & publish\n\n```bash\npnpm install\npnpm run build        # emits dist/\npnpm run typecheck\n# publish (see checklist in the main repo README before doing this):\nnpm publish --access public\n```\n\n## License\n\nMIT\n",
  "bytes": 5446,
  "sha": "99fbbf024c85ba3610440fbb8c4408dac5f68cd4367ac12be4e3a7ce6a2cab7d",
  "repo_slug": "thomenz/brdata-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_thomenz_brdata_mcp_5e647c03/readme"
}