MCP Server

MCP server for Brazilian e-invoicing: NF-e and NFC-e (modelo 55/65), schema 4.00, SEFAZ.

Local serverstdioPython

What is the MCP MCP server?

Connect MCP to Claude, Cursor or any other MCP client and it stops being a tab you switch to. MCP server for Brazilian e-invoicing: NF-e and NFC-e (modelo 55/65), schema 4.00, SEFAZ. The mcp mcp server is what makes that connection.

What the server does

Add the server to your MCP client configuration. For Claude Desktop, edit claude_desktop_config.json:

Available tools

The toolset is worth reading before you wire it up, because it tells you what the integration is really for:

  • Requirements — The Requirements tool exposed by this server
  • br__validate_cpf — Validates a CPF (Cadastro de Pessoas Físicas), the individual taxpayer identification number, using the Receita Federal modulo 11 algorithm
  • br__validate_cnpj — Validates a CNPJ (Cadastro Nacional da Pessoa Jurídica), the business taxpayer identification number. Accepts both the traditional numeric format (14
  • br__generate_nfe — Returns {"xml": ..., "chave_acesso": ..., "warnings": [...]}. The warnings in Portuguese remind that the document is not signed (ICP-Brasil) and
  • br__validate_nfe_xml — Validates an NF-e/NFC-e 4.00 XML document against the official PL_010d XSD (local "unsigned" variant, see note below)
  • br__build_access_key — Builds an access key (chNFe, 44 characters) with a modulo 11 check digit, from the components cUF, dhEmi, issuer CNPJ, model, series, and document
  • br__generate_cte — The br__generate_cte tool exposed by this server
  • br__validate_cte_xml — Validates a CT-e 4.00 XML document against the bundled PL_CTe_400 XSD (auto-selects the unsigned or official signed schema based on ds:Signature
  • br__consult_cte_sefaz_status — Checks SEFAZ CT-e webservice availability (CTeStatusServicoV4). Read-only, no confirmation required
  • br__consult_cte — Queries a CT-e's status by access key (CTeConsultaV4). Read-only, no confirmation required — it queries one already-known document, not a bulk data
  • br__submit_cte — Submits a signed CT-e to SEFAZ authorization (CTeRecepcaoSincV4, synchronous). The payload is automatically GZip-compressed and Base64-encoded before
  • br__cancel_cte — Requests cancellation of an authorized CT-e (event 110111, CTeRecepcaoEventoV4). cStat=135 indicates the cancellation was homologated. Gated

Credentials and setup notes

Installation

mcp-nfe-br on PyPI is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Where it fits

Among the planning and project tracking options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. MCP's toolset — Requirements, br__validate_cpf, br__validate_cnpj and 10 more — is a fair guide to whether it matches your workflow. It is maintained by cmendezs; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Worth knowing first

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 13 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch MCP.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
RequirementsThe Requirements tool exposed by this server.
br__validate_cpfValidates a CPF (Cadastro de Pessoas Físicas), the individual taxpayer identification number, using the Receita Federal modulo 11 algorithm.
br__validate_cnpjValidates a CNPJ (Cadastro Nacional da Pessoa Jurídica), the business taxpayer identification number. Accepts both the traditional numeric format (14 digits) and the alphanumeric format introduced by NT 2026.004 (PL_010d
br__generate_nfeReturns {"xml": ..., "chave_acesso": ..., "warnings": [...]}. The warnings in Portuguese remind that the document is **not signed** (ICP-Brasil) and **was not transmitted to SEFAZ**. Both steps are the responsibility of
br__validate_nfe_xmlValidates an NF-e/NFC-e 4.00 XML document against the official PL_010d XSD (local "unsigned" variant, see note below).
br__build_access_keyBuilds an access key (chNFe, 44 characters) with a modulo 11 check digit, from the components cUF, dhEmi, issuer CNPJ, model, series, and document number.
br__generate_cteThe br__generate_cte tool exposed by this server.
br__validate_cte_xmlValidates a CT-e 4.00 XML document against the bundled PL_CTe_400 XSD (auto-selects the unsigned or official signed schema based on <ds:Signature> presence).
br__consult_cte_sefaz_statusChecks SEFAZ CT-e webservice availability (CTeStatusServicoV4). Read-only, no confirmation required.
br__consult_cteQueries a CT-e's status by access key (CTeConsultaV4). Read-only, no confirmation required — it queries one already-known document, not a bulk data pull.
br__submit_cteSubmits a signed CT-e to SEFAZ authorization (CTeRecepcaoSincV4, synchronous). The payload is automatically GZip-compressed and Base64-encoded before transmission, per the CT-e MOC. Gated with a two-step confirmation (Co
br__cancel_cteRequests cancellation of an authorized CT-e (event 110111, CTeRecepcaoEventoV4). cStat=135 indicates the cancellation was homologated. Gated.
br__correct_cteIssues a Carta de Correção Eletrônica (event 110110, CTeRecepcaoEventoV4). Per Art. 58-B of CONVÊNIO/SINIEF 06/89, a CC-e cannot alter tax values, party registration data, or the issue/departure date. Gated.

How to install the MCP MCP server

For a local development installation:

```json
{
  "mcpServers": {
    "nfe-br": {
      "command": "uv",
      "args": ["run", "mcp-nfe-br"],
      "cwd": "/path/to/mcp-nfe-br"
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

Example prompts to try

  • Use MCP to Requirements.
  • Use MCP to br validate cpf.
  • Use MCP to br validate cnpj.

Frequently asked questions

It connects MCP to MCP-compatible AI assistants such as Claude and Cursor, exposing 13 tools (Requirements, br__validate_cpf, br__validate_cnpj, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with MCP directly.