
Cpfhub
- Updated May 2, 2026
- cpfhub/cpfhub-mcp
CPFHub is a MCP server that lets agents query Brazilian CPF data through CPFHub.io using a stdio npm package and API key.
About
CPFHub MCP is a stdio Model Context Protocol server that connects AI coding agents to CPFHub.io for Brazilian CPF (Cadastro de Pessoas Físicas) data queries. Developers shipping SaaS, fintech, or marketplaces for Brazil can register this server so Claude Code or Cursor can validate identifiers, enrich user records, or debug integration code against live API responses instead of stubbing JSON by hand. The npm package @cpfhub/mcp targets developers who already use MCP for backend tasks and need a governed, key-based connection rather than pasting PII into chat logs manually. Placement on Build → Integrations reflects its role as an external data provider hook during implementation—not competitive research or Amazon ads optimization. You should treat CPF data as sensitive: store the API key locally, respect CPFHub terms, and avoid logging full numbers in prompts. Complexity is intermediate because you must obtain CPFHub credentials and understand when CPF validation is legally appropriate in your flow. It does not replace a lawyer-approved KYC stack; it accelerates agent-driven coding against a dedicated CPF API.
- Stdio MCP package @cpfhub/mcp on npm at version 1.0.1
- Requires CPFHUB_API_KEY secret environment variable
- Purpose-built for Brazilian CPF lookups from AI agents
- Open-source repository cpfhub/cpfhub-mcp on GitHub
- Fits KYC, onboarding, and fraud-check automations in agent-assisted development
Cpfhub by the numbers
- Data as of Jul 7, 2026 (Skillselion catalog sync)
claude mcp add --env CPFHUB_API_KEY=YOUR_CPFHUB_API_KEY cpfhub -- npx -y @cpfhub/mcpAdd your badge
Show developers this MCP server is listed on Skillselion. Paste this into your README.
| Package | @cpfhub/mcp |
|---|---|
| Transport | STDIO |
| Auth | Required |
| Last updated | May 2, 2026 |
| Repository | cpfhub/cpfhub-mcp ↗ |
What it does
Let your coding agent query and validate Brazilian CPF records via CPFHub.io while you build signup, billing, or compliance features.
Who is it for?
Best when you're implementing Brazilian customer onboarding, billing identity checks, or back-office tools and want MCP-native access to CPFHub.
Skip if: Products outside Brazil, teams without a CPFHub account, or use cases that need bulk scraping without an approved data vendor.
What you get
With CPFHUB_API_KEY configured, your agent can call CPFHub tools during development to verify integration behavior against real API semantics.
- MCP tools wrapping CPFHub CPF query operations
- Faster agent-driven integration tests against Brazilian ID data
- Documented stdio server entry in your MCP config
By the numbers
- Package version 1.0.1
- 1 stdio npm package: @cpfhub/mcp
- 1 required secret: CPFHUB_API_KEY
README.md
cpfhub-mcp: Official MCP Server for CPFHub.io
🇺🇸 English | 🇧🇷 Português
Official Model Context Protocol (MCP) server for CPFHub.io — Brazilian CPF Lookup API for AI agents.
What is CPFHub.io?
CPFHub.io is a REST API that returns identity data — full name, gender, and date of birth — from any Brazilian CPF number, in ~300ms, with 99.9% uptime and full LGPD compliance.
10M+ CPFs queried · 1,300+ active companies · 99.9% uptime
Tools
This MCP server exposes the following tools:
| Tool | Description |
|---|---|
get_person_by_cpf |
Retrieve identity data (full name, gender, date of birth) from a Brazilian CPF number |
get_quota_information |
Retrieve remaining API credits and current plan status |
Tool Definition
{
"name": "get_person_by_cpf",
"description": "Retrieve identity data from a Brazilian CPF number",
"parameters": {
"type": "object",
"properties": {
"cpf": {
"type": "string",
"description": "Brazilian CPF number (digits only or formatted as XXX.XXX.XXX-XX)"
}
},
"required": ["cpf"]
}
}
Quick Start
# Set your API key
export CPFHUB_API_KEY=your_api_key_here
# Run the MCP server directly with npx (no install needed)
npx @cpfhub/mcp
Get your free API key at app.cpfhub.io — no credit card required.
curl Example
curl -X GET "https://api.cpfhub.io/cpf/12345678909" \
-H "x-api-key: YOUR_API_KEY"
Response:
{
"success": true,
"data": {
"cpf": "12345678909",
"name": "Fulano de Tal",
"nameUpper": "FULANO DE TAL",
"gender": "M",
"birthDate": "15/06/1990",
"day": 15,
"month": 6,
"year": 1990
}
}
Configuration
Claude Desktop
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"cpfhub": {
"command": "npx",
"args": ["-y", "@cpfhub/mcp"],
"env": {
"CPFHUB_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
Cursor
- Go to Settings > Features > MCP.
- Click + Add New MCP Server.
- Name:
CPFHub - Type:
command - Command:
export CPFHUB_API_KEY=YOUR_API_KEY_HERE && npx -y @cpfhub/mcp
Windsurf
Add to your MCP configuration file:
{
"mcpServers": {
"cpfhub": {
"command": "npx",
"args": ["-y", "@cpfhub/mcp"],
"env": {
"CPFHUB_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
OpenAI Function Calling Example
import os
import json
import requests
from openai import OpenAI
client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
CPFHUB_API_KEY = os.environ["CPFHUB_API_KEY"]
tools = [
{
"type": "function",
"function": {
"name": "get_person_by_cpf",
"description": "Retrieve identity data from a Brazilian CPF number",
"parameters": {
"type": "object",
"properties": {
"cpf": {"type": "string", "description": "Brazilian CPF number"}
},
"required": ["cpf"],
},
},
}
]
def get_person_by_cpf(cpf: str) -> dict:
response = requests.get(
f"https://api.cpfhub.io/cpf/{cpf.replace('.', '').replace('-', '')}",
headers={"x-api-key": CPFHUB_API_KEY},
)
return response.json()
messages = [{"role": "user", "content": "Who is the person with CPF 123.456.789-09?"}]
response = client.chat.completions.create(model="gpt-4o", messages=messages, tools=tools)
message = response.choices[0].message
if message.tool_calls:
args = json.loads(message.tool_calls[0].function.arguments)
result = get_person_by_cpf(args["cpf"])
print(result)
LangChain Example
See examples/langchain_example.py for a full LangChain agent integration example.
Requirements
- Node.js 18 or higher
- A valid API key from app.cpfhub.io
Links
| Resource | URL |
|---|---|
| Documentation | https://cpfhub.io/documentacao |
| Dashboard | https://app.cpfhub.io |
| OpenAPI Specification | https://github.com/cpfhub/cpfhub-openapi |
| Node.js SDK | https://github.com/cpfhub/cpfhub-node |
| Python SDK | https://github.com/cpfhub/cpfhub-python |
| All SDKs | https://github.com/cpfhub |
License
MIT © CPFHub.io
Português
🇺🇸 English | 🇧🇷 Português
Servidor Model Context Protocol (MCP) oficial para CPFHub.io — API de Consulta de CPF Brasileiro para agentes de IA.
O que é o CPFHub.io?
O CPFHub.io é uma API REST que retorna dados de identidade — nome completo, gênero e data de nascimento — de qualquer CPF brasileiro, em ~300ms, com 99,9% de uptime e total conformidade com a LGPD.
10M+ CPFs consultados · 1.300+ empresas ativas · 99,9% uptime
Ferramentas (Tools)
Este servidor MCP expõe as seguintes ferramentas:
| Ferramenta | Descrição |
|---|---|
get_person_by_cpf |
Recupera dados de identidade (nome completo, gênero, data de nascimento) a partir de um CPF brasileiro |
get_quota_information |
Recupera os créditos de API restantes e o status do plano atual |
Definição da Ferramenta
{
"name": "get_person_by_cpf",
"description": "Retrieve identity data from a Brazilian CPF number",
"parameters": {
"type": "object",
"properties": {
"cpf": {
"type": "string",
"description": "Brazilian CPF number (digits only or formatted as XXX.XXX.XXX-XX)"
}
},
"required": ["cpf"]
}
}
Início Rápido
# Configure sua chave de API
export CPFHUB_API_KEY=sua_chave_de_api_aqui
# Execute o servidor MCP diretamente com npx (sem instalação)
npx @cpfhub/mcp
Obtenha sua chave de API gratuita em app.cpfhub.io — sem cartão de crédito.
Exemplo curl
curl -X GET "https://api.cpfhub.io/cpf/12345678909" \
-H "x-api-key: SUA_CHAVE_DE_API"
Resposta:
{
"success": true,
"data": {
"cpf": "12345678909",
"name": "Fulano de Tal",
"nameUpper": "FULANO DE TAL",
"gender": "M",
"birthDate": "15/06/1990",
"day": 15,
"month": 6,
"year": 1990
}
}
Configuração
Claude Desktop
Adicione o seguinte ao seu claude_desktop_config.json:
{
"mcpServers": {
"cpfhub": {
"command": "npx",
"args": ["-y", "@cpfhub/mcp"],
"env": {
"CPFHUB_API_KEY": "SUA_CHAVE_DE_API_AQUI"
}
}
}
}
Cursor
- Acesse Settings > Features > MCP.
- Clique em + Add New MCP Server.
- Nome:
CPFHub - Tipo:
command - Comando:
export CPFHUB_API_KEY=SUA_CHAVE_DE_API_AQUI && npx -y @cpfhub/mcp
Windsurf
Adicione ao seu arquivo de configuração MCP:
{
"mcpServers": {
"cpfhub": {
"command": "npx",
"args": ["-y", "@cpfhub/mcp"],
"env": {
"CPFHUB_API_KEY": "SUA_CHAVE_DE_API_AQUI"
}
}
}
}
Exemplo com OpenAI Function Calling
import os
import json
import requests
from openai import OpenAI
client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
CPFHUB_API_KEY = os.environ["CPFHUB_API_KEY"]
tools = [
{
"type": "function",
"function": {
"name": "get_person_by_cpf",
"description": "Retrieve identity data from a Brazilian CPF number",
"parameters": {
"type": "object",
"properties": {
"cpf": {"type": "string", "description": "Brazilian CPF number"}
},
"required": ["cpf"],
},
},
}
]
def get_person_by_cpf(cpf: str) -> dict:
response = requests.get(
f"https://api.cpfhub.io/cpf/{cpf.replace('.', '').replace('-', '')}",
headers={"x-api-key": CPFHUB_API_KEY},
)
return response.json()
messages = [{"role": "user", "content": "Quem é a pessoa com CPF 123.456.789-09?"}]
response = client.chat.completions.create(model="gpt-4o", messages=messages, tools=tools)
message = response.choices[0].message
if message.tool_calls:
args = json.loads(message.tool_calls[0].function.arguments)
result = get_person_by_cpf(args["cpf"])
print(result)
Exemplo com LangChain
Veja examples/langchain_example.py para um exemplo completo de integração com agente LangChain.
Requisitos
- Node.js 18 ou superior
- Uma chave de API válida de app.cpfhub.io
Links
| Recurso | URL |
|---|---|
| Documentação | https://cpfhub.io/documentacao |
| Dashboard | https://app.cpfhub.io |
| Especificação OpenAPI | https://github.com/cpfhub/cpfhub-openapi |
| SDK Node.js | https://github.com/cpfhub/cpfhub-node |
| SDK Python | https://github.com/cpfhub/cpfhub-python |
| Todos os SDKs | https://github.com/cpfhub |
Licença
MIT © CPFHub.io
Recommended MCP Servers
How it compares
Specialized Brazilian identity API MCP, not a general open-data or global KYC marketplace skill.
FAQ
Who is io.github.cpfhub/cpfhub for?
Developers and founders building Brazil-market SaaS or APIs who want agents to query CPFHub.io through MCP during integration work.
When should I use io.github.cpfhub/cpfhub?
Use it while building signup, payment, or compliance flows that require validated CPF data and you are actively coding against CPFHub.
How do I add io.github.cpfhub/cpfhub to my agent?
Install or run the @cpfhub/mcp npm package with stdio transport and set the required CPFHUB_API_KEY environment variable in your MCP client config.