Brdata Mcp

by thomenz

346 downloads
Not rated
GitHub Website

About

An MCP (Model Context Protocol) server for Brazilian company & public-procurement data

Details

Author
thomenz
Downloads
346
Categories
AI

- Consolidated company registry lookup (lookup_company)
- Extended company profile with partners and sanctions (lookup_company_full)
- Regulatory risk and compliance screening with a 0–100 score (screen_company_risk)
- NF-e/NFC-e 44-digit access-key decoder (decode_nfe_key)
- Boleto digitable-line decoder (decode_boleto)
- Batch document validation (CPF/CNPJ/PIS/plate/Pix) (validate_documents)
- Enriched postal-code lookup (lookup_cep)
- Search and segment active companies by CNAE/location/size (search_companies)
- Public tender search and resolution (search_tenders, resolve_tender, get_tender)
- Free CNPJ check-digit validation (validate_cnpj)

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Brdata Mcp
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Add the server to your mcpServers configuration with command: "npx" and args: ["-y", "brdata-mcp"], then set the required environment variable EVM_PRIVATE_KEY (for paid tools) and optionally BRDATA_BASE_URL and X402_NETWORK. For local development, point BRDATA_BASE_URL at a local Worker and use X402_NETWORK=base-sepolia with a testnet wallet.

lookup_company

Consolidated official registry profile of a Brazilian company by CNPJ: legal name, status, activities (CNAE), address, incorporation date. Paid ($0.005).

lookup_company_full

Full profile: everything in lookup_company plus partners/shareholders (QSA, no CPF) and the same 5-registry regulatory screen as screen_company_risk — debarment (CEIS), anti-corruption (CNEP), leniency, impeded non-profits (CEPIM) and the forced-labor register — with a verdict and 0-100 risk score. `sources_checked` names the registries that answered. Paid ($0.03).

screen_company_risk

Screen a Brazilian company by CNPJ against 5 federal registries: debarment (CEIS), anti-corruption (CNEP), impeded non-profits (CEPIM), leniency agreements and the forced-labor register ('Lista Suja' — MTE Cadastro de Empregadores). Returns a single verdict (clear/flagged) + 0–100 risk score, each hit flagged active vs historical, plus per-source data_as_of freshness. The Brazilian complement that global OFAC/EU/UK/UN + PEP screens miss — pair it with an international provider for complete KYB. Company-level public data; no CPF (LGPD). Paid ($0.015).

decode_nfe_key

Decode a 44-digit Brazilian electronic invoice (NF-e/NFC-e) access key: issuer CNPJ, state, emission date, invoice number, model. Paid ($0.005).

decode_boleto

Decode a Brazilian boleto linha digitável (47 or 48 digits): bank, amount, due date, validity. Paid ($0.005).

validate_documents

Validate up to 100 Brazilian identifiers: CPF, CNPJ (incl. alphanumeric), PIS, license plates, Pix keys. Paid ($0.001).

lookup_cep

Enriched CEP lookup: full address, IBGE city code, coordinates when available. Paid ($0.002).

search_companies

Search active Brazilian companies by industry (CNAE prefix, main OR secondary activity), location (state/city), size, age (registration date), declared share capital and legal-name substring. Returns official registry data with business contact info (MEI contacts are redacted under LGPD). Cursor paginated. Paid per page ($0.015). At least one filter is required.

decode_tender_id

Offline decode of a Compras.gov.br 17-digit tender id (UASG + modality + number + year), with the modality name in English. Paid ($0.005).

resolve_tender

Resolve any Brazilian public tender reference (Compras.gov.br 17-digit id or URL, PNCP URL, or control number) into canonical PNCP coordinates + a summary (object, modality, estimated value, dates). Paid ($0.02).

get_tender

Full header of a Brazilian public tender by PNCP coordinates: object, modality, status, estimated value, opening/closing dates, buyer, price-registration flag. Paid ($0.01).

get_tender_items

All items of a Brazilian public tender: quantities, maximum accepted prices, units, and SME-exclusive (ME/EPP) flags. Essential for bid/no-bid analysis. Paid ($0.03).

get_tender_documents

Document list (download URIs) of a Brazilian public tender. ZIPs usually contain the full edital PDF and item list. Metadata only — files are not fetched. Paid ($0.01).

search_tenders

Search Brazilian public procurement tenders (PNCP) by keyword. Returns normalized references (CNPJ/year/sequential, control number, PNCP URL) ready for detail lookups. Paid ($0.05).

validate_cnpj

Free local check-digit/format validation of a single CNPJ (numeric or alphanumeric). No payment required.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "brdata mcp": {
            "brdata": {
                "command": "npx",
                "args": [
                    "-y",
                    "brdata-mcp"
                ],
                "env": {
                    "EVM_PRIVATE_KEY": "0x<dedicated-wallet-key-with-USDC>"
                }
            }
        }
    }
}

McpServers

{
    "brdata": {
        "command": "npx",
        "args": [
            "-y",
            "brdata-mcp"
        ],
        "env": {
            "EVM_PRIVATE_KEY": "0x<dedicated-wallet-key-with-USDC>"
        }
    }
}

brdata-mcp

An MCP (Model Context Protocol) server for Brazilian company & public-procurement
data
, for agent harnesses (Claude Code, Claude Desktop, …). It covers: CNPJ company
registry lookup (basic + full due-diligence), company search/discovery across ~28M
active companies by filters (CNAE activity, state/city, size, MEI, name), public tenders
/ licitações via PNCP
(decode Compras.gov.br IDs, resolve, header, line items, edital
documents, keyword search), NF-e & boleto decoding, CEP lookup, and batch document
validation — for KYB, due diligence, and B2G (public-sector) sales intelligence.

Paid tools automatically settle the underlying x402-protected HTTP endpoints in USDC
on Base or Solana
using a wallet you configure; a call is charged only on success. Configure a
Base wallet (EVM_PRIVATE_KEY), a Solana wallet (SOLANA_PRIVATE_KEY), or both — the x402 layer
settles on whichever rail the server's 402 challenge advertises.

Tools

| Tool | Endpoint | Price | Description |
|------|----------|-------|-------------|
| lookup_company | GET /company/{cnpj} | $0.01 | Consolidated registry profile |
| lookup_company_full | GET /company/{cnpj}/full | $0.10 | + partners (QSA) + sanctions |
| screen_company_risk | GET /risk/company/{cnpj} | $0.03 | 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 |
| decode_nfe_key | GET /nfe/{key} | $0.005 | NF-e/NFC-e 44-digit access-key decoder |
| decode_boleto | POST /boleto/decode | $0.005 | Boleto digitable-line decoder |
| validate_documents | POST /validate/batch | $0.002 | Batch validate CPF/CNPJ/PIS/plate/Pix (≤100) |
| lookup_cep | GET /cep/{cep} | $0.005 | Enriched postal-code lookup |
| search_companies | POST /companies/search | $0.05/page | Search & segment active companies by CNAE/location/size/age/name |
| decode_tender_id | GET /tender/decode/{id} | $0.005 | Offline decode of a Compras.gov.br 17-digit tender id |
| resolve_tender | POST /tender/resolve | $0.02 | Resolve any tender reference (id/URL/control number) to PNCP + summary |
| get_tender | GET /tender/{cnpj}/{year}/{seq} | $0.01 | Full tender header (PNCP) |
| get_tender_items | GET /tender/{cnpj}/{year}/{seq}/items | $0.03 | All tender items + ME/EPP-exclusive flags |
| get_tender_documents | GET /tender/{cnpj}/{year}/{seq}/documents | $0.01 | Tender document URIs (no PDF download) |
| search_tenders | POST /tender/search | $0.05 | Search public tenders (PNCP) by keyword |
| validate_cnpj | GET /validate/{cnpj} | free | Single CNPJ check-digit validation |

search_companies requires the Worker to have the Phase 2 database configured (Hyperdrive);
otherwise it returns a 503 (and no payment is charged). MEI contact data is redacted (LGPD).

Configuration

Environment variables:

| Var | Required | Default | Meaning |
|-----|----------|---------|---------|
| BRDATA_BASE_URL | no | https://brdata.thomenz.me | Base URL of a brdata Worker (defaults to the hosted production API) |
| EVM_PRIVATE_KEY | for paid tools (Base) | — | 0x-prefixed key of the paying Base wallet (holds USDC) |
| 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 |
| SOLANA_RPC_URL | no | public RPC | Optional Solana RPC override used to build the payment (e.g. a Helius URL) |
| X402_NETWORK | no | base | base (mainnet, matches the default URL) or base-sepolia (testnet → Solana devnet) |

⚠️ Security

EVM_PRIVATE_KEY controls real funds. Anything that can read this process'
environment (or the MCP config file) can spend from that wallet.

- Use a dedicated wallet with a small balance, funded only with what you're
willing to auto-spend. Never a personal or treasury key.
- On testnet (base-sepolia) use test USDC only.
- The key is read from the environment; it is never sent anywhere except to sign
x402 payment authorizations for BRDATA_BASE_URL.

Use with Claude Code / Claude Desktop

Add to your mcpServers configuration:

{
  "mcpServers": {
    "brdata": {
      "command": "npx",
      "args": ["-y", "brdata-mcp"],
      "env": {
        "EVM_PRIVATE_KEY": "0x<dedicated-wallet-key-with-USDC>"
      }
    }
  }
}

For local development against wrangler dev, point BRDATA_BASE_URL at
http://localhost:8787 and use X402_NETWORK=base-sepolia with a testnet wallet.

If you run from source instead of npm, use:

{
  "mcpServers": {
    "brdata": {
      "command": "node",
      "args": ["/absolute/path/to/packages/brdata-mcp/dist/index.js"],
      "env": { "BRDATA_BASE_URL": "http://localhost:8787", "EVM_PRIVATE_KEY": "0x...", "X402_NETWORK": "base-sepolia" }
    }
  }
}

Example

> "Use brdata to run full due diligence on CNPJ 00.000.000/0001-91."

The agent calls lookup_company_full, which pays $0.10 in USDC and returns the
consolidated English profile with partners and sanction checks.

Build & publish

```bash
pnpm install
pnpm run build # emits dist/
pnpm run typecheck

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.