Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ Browse the full catalog at [codespar.dev/servers](https://codespar.dev/servers).
| **[Quickbooks](packages/erp/quickbooks)** | 22 | `@codespar/mcp-quickbooks` | API Key |
| **[Tiny](packages/erp/tiny)** | 21 | `@codespar/mcp-tiny` | API Key |

### 🪪 Identity & KYC (8 servers)
### 🪪 Identity & KYC (9 servers)

| Server | Tools | npm | Auth |
|---|---|---|---|
Expand All @@ -337,6 +337,7 @@ Browse the full catalog at [codespar.dev/servers](https://codespar.dev/servers).
| **[Certta](packages/identity/certta)** | 11 | `@codespar/mcp-certta` | API Key |
| **[BigDataCorp](packages/identity/bigdatacorp)** | 10 | `@codespar/mcp-bigdatacorp` | API Key |
| **[Caf](packages/identity/caf)** | 9 | `@codespar/mcp-caf` | API Key |
| **[CPF/CNPJ](packages/identity/cpfcnpj)** | 2 | `@codespar/mcp-cpfcnpj` | Token |

### 🛡️ Fraud & Risk (4 servers)

Expand Down
36 changes: 36 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 90 additions & 0 deletions packages/identity/cpfcnpj/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# @codespar/mcp-cpfcnpj

MCP server for [cpfcnpj.com.br](https://www.cpfcnpj.com.br), official Brazilian CPF and CNPJ lookups for identity, KYC and KYB agent workflows.

Give an agent a CNPJ and it returns razao social, fantasia, address, IBGE codes and, on the richer package, registration status, company size and Simples Nacional status. Give it a CPF and it returns the registered name and, on the richer package, the address.

## Why this source

- **Official data, in real time (D+0).** Results come straight from the government registries, not from a monthly snapshot.
- **No leaked or scraped databases.** The service does not resell breached dumps or crawled data. Every response traces back to the authoritative registry.
- **Certified security and compliance posture.** The provider runs a certified program covering information security, privacy and compliance (ISO/IEC 27001, ISO/IEC 27701 and ISO 37301), which matters when the lookup feeds a regulated onboarding or lending decision.

## Quick Start

### Claude Desktop

```json
{
"mcpServers": {
"cpfcnpj": {
"command": "npx",
"args": ["-y", "@codespar/mcp-cpfcnpj"],
"env": {
"CPFCNPJ_TOKEN": "your-token"
}
}
}
}
```

### Cursor / VS Code

```bash
CPFCNPJ_TOKEN=your-token npx -y @codespar/mcp-cpfcnpj
```

## Tools (2)

| Tool | Source endpoint | Notes |
|---|---|---|
| `companies_lookup` | `GET /{token}/{pacote}/{cnpj}` | CNPJ lookup. Package `6` (default) returns razao, fantasia, address, IBGE codes, situacao, porte and Simples Nacional; package `5` returns the base registry fields. |
| `persons_lookup` | `GET /{token}/{pacote}/{cpf}` | CPF lookup. Package `3` (default) returns name and address; package `1` returns the name only. |

Both tools accept the document with or without punctuation. The provider reports success or failure in a `status` field (1 success, 0 error); this server maps it to an explicit `ok` boolean so the agent can branch without parsing prose.

Example result:

```json
{
"ok": true,
"status": 200,
"provider_status": 1,
"documento": "27272134000118",
"pacote": "6",
"data": {
"status": 1,
"razao": "ALAS TECNOLOGIA LTDA",
"situacao": "ATIVA",
"porte": "ME"
}
}
```

## Authentication

cpfcnpj.com.br authenticates by an account **token** carried in the request path:

```
GET https://api.cpfcnpj.com.br/{token}/{pacote}/{documento}
```

Issue the token from your account dashboard:

- Dashboard: <https://www.cpfcnpj.com.br>
- API packages: <https://www.cpfcnpj.com.br/dev/>

## Environment Variables

| Variable | Required | Description |
|---|---|---|
| `CPFCNPJ_TOKEN` | yes | Account token used in the request path. |
| `CPFCNPJ_API_BASE` | no | API base URL. Defaults to `https://api.cpfcnpj.com.br`. Override for testing. |

## Enterprise

Need governance, budget limits, and audit trails for agent identity calls? [CodeSpar Enterprise](https://codespar.dev/enterprise) adds policy engine, payment routing, and compliance templates on top of these MCP servers.

## License

MIT
37 changes: 37 additions & 0 deletions packages/identity/cpfcnpj/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "@codespar/mcp-cpfcnpj",
"version": "0.1.0",
"description": "MCP server for cpfcnpj.com.br, official Brazilian CPF and CNPJ lookups in real time (D+0), no leaked or scraped databases",
"type": "module",
"main": "./dist/index.js",
"bin": {
"mcp-cpfcnpj": "./dist/index.js"
},
"files": [
"dist"
],
"scripts": {
"build": "tsc",
"start": "node dist/index.js"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.0.0",
"zod": "^3.23.0"
},
"devDependencies": {
"@types/node": "^22.0.0",
"typescript": "^5.8.0"
},
"license": "MIT",
"keywords": [
"mcp",
"cpfcnpj",
"cpf",
"cnpj",
"identity",
"kyc",
"kyb",
"brazil"
],
"mcpName": "io.github.codespar/mcp-cpfcnpj"
}
43 changes: 43 additions & 0 deletions packages/identity/cpfcnpj/server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
"name": "io.github.codespar/mcp-cpfcnpj",
"description": "MCP server for cpfcnpj.com.br, official Brazilian CPF and CNPJ lookups in real time (D+0), no leaked or scraped databases",
"repository": {
"url": "https://github.com/codespar/mcp-dev-latam",
"source": "github",
"subfolder": "packages/identity/cpfcnpj"
},
"version": "0.1.0",
"packages": [
{
"registryType": "npm",
"identifier": "@codespar/mcp-cpfcnpj",
"version": "0.1.0",
"transport": {
"type": "stdio"
},
"environmentVariables": [
{
"name": "CPFCNPJ_TOKEN",
"description": "Account token issued at cpfcnpj.com.br, used in the request path",
"isRequired": true,
"format": "string",
"isSecret": true
},
{
"name": "CPFCNPJ_API_BASE",
"description": "API base URL, defaults to https://api.cpfcnpj.com.br. Override for testing.",
"isRequired": false,
"format": "string",
"isSecret": false
}
]
}
],
"provider": {
"homepage": "https://www.cpfcnpj.com.br",
"logoUrl": "https://logo.clearbit.com/cpfcnpj.com.br",
"logoFallback": "https://www.google.com/s2/favicons?domain=cpfcnpj.com.br&sz=128",
"docsUrl": "https://www.cpfcnpj.com.br/dev/"
}
}
Loading