Mcp Focus Nfe

io.github.codesparPublished by GitHub account codesparv0.2.2Updated Oct 24, 2026

MCP server for Focus NFe — NFe, NFSe, NFCe emission and management

Overview

AI-generated overview

Local MCP server for Focus NFe that lets an assistant issue, query and cancel Brazilian electronic fiscal documents (NFe, NFSe, NFCe, CTe, MDFe) and manage webh

What you can do
Create, query and cancel NFe invoices, including PDF (DANFE) links and correction letters (CCe). Create, query and cancel NFSe service invoices and NFCe consumer invoices. Create, query and cancel CTe transport documents and create or close MDFe cargo manifests. Register, list and delete webhooks that notify a URL on fiscal document events.
When to use it
Useful when an assistant should help a Brazilian business issue or track electronic fiscal documents through Focus NFe, or wire document events to a webhook, without leaving the chat. Test in the homologation sandbox before touching real documents.
Requirements
Runs locally via npx from the npm package @codespar/mcp-focus-nfe, so Node.js is needed. A Focus NFe account and API token are required, supplied through the FOCUS_NFE_TOKEN environment variable; the optional FOCUS_NFE_SANDBOX variable set to true switches to the homologation environment. Network access to Focus NFe is required.
Before you install
The server holds a Focus NFe API token that can issue and cancel real fiscal documents; keep it out of shared configs. Several tools write or change data: creating, cancelling and correcting documents, and registering or deleting webhooks. Issued fiscal documents have legal and tax consequences, so use the sandbox first and confirm actions before running them against production.

Installation

In SourceWeft

  1. Open Mcp Focus Nfe in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

@codespar/mcp-focus-nfe

MCP server for Focus NFe — NFe, NFSe, and NFCe fiscal document emission

[npm] [License: MIT]

Quick Start

Claude Desktop

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

json
{  "mcpServers": {    "focus-nfe": {      "command": "npx",      "args": ["-y", "@codespar/mcp-focus-nfe"],      "env": {        "FOCUS_NFE_TOKEN": "your-token",        "FOCUS_NFE_SANDBOX": "true"      }    }  }}

Claude Code

bash
claude mcp add focus-nfe -- npx @codespar/mcp-focus-nfe

Cursor / VS Code

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

json
{  "servers": {    "focus-nfe": {      "command": "npx",      "args": ["-y", "@codespar/mcp-focus-nfe"],      "env": {        "FOCUS_NFE_TOKEN": "your-token",        "FOCUS_NFE_SANDBOX": "true"      }    }  }}

Tools (19)

ToolPurpose
create_nfeCreate and emit an NFe (nota fiscal eletronica)
get_nfeGet NFe details and status by reference
cancel_nfeCancel an authorized NFe (within 24h of emission)
get_nfe_pdfGet NFe PDF (DANFE) download URL
send_correction_letterSend a correction letter (Carta de Correcao / CCe) for an authorized NFe
create_nfseCreate and emit an NFSe (nota fiscal de servico)
get_nfseGet NFSe details and status by reference
cancel_nfseCancel an authorized NFSe
create_nfceCreate and emit an NFCe (nota fiscal do consumidor eletronica)
get_nfceGet NFCe details and status by reference
cancel_nfceCancel an authorized NFCe
create_cteCreate and emit a CTe (conhecimento de transporte eletronico) for cargo transport
get_cteGet CTe details and status by reference
cancel_cteCancel an authorized CTe
create_mdfeCreate and emit an MDFe (manifesto eletronico de documentos fiscais) for cargo transport manifest
close_mdfeClose/finalize an MDFe (encerramento) after trip completion
register_webhookRegister a webhook trigger (gatilho) that notifies your URL when fiscal document events occur
list_webhooksList all registered webhooks (gatilhos)
delete_webhookDelete a registered webhook by ID

Authentication

Focus NFe uses Basic Auth with the API token as username and empty password.

Sandbox / Testing

Focus NFe provides a homologation environment at homologacao.focusnfe.com.br. Set FOCUS_NFE_SANDBOX=true to use it.

Get your credentials

  1. Go to Focus NFe
  2. Create an account
  3. Get your API token from the dashboard
  4. Set the FOCUS_NFE_TOKEN environment variable

Environment Variables

VariableRequiredDescription
FOCUS_NFE_TOKENYesAPI token from Focus NFe
FOCUS_NFE_SANDBOXNoSet to "true" for homologation mode

Roadmap

v0.2 (planned)

  • create_cte — Create a CT-e (electronic transport document)
  • get_cte — Get CT-e details by ID
  • correction_letter — Issue a correction letter for an NF-e
  • manifest_recipient — Manifest recipient awareness of an NF-e
  • get_nfse_pdf — Get PDF for a service invoice (NFS-e)

v0.3 (planned)

  • batch_nfe — Create multiple NF-e in a single request
  • batch_nfse — Create multiple NFS-e in a single request

Want to contribute? Open a PR or request a tool.

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.

License

MIT

Source: packages/fiscal/focus-nfe/README.md at commit d0a519a

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.2.2LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts