mcpField
M
mcp-nfe-io

mcp-nfe-io

Local
github.com/codesparFinance275Updated 4w ago

About mcp-nfe-io

@codespar/mcp-nfe-io is an MCP server for NFe.io, a Brazilian fiscal document service. It covers NF-e and NFS-e issuance and management, plus CNPJ and CEP lookups. It suits users who need Brazilian invoicing inside an AI assistant.

Key features

  1. 01Issue, query and cancel NF-e and NFS-e
  2. 02CNPJ company data lookup
  3. 03CEP postal code address resolution
  4. 04PDF and XML link retrieval for invoices
  5. 05Company and webhook management
  6. 06Demo mode with canned responses

Use cases

  1. 01Issue service invoices for customers from a chat session
  2. 02Verify a company's name and status by CNPJ
  3. 03Register webhooks to receive invoice event callbacks

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"codespar-mcp-nfe-io": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-nfe-io"
],
"env": {
"NFEIO_API_KEY": "<NFEIO_API_KEY>",
"NFEIO_COMPANY_ID": "<NFEIO_COMPANY_ID>"
}
}
}
}
Run commandnpx -y @codespar/mcp-nfe-io
Environment variables to set
NFEIO_API_KEYSecretAPI key for NFe.io (issuance + query)
NFEIO_COMPANY_IDDefault company ID (CNPJ or NFe.io company UUID) to use when not provided per-call

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@codespar/mcp-nfe-io0.2.2

Tools

22

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
borrowerobjectYesService taker. Shape: { federalTaxNumber, name, email?, address? }
rpsNumbernumberNoRPS sequential number (optional; auto-assigned if omitted)
company_idstringNoCompany id or CNPJ (falls back to NFEIO_COMPANY_ID)
descriptionstringYesService description
servicesAmountnumberYesTotal service amount in BRL
cityServiceCodestringYesMunicipal service code (varies per city)
rpsSerialNumberstringNoRPS series (optional)
additionalInformationstringNoFree-form notes on the invoice

Details

From the project README

@codespar/mcp-nfe-io

MCP server for NFe.io — NF-e / NFS-e fiscal document emission plus CNPJ and CEP lookups for Brazil.

npm License: MIT

Quick Start

Claude Desktop

Add to ~/.config/claude/claude_desktop_config.json:

{
  "mcpServers": {
    "nfe-io": {
      "command": "npx",
      "args": ["-y", "@codespar/mcp-nfe-io"],
      "env": {
        "NFEIO_API_KEY": "your-api-key",
        "NFEIO_COMPANY_ID": "your-company-id-or-cnpj"
      }
    }
  }
}
Claude Code
claude mcp add nfe-io -- npx @codespar/mcp-nfe-io
Cursor / VS Code

Add to .cursor/mcp.json or .vscode/mcp.json:

{
  "servers": {
    "nfe-io": {
      "command": "npx",
      "args": ["-y", "@codespar/mcp-nfe-io"],
      "env": {
        "NFEIO_API_KEY": "your-api-key",
        "NFEIO_COMPANY_ID": "your-company-id-or-cnpj"
      }
    }
  }
}

Tools (22)

ToolPurpose
create_nfseIssue an NFS-e (service invoice).
get_nfseFetch a single NFS-e by id.
cancel_nfseCancel an NFS-e.
list_nfseList NFS-e with pagination + optional flowStatus filter.
email_nfseEmail the PDF of an already-issued NFS-e to a recipient.
create_nfeIssue an NF-e (product invoice).
get_nfeFetch a single NF-e by id.
cancel_nfeCancel an NF-e.
list_nfeList NF-e with pagination + optional status filter.
get_nfe_pdfReturn the DANFE PDF URL for an issued NF-e.
consult_cnpjLook up Brazilian company data (razão social, status, address) by CNPJ.
consult_cepResolve a Brazilian postal code (CEP) to a full address.
correct_nfeIssue a Carta de Correção (CC-e) for an authorized NF-e.
get_nfe_xmlReturn the authorized XML URL for an NF-e.
get_nfse_pdfReturn the PDF URL for an issued NFS-e.
get_nfse_xmlReturn the XML URL for an issued NFS-e.
list_companiesList companies registered on the NFe.io account.
get_companyFetch a single company by id or CNPJ.
create_companyProvision a new company on NFe.io.
list_webhooksList webhook endpoints registered for a company (invoice event callbacks).
create_webhookRegister a webhook endpoint.
delete_webhookRemove a webhook endpoint by id.

Environment

VariableRequiredNotes
NFEIO_API_KEYyesIssuance + query scopes. NFe.io supports splitting this into two keys; either is fine.
NFEIO_COMPANY_IDnoDefault company id (or CNPJ). Per-call company_id arguments override it.

Hosts

NFe.io segments its API across three hostnames. This server maps tools to the correct one automatically:

  • api.nfse.io — product invoices
  • api.nfe.io — service invoices + company management
  • nfe.api.nfe.io — lookups (CNPJ, CEP)

Demo mode

Pass --demo or set MCP_DEMO=true to return canned responses without hitting the network. Useful for documentation, screencasts, and CI.

Links

Enterprise

Need governance, budget limits, and audit trails for agent payments? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.

Authentication

Set these environment variables before launching the server:

  • NFEIO_API_KEY (required, secret) — API key for NFe.io (issuance + query)
  • NFEIO_COMPANY_ID — Default company ID (CNPJ or NFe.io company UUID) to use when not provided per-call

Issue credentials at the provider's developer portal: https://nfe.io/docs.

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.