Skip to main content
NF

NFe.io

v0.2.1API Key

NF-e/NFS-e emission as a service — no cert installation, no XML assembly. Companies, webhooks, and CC-e (Carta de Correção) included. Full doc URL access for DANFE, PDFs, and XMLs.

22 tools2 env vars🇧🇷 Brazilstable on npm

What your agent can do

NFe.io gives your agent 22 tools it calls directly — pick the ones it needs, in Claude, Cursor, or any MCP client.

  • create_nfseIssue an NFS-e (service invoice). Returns the invoice with flowStatus, rpsNumber, and PDF URL once processed.
  • get_nfseFetch a single NFS-e by id.
  • cancel_nfseCancel an NFS-e. Some municipalities only allow cancellation within a short window (commonly 30 days).
Example call
// Your agent calls a tool directly — no glue code.
// CodeSpar's managed tier handles OAuth2, token rotation and rate limits.
const result = await session.call("create_nfse", { /* ... */ });

Install

terminal
$ npm install @codespar/mcp-nfe-io

Quickstart

Add this entry to your claude_desktop_config.json (or any MCP-compatible client config).

claude_desktop_config.json
{
  "mcpServers": {
    "nfe-io": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-nfe-io"
      ],
      "env": {
        "NFEIO_API_KEY": "<your_nfeio_api_key>"
      }
    }
  }
}

After restart, your agent can call any of the 22 tools below — try create_nfse first.

Environment variables · 2

Required to authenticate the server. Stored encrypted when using CodeSpar managed hosting.

NFEIO_API_KEY
requiredsecret

API key for NFe.io (issuance + query)

NFEIO_COMPANY_ID
optional

Default company ID (CNPJ or NFe.io company UUID) to use when not provided per-call

Available tools · 22

Each tool is independent — your agent loads only what it needs to reduce context and response time.

WRITEcreate_nfse
Issue an NFS-e (service invoice). Returns the invoice with flowStatus, rpsNumber, and PDF URL once processed.
READget_nfse
Fetch a single NFS-e by id.
DELETEcancel_nfse
Cancel an NFS-e. Some municipalities only allow cancellation within a short window (commonly 30 days).
READlist_nfse
List NFS-e with pagination + optional flowStatus filter.
READemail_nfse
Email the PDF of an already-issued NFS-e to a recipient.
WRITEcreate_nfe
Issue an NF-e (product invoice). Returns the invoice with status, access key (chave), and DANFE URL once authorized.
READget_nfe
Fetch a single NF-e by id.
DELETEcancel_nfe
Cancel an NF-e. Must include a justification of at least 15 characters.

Compatible frameworks

MCP is a protocol — any framework that speaks it can mount this server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Any MCP clientProtocol

Frequently asked questions

Run `npx -y @codespar/mcp-nfe-io` and add the config block above to your MCP client — Claude, Cursor, VS Code, or any MCP-compatible client. No build step, no SDK required. Prefer hosted? CodeSpar's managed tier runs it for you with auth handled.
NFe.io — MCP server · 22 tools | CodeSpar