mcp-nfe-io — Claude Code MCP server: what it does, how to install
MCP server for NFe.io fiscal tools. Issues Brazilian invoices (NF-e and NFS-e) and handles CNPJ and CEP lookups directly from your coding agent.
claude mcp add --env NFEIO_API_KEY=<NFEIO_API_KEY> --env NFEIO_COMPANY_ID=<NFEIO_COMPANY_ID> --transport stdio nfe-io -- npx -y @codespar/mcp-nfe-ioWhat mcp-nfe-io does
This server connects AI assistants to 22 NFe.io endpoints. Your agent can issue service invoices, generate product bills, handle cancellations, and retrieve authorized XML or PDF files. Requests automatically route to the proper NFe.io hostname depending on whether you handle product invoices, services, or registry lookups.
It also handles Brazilian company data inquiries by CNPJ and resolves postal codes to full street addresses. You can provision corporate sub-accounts and register webhook subscriptions for invoice event callbacks. Local pipelines and test workflows can run without network access by passing --demo or setting MCP_DEMO=true to receive mock payloads.
Live operations will fail without a valid NFEIO_API_KEY present in your environment variables. You can provide NFEIO_COMPANY_ID once globally or pass an identifier inside specific tool calls.
What it helps with
- Generate an NFS-e service invoice directly from agent prompts
- Download the authorized XML and PDF files for a product invoice
- Look up company registration details and legal address using CNPJ
- Register webhook callbacks for incoming invoice events
Example prompts for the agent
- Look up company details for CNPJ 00.000.000/0001-91 with
consult_cnpj. - Issue an NFS-e for this order and email the PDF using
email_nfse. - Find the postal address for CEP 01310-100 using
consult_cep.
How to install mcp-nfe-io
Platform CLI
claude mcp add --env NFEIO_API_KEY=<NFEIO_API_KEY> --env NFEIO_COMPANY_ID=<NFEIO_COMPANY_ID> --transport stdio nfe-io -- npx -y @codespar/mcp-nfe-ioReplace <…> with your own values
Platform CLI
codex mcp add nfe-io --env NFEIO_API_KEY=<NFEIO_API_KEY> --env NFEIO_COMPANY_ID=<NFEIO_COMPANY_ID> -- npx -y @codespar/mcp-nfe-ioReplace <…> with your own values
Config file
{
"mcpServers": {
"nfe-io": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-nfe-io"
],
"env": {
"NFEIO_API_KEY": "<NFEIO_API_KEY>",
"NFEIO_COMPANY_ID": "<NFEIO_COMPANY_ID>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"nfe-io": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@codespar/mcp-nfe-io"
],
"env": {
"NFEIO_API_KEY": "<NFEIO_API_KEY>",
"NFEIO_COMPANY_ID": "<NFEIO_COMPANY_ID>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e NFEIO_API_KEY=<NFEIO_API_KEY> -e NFEIO_COMPANY_ID=<NFEIO_COMPANY_ID> nfe-io npx -y @codespar/mcp-nfe-ioReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mcp-nfe-io
How to install mcp-nfe-io in Claude Code?
Run claude mcp add mcp-nfe-io -e NFEIO_API_KEY=<NFEIO_API_KEY> -- npx -y @codespar/mcp-nfe-io. Provide your real API token in place of <NFEIO_API_KEY>.
What does mcp-nfe-io do?
It gives your assistant tools to issue and manage Brazilian fiscal documents like NF-e and NFS-e, alongside verification endpoints for CNPJ tax IDs and CEP zip codes.
Can I test mcp-nfe-io without active API credentials?
Yes. Add the --demo flag or set MCP_DEMO=true in your environment. The server then returns mock data locally without hitting the live network.