MCP stdio client for the Brasil MCP Match REST API. Privacy-preserving CNPJ verification (KYC, anti-fraud, LGPD) from your Claude Desktop / Claude Code.
Project description
brasil-mcp-match
MCP stdio client for the Brasil MCP Match privacy-preserving CNPJ verification API.
Match, don't reveal. Verify Brazilian CNPJs (KYC, anti-fraud, onboarding, LGPD) from your Claude Desktop / Claude Code without exposing PII and without running Postgres yourself.
Repo layout — this is a split repo
Two pieces, two licenses, one repo:
| Path | License | Purpose |
|---|---|---|
src/brasil_mcp_match/ |
MIT | Published to PyPI as brasil-mcp-match. MCP stdio client + httpx wrapper for the REST API. What end users install. |
server/ |
AGPL-3.0-or-later | Operator-side code. FastAPI REST API + Receita Federal ingest + Postgres. NOT published to PyPI — self-hosters clone this repo and run from server/. See server/README.md. |
This split happened in v0.3.0. Up to and including v0.2.1, the PyPI package shipped the server. From v0.3.0 onward, the PyPI package ships only the thin HTTP client. See CHANGELOG.md for the migration story.
Quickstart (client)
1. Install (or just uvx it)
uv tool install brasil-mcp-match
# or run on demand:
uvx brasil-mcp-match
2. Configure your MCP client
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"brasil-mcp-match": {
"command": "uvx",
"args": ["brasil-mcp-match"],
"env": {
"BRASIL_MCP_MATCH_URL": "https://server.solidapps.tech/brasil-mcp/match",
"BRASIL_MCP_MATCH_KEY": "your-api-key-here"
}
}
}
}
Claude Code (.claude/settings.local.json or via claude mcp add):
claude mcp add brasil-mcp-match \
--env BRASIL_MCP_MATCH_URL=https://server.solidapps.tech/brasil-mcp/match \
--env BRASIL_MCP_MATCH_KEY=your-api-key-here \
-- uvx brasil-mcp-match
Environment variables
| Var | Required | Default | Description |
|---|---|---|---|
BRASIL_MCP_MATCH_URL |
yes | — | Base URL of the Match REST API (no trailing path) |
BRASIL_MCP_MATCH_KEY |
yes | — | API key issued by your Match server operator |
BRASIL_MCP_MATCH_TIMEOUT |
no | 10 |
HTTP timeout in seconds |
Tools exposed
All 4 tools mirror the upstream Match API verbatim:
match_razao_social_tool(cnpj, nome, tolerance=0.85)— fuzzy match against RF-registered razão social (exact / fuzzy_prefix / fuzzy_word / fuzzy_phonetic).check_situacao_cadastral_tool(cnpj)— returnsativa/suspensa/inapta/baixada/nula+ since-date.check_porte_empresa_tool(cnpj)— returnsMEI/ME/EPP/DEMAISplus Simples and MEI flags.match_uf_tool(cnpj, uf)— verifies that the UF you have matches the one registered for the CNPJ (boolean, never reveals the registered UF).
The base excludes MEI and CNPJs not in
ativastatus — those returnCNPJ_NOT_FOUND.
Error envelope
Network/HTTP failures become a JSON envelope so tool callers always see the same shape:
{ "error": { "code": "UPSTREAM_TIMEOUT", "message_pt": "...", "message_en": "..." } }
Codes added by this client:
UPSTREAM_TIMEOUT— Match server didn't respond withinBRASIL_MCP_MATCH_TIMEOUT.UPSTREAM_NETWORK— connection refused, DNS failure, TLS handshake error.UPSTREAM_BAD_RESPONSE— Match server returned non-JSON or unexpected shape.
All other codes (CNPJ_NOT_FOUND, INVALID_CNPJ, UNAUTHORIZED, etc.) come
straight from the upstream Match API.
Privacy
This client adds zero new PII exposure beyond what the Match API already processes. By design:
- The only data that leaves your machine is the CNPJ + (optionally) the name or UF you pass to the tool. No raw razão social, no endereço, no CPF de sócio ever crosses the wire from the server back to you — that's the whole point of Match.
- Your
BRASIL_MCP_MATCH_KEYis sent only as theX-Brasil-MCP-KeyHTTP header againstBRASIL_MCP_MATCH_URL. Never logged. - All HTTPS, no plaintext fallback.
Self-hosting the server
If you want to run your own Match deployment instead of consuming a hosted one, see server/README.md. The server is AGPL-3.0-or-later; running a public-facing instance triggers the source-availability obligation.
License
This published package (src/brasil_mcp_match/) is MIT. See LICENSE.
The server side (server/) is AGPL-3.0-or-later — see
server/LICENSE.
The MIT license on the client is intentional: it lets you embed the stdio client in proprietary stacks while the AGPL server protects the operator-side work from being relicensed downstream.
Related
- brasil-mcp/essentials — Fase 1, MIT.
- brasil-mcp/leads — Fase 3, B2B lead gen.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file brasil_mcp_match-0.3.0.tar.gz.
File metadata
- Download URL: brasil_mcp_match-0.3.0.tar.gz
- Upload date:
- Size: 265.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b756ed0ff9c8042095ce153547177a020126afb5b022b761f2174ae5458841d
|
|
| MD5 |
0ed60db53a74249894f90b6500b48156
|
|
| BLAKE2b-256 |
2accfa34777b8e3e0e66c64746ab04afc30712131c12a26611eee72172505e88
|
Provenance
The following attestation bundles were made for brasil_mcp_match-0.3.0.tar.gz:
Publisher:
release.yml on brasil-mcp/match
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brasil_mcp_match-0.3.0.tar.gz -
Subject digest:
0b756ed0ff9c8042095ce153547177a020126afb5b022b761f2174ae5458841d - Sigstore transparency entry: 1626419810
- Sigstore integration time:
-
Permalink:
brasil-mcp/match@d5119f035eb9a413d0e81477d1f209a8518b139f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/brasil-mcp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d5119f035eb9a413d0e81477d1f209a8518b139f -
Trigger Event:
push
-
Statement type:
File details
Details for the file brasil_mcp_match-0.3.0-py3-none-any.whl.
File metadata
- Download URL: brasil_mcp_match-0.3.0-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0e77f3d51a837fc6a6d172772f93c05b31181b22b4ed5534dd7a6d5cdcecc80
|
|
| MD5 |
daaa5bc092fbf1aac94b9b74ece7efbc
|
|
| BLAKE2b-256 |
34ecbbc2001d2b40a42aaf0d391cc5ee04358f8a2b26deb2ebcef37f5edeb97f
|
Provenance
The following attestation bundles were made for brasil_mcp_match-0.3.0-py3-none-any.whl:
Publisher:
release.yml on brasil-mcp/match
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brasil_mcp_match-0.3.0-py3-none-any.whl -
Subject digest:
f0e77f3d51a837fc6a6d172772f93c05b31181b22b4ed5534dd7a6d5cdcecc80 - Sigstore transparency entry: 1626419842
- Sigstore integration time:
-
Permalink:
brasil-mcp/match@d5119f035eb9a413d0e81477d1f209a8518b139f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/brasil-mcp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d5119f035eb9a413d0e81477d1f209a8518b139f -
Trigger Event:
push
-
Statement type: