# DF-e [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/mcp-dir/dfe-mcp  
**GitHub Stars:** 0  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/df-e

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

## Tools
Capabilities this server exposes over MCP:

- **dfe_list_accounts** — Lista os CNPJs conectados neste install (razão social, CNPJ e UF).
- **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).
- **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).
- **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).
- **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.
- **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.
- **show_version** — Show the current MCP platform and adapter versions.
- **report_bug** — Report a bug, missing feature, or send feedback. Include the conversation array with recent messages for reproduction.
- **connect** — 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.
- **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.
- **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.
- **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.

## Claude Desktop Quick Installation
Remote MCP endpoint (confidence: high). Install path detected from listing signals. Add as a URL/SSE server in your client:

```json
"mcpServers": {
  "df-e": {
    "url": "https://api.mcp.ai/p_dfe"
  }
}
```

## Documentation

## What DF-e does

The DF-e MCP server retrieves electronic fiscal documents that Brazilian suppliers and carriers issued against a company’s CNPJ. Its coverage includes supplier NF-e, CT-e freight bills, and fiscal events delivered through SEFAZ’s official NFeDistribuicaoDFe web service. The service is read-only: it does not alter records at SEFAZ or acknowledge documents on the recipient’s behalf.

The DF-e MCP server is intended for inbound-document workflows. It does not provide invoices issued by your own company, because the distribution service is designed to return documents addressed to the recipient. Your ERP remains the source for the company’s outgoing XML.

Some results may be summaries rather than complete XML. Until the recipient acknowledges an invoice, SEFAZ may provide only the access key, issuer, and amount. Without the full XML and line items, a DANFE cannot be rendered and line-by-line review is not possible.

## How it works

The service uses the connected company’s own A1 digital certificate for the TLS exchange with SEFAZ. The certificate holder must match the CNPJ being queried; an accountant’s certificate cannot be substituted for the company’s certificate. Certificate data is encrypted at rest and used for the SEFAZ connection.

Synchronization follows the NSU queue. Each sync retrieves new documents, up to 50 per call, and resumes from the last position on a later call. The process stops when the queue is exhausted instead of continuing to poll unnecessarily. SEFAZ permits 20 queries per hour per tax ID, and polling beyond the end of the queue can result in a one-hour block. That limit is shared with other systems, including an ERP or accountant’s software.

DANFE output is generated locally from available invoice XML because SEFAZ distributes XML rather than the printable PDF. The generated document is returned as a download link. Access-key lookups are available for documents that entered the national environment within the previous 90 days.

## Setup and configuration

Connect the hosted endpoint at `https://api.mcp.ai/p_dfe` through an MCP client that supports MCP over HTTP. The README provides installation paths for Claude Web and Desktop, Cursor, and VS Code, and states that the endpoint also works with ChatGPT, Manus, OpenClaw, and other compatible clients.

A connected account requires the company’s own A1 e-CNPJ certificate. Accounts are billed per connected tax ID, and the certificate must correspond to that tax ID. The repository documentation does not specify environment variables for running the hosted endpoint.

## Tools and capabilities

The DF-e MCP server exposes six tools:

- `dfe_list_accounts` lists connected CNPJs with company name and state.
- `dfe_sincronizar` retrieves new NF-e, CT-e, and event documents from the incremental queue.
- `dfe_consultar_nsu` finds one document by NSU, including a previously missed item.
- `dfe_consultar_chave` searches by a 44-digit invoice access key.
- `dfe_gerar_danfe` creates a DANFE PDF from XML.
- `dfe_orcamento` reports remaining hourly query capacity and whether the tax ID is blocked, without spending a query.

## Limitations and notes

The DF-e MCP server is independent and is not affiliated with SEFAZ or Brazil’s Federal Revenue Service. Its data is returned to the selected LLM host, which acts as a subprocesser outside the server operator’s control. The server states that captured XML is not retained beyond operational logs.

Recipient acknowledgement is not currently performed by the MCP. Documents without acknowledgement may remain summaries, preventing PDF generation and detailed auditing. The SEFAZ query budget is per CNPJ and shared across every system using that tax ID, so this server cannot account for queries made elsewhere.

_Full upstream README: https://allmcps.com/mcp/df-e/readme_

