DF-e

io.github.mcp-dirPublished by GitHub account mcp-dirv0.1.0Updated Oct 24, 2026

Brazilian SEFAZ e-invoices (NF-e, CT-e) issued against your company. A1 cert, DANFE PDF.

VerifiedStreamable HTTPWeb executableFiles & StorageFinanceBusiness & Commerce

Overview

AI-generated overview

Pulls Brazilian SEFAZ electronic fiscal documents issued against your company and renders DANFE PDFs from the XML.

What you can do
Connects to the official NFeDistribuicaoDFe web service using your company's A1 digital certificate to retrieve inbound supplier NF-e, CT-e freight bills and events. Tools list connected tax IDs, run incremental NSU sync (up to 50 documents per call), look up a single document by NSU or 44-digit access key, render the DANFE PDF from the XML, and report the remaining hourly query budget. Read-only; it does not return invoices your own company issued.
When to use it
Use it when an assistant should monitor or summarize fiscal documents that suppliers and carriers issued against your Brazilian company, or produce printable DANFE files. It is not for auditing your own issued invoices, which come from your ERP.
Requirements
A remote MCP endpoint over HTTP; no local runtime. You need the company's own A1 e-CNPJ certificate (an accountant's certificate will not work) and a paid subscription billed per connected tax ID. Data returned is sent to the LLM host you choose.
Before you install
The A1 certificate is a sensitive credential, stored encrypted and used for the SEFAZ TLS handshake. The service is read-only at the source, but returned fiscal data goes to your chosen LLM host. SEFAZ limits queries to 20 per hour per tax ID, shared with other systems, and polling past the queue end earns a one-hour block. Some documents arrive as summaries without line items until the recipient acknowledges them.

Installation

In SourceWeft

  1. Open DF-e in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.mcp-dir%2Fdfe-mcp/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "df-e": {
      "type": "http",
      "url": "https://api.mcp.ai/p_dfe"
    }
  }
}

README

This repository has no README.

Tools

12

dfe_list_accounts

Lista os CNPJs conectados neste install (razão social, CNPJ e UF).

Parametersaccount

dfe_sincronizar

Puxa os documentos fiscais NOVOS emitidos contra este CNPJ (nota de fornecedor, evento, CT-e) — NFeDistribuicaoDFe. COMO USAR: chame com `ult_nsu: "0"` na primeira vez. A resposta traz `proximo_nsu` — passe ELE na chamada seguinte, sem alterar. Repita até `fim_da_fila: true`. PARE quando `fim_da_fila` for true. Continuar consultando depois disso é o que a SEFAZ pune com bloqueio de 1 hora no CNPJ. Cada documento vem com `completo`: true = XML íntegro da nota (dá para auditar em auditor_fiscal_auditar_nota); false = apenas RESUMO (chave, emitente, valor), que é o que a SEFAZ entrega enquanto o destinatário não fizer a manifestação. ATENÇÃO: este serviço NÃO devolve as notas que VOCÊ emitiu — só as recebidas. Para auditar a própria emissão, pegue o XML no seu ERP (ex.: omie_get_invoice_xml).

Parametersaccountult_nsuforcar_nsu

dfe_consultar_nsu

Busca UM documento específico pelo NSU. Serve para recuperar um item que falhou na descompactação durante a sincronização — não para varrer a fila (isso é dfe_sincronizar).

Parametersnsurequiredaccount

dfe_consultar_chave

Busca um documento pela chave de acesso de 44 dígitos. LIMITES: só documentos que chegaram ao Ambiente Nacional nos ÚLTIMOS 90 DIAS, e nunca a nota em que este CNPJ é o EMITENTE (a SEFAZ não devolve a própria emissão).

Parameterschaverequiredaccount

dfe_gerar_danfe

Gera o DANFE (o PDF da nota) a partir do XML. A SEFAZ distribui XML, não PDF, então esta é a representação gráfica para imprimir, anexar ou mandar pro cliente. COMO USAR: passe em `xml` o conteúdo do documento que veio em dfe_sincronizar (campo `documentos[].xml`). Assim NÃO gasta consulta na SEFAZ. Se não tiver o XML em mãos, use `chave` ou `nsu` — mas aí gasta uma das consultas da hora. SÓ FUNCIONA com documento `completo: true`. Documento `resumo` não tem os itens, e sem itens não existe DANFE: o XML completo só sai depois da manifestação do destinatário. A resposta traz um link de download em `files[]`, entregue ele ao usuário. Não tente ler o conteúdo do arquivo, é binário.

Parametersnsuxmlchaveaccount

dfe_orcamento

Quantas consultas ainda cabem nesta hora para este CNPJ, e se ele está bloqueado. Não consome consulta. Chame isto antes de uma carga grande — o limite da SEFAZ é por CNPJ e conta também o que outros sistemas do cliente consultarem.

Parametersaccount

show_version

Show Version

Show the current MCP platform and adapter versions.

Takes no parameters.

report_bug

Report Bug

Report a bug, missing feature, or send feedback. Include the conversation array with recent messages for reproduction.

Parameterscontextmessagerequiredconversation

connect

Connection Status

Returns connection status and URLs. When all providers are connected, returns authenticated:true and empty pending[]. When credentials are missing, returns connect_url for the toolkit and per-install URLs.

Takes no parameters.

toolkit_info

Toolkit Info

Returns the current toolkit state: installed MCPs, their connection status, the accounts connected to each one, and how many catalog tools each exposes.

Takes no parameters.

marketplace

Marketplace

The official mcp.ai marketplace — the in-platform catalog of every MCP/tool, AND the way to run them. Covers capability requests like "find an MCP that does X", "consulta um CPF", "is there a tool for Y". Core flow: action=search discovers MCPs by intent → describe returns one MCP's full profile (every tool with its id + params, pricing, auth) so you pick the right tool_id → invoke RUNS that tool. KEY: invoke works even when the MCP is NOT installed — it runs the tool pontualmente (one-off), without adding the MCP to the toolkit and without bloating the tool list. If the MCP needs a credential/login, invoke returns a connect link; if it is paid and the wallet is empty, invoke returns a checkout/top-up link (the user opens it, then you retry). Use install only to make an MCP PERMANENT in the active toolkit (its tools then show up natively in future sessions); prefer invoke for a single/occasional use. list_tools lists what is callable right now. subscribe/cancel handle per-MCP billing; report_bug sends feedback; request_mcp asks us to build a NEW MCP when nothing fits. Search/describe flag installed_in_toolkit vs installed_in_workspace. Writes (install/uninstall/subscribe/cancel and the one-off install behind invoke) require workspace owner/admin. It also carries the mcp.ai PROMPT LIBRARY, which is about ready-made prompt TEXT rather than MCPs: search_prompts finds one, get_prompt returns its full text with {{variables}} filled, and publish_prompt saves a prompt and returns a shareable mcp.ai/p/<slug> link that opens without login.

Parameterslimitqueryactionmcp_idmessagetool_idargumentsimmediatetier_slugprompt_bodyprompt_slugprompt_tool+11 more

authenticate

Authenticate

MCP.AI for IDE agents (Cursor, etc.): log in in the browser, copy the access token. Best: add it to this server's config as a header `Authorization: Bearer <token>` for a permanent, non-expiring connection. Or paste it here for a session-only login: call with { token: "<jwt>" } after the user pastes, or with no args to get the link.

Parameterstoken

Version history

1
  1. v0.1.0LatestSep 16, 2026

Score

75% 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 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts

    Declare a GitHub repository with a README, or serve resource_documentation in the OAuth protected-resource metadata.

  • License10 pts

    Declare a license in the repository or the registry entry.