Mcp Focus Nfe

io.github.codespar由 GitHub 账号 codespar 发布v0.2.2更新于 Oct 24, 2026

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

概览

AI 生成的概览

面向 Focus NFe 的本地 MCP 服务器,让助手开具、查询和取消巴西电子税务单据(NFe、NFSe、NFCe、CTe、MDFe)并管理 webhook。

可以做什么
创建、查询和取消 NFe 发票,包括获取 PDF(DANFE)链接和发送更正函(CCe)。创建、查询和取消 NFSe 服务发票和 NFCe 消费者发票。创建、查询和取消 CTe 运输单据,并创建或关闭 MDFe 货运清单。注册、列出和删除在税务单据事件发生时通知指定网址的 webhook。
适用场景
适合让助手协助巴西企业通过 Focus NFe 开具或跟踪电子税务单据,或把单据事件接入 webhook,而无需离开对话。建议先在 homologation 沙箱环境测试,再处理真实单据。
运行要求
通过 npm 包 @codespar/mcp-focus-nfe 以 npx 在本地运行,需要 Node.js。需要 Focus NFe 账户和 API 令牌,通过环境变量 FOCUS_NFE_TOKEN 提供;可选环境变量 FOCUS_NFE_SANDBOX 设为 true 可切换到 homologation 环境。需要能访问 Focus NFe 的网络。
安装前请注意
该服务器持有可开具和取消真实税务单据的 Focus NFe API 令牌,请勿放入共享配置。多个工具会写入或更改数据:创建、取消和更正单据,以及注册或删除 webhook。已开具的税务单据具有法律和税务后果,请先在沙箱中试用,并在对生产环境执行前确认操作。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Focus Nfe,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

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

来源:packages/fiscal/focus-nfe/README.md,提交 d0a519a

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分