Mcp Nfe Br

io.github.cmendezs由 GitHub 帳號 cmendezs 發布v0.13.0更新於 Nov 22, 2026

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

已驗證STDIO僅桌面金融商業與電商

概覽

AI 產生的概覽

讓 AI 助理產生、簽署、驗證並提交巴西電子稅務文件(NF-e、NFC-e、NFS-e、CT-e)。

可以做什麼
  • 驗證 CPF 與 CNPJ 稅籍編號,包含英數字格式的 CNPJ
  • 產生未簽署的 NF-e/NFC-e、NFS-e DPS 與 CT-e XML,並組出 44 碼存取金鑰
  • 為 NF-e/NFC-e 與 NFS-e 文件套用 ICP-Brasil XML-DSig 簽章
  • 依內附 XSD 驗證 NF-e、NFS-e 與 CT-e XML
  • 查詢 SEFAZ 與 ADN 服務狀態,並依存取金鑰查詢文件
  • 提交、取消與更正文件,寫入類操作需兩階段確認
適用情境
當你處理巴西稅務文件,希望助理草擬、檢查或簽署 NF-e/NFC-e、NFS-e、CT-e XML,或以自有憑證直接對接 SEFAZ/ADN 而不經商業開票平台時使用。
執行需求
本機 Python 套件(需 Python 3.11 以上),以 stdio 執行,通常透過 uvx 或 pip 安裝。執行本身不需憑證;BR_READ_ONLY、BR_CTE_READ_ONLY 與 LOG_LEVEL 為選用開關。簽章需要 ICP-Brasil A1 PKCS#12 憑證,呼叫 SEFAZ/ADN 需要網路連線;CT-e 呼叫必須明確提供 endpoint override。
安裝前請注意
寫入類工具會提交、取消或更正稅務文件,說明指其在正式環境不可回復;可用 BR_READ_ONLY 或 BR_CTE_READ_ONLY 停用。簽章需要你的 ICP-Brasil 憑證與私鑰,應留在自有環境。DF-e 分發工具會取得與該憑證綁定的第三方稅務資料。部分 NFS-e 與 CT-e 端點及格式標示為未驗證,英數字 CNPJ 檢查碼演算法依據二手資料。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mcp Nfe Br,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

mcp-nfe-br 🇧🇷

English | Portugues (Brasil)

[PyPI version] [Python] [License]


Introduction

mcp-nfe-br is an MCP (Model Context Protocol) server providing tools for issuing and validating Brazilian electronic fiscal documents: NF-e (modelo 55), NFC-e (modelo 65), NFS-e Nacional (ADN), and CT-e (modelo 57). This server is part of the mcp-einvoicing-* / mcp-*-* family, built on mcp-einvoicing-core, which provides the base data model, HTTP/OAuth2 utilities, and shared MCP server infrastructure.

Current status (v0.11.0): NF-e/NFC-e (modelo 55/65, schema 4.00) and NFS-e Nacional (ADN, schema v1.01) generation, ICP-Brasil signing, XSD validation, and gated SEFAZ/ADN submission are implemented. NF-e/NFC-e now also covers the 010e_v.1.02 schema delta (DANFE Simplificado Tipo 2 — tpImp=6, cIndOp, ISUFEmit, and the SEFAZ alert-message response group) and the 010f_v.1.04 delta (NT 2026.007 — emit/IE optional for taxpayers exclusively subject to IBS/CBS, produção 2026-11-03) on top of the PL_010d base. CT-e (modelo 57) generation/signing/validation and SEFAZ event submission (cancelamento, Carta de Correção) were added starting v0.6.0 — v1 scope is intentionally narrow: modal rodoviário only, ICMS CST 00 only, and no bundled/verified CT-e webservice endpoint table (every SEFAZ CT-e call requires an explicit endpoint_override). See the "CT-e (modelo 57)" tools section below for the full field-level reference. Since v0.11.0, NF-e/NFC-e also supports vUnComLiq/vProdLiq/vProdLiqTot, emit/tpRegimeIBSCBS, cAtivSN, gTribSN and gPgtoVinc (NT 2026.005, 2026.006 and 2026.008); the IBS/CBS group emission is known not to validate against the official schema yet.

Installation

Requirements

Using uv (recommended)

bash
uv add mcp-nfe-br

Using pip

bash
pip install mcp-nfe-br

From source

bash
git clone https://github.com/cmendezs/mcp-nfe-br.gitcd mcp-nfe-bruv sync --all-extras

Configuration

This server needs no credentials to run. The environment variables below are optional safety/logging toggles:

Environment variables

VariableDescriptionDefault
BR_READ_ONLYMaster switch. Set to 1 to disable write tools across all sub-formats: NF-e/NFC-e (br__submit_nfe, br__distribute_dfe), NFS-e (br__submit_nfse, br__cancel_nfse), and CT-e (br__submit_cte, br__cancel_cte, br__correct_cte). Safe mode for exploration. The SEFAZ environment (production/homologation) is selected per call via the tp_amb argument.—
BR_CTE_READ_ONLYSet to 1 to disable only the CT-e write tools (br__submit_cte, br__cancel_cte, br__correct_cte), leaving NF-e/NFS-e writes enabled. Independent of BR_READ_ONLY — either variable set to 1 is sufficient to block CT-e writes; you do not need both.—
LOG_LEVELLog level: DEBUG, INFO, WARNING, ERRORINFO

Claude Desktop integration

To use this server with Claude, add this configuration to your claude_desktop_config.json file:

json
{  "mcpServers": {    "nfe-br": {      "command": "uvx",      "args": ["mcp-nfe-br"]    }  }}

For a local development install:

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

Cursor integration

Cursor supports MCP servers via stdio. Add the configuration in:

  • Global (all projects): ~/.cursor/mcp.json
  • Project (this repository only): .cursor/mcp.json
json
{  "mcpServers": {    "nfe-br": {      "command": "uvx",      "args": ["mcp-nfe-br"]    }  }}

Reload the Cursor window (Ctrl+Shift+P then Reload Window) to apply the changes.

Kiro integration

Kiro supports MCP servers via its dedicated configuration file. Two levels are available:

  • Global (all projects): ~/.kiro/settings/mcp.json
  • Workspace (this repository only): .kiro/settings/mcp.json
json
{  "mcpServers": {    "nfe-br": {      "command": "uvx",      "args": ["mcp-nfe-br"],      "disabled": false,      "autoApprove": []    }  }}

The file is automatically reloaded on save. You can also open the config via the command palette (Cmd+Shift+P / Ctrl+Shift+P) then MCP.

Available tools

br__validate_cpf

Validates a CPF (Cadastro de Pessoas Físicas), the individual taxpayer identification number, using the Receita Federal modulo 11 algorithm.

ParameterTypeRequiredDescription
cpfstringyesCPF with or without ./- separators

Returns a TaxIdValidationResult with valid=True and the cleaned value (11 digits) on success, or valid=False with an error message in Portuguese.


br__validate_cnpj

Validates 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), effective in homologation from 2026-06-01 and in production from 2026-07-01.

ParameterTypeRequiredDescription
cnpjstringyesCNPJ with or without .///- separators

Returns a TaxIdValidationResult with valid=True and the cleaned value (14 characters) on success, or valid=False with an error message in Portuguese.

⚠️ [Unverified]: the check-digit algorithm for the alphanumeric CNPJ format was implemented based on secondary sources, as the primary source ("NT Conjunta DFe 2025.001") is not yet available locally.


br__generate_nfe

Generates an unsigned NF-e/NFC-e 4.00 document (<NFe><infNFe>…</infNFe></NFe>) from a BRInvoice object.

ParameterTypeRequiredDescription
invoiceobjectyesBRInvoice document (modelo 55 or 65, groups ide/emit/dest/det/total/transp/pag)

Returns {"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 a separate process.

Phase 1 coverage for per-item tax groups:

TaxSupported codesBehavior
ICMSCST 00 (normal regime) or CSOSN 102 (Simples Nacional)other codes raise DocumentGenerationError
PIS/COFINSCST 01/02 (rate-based) or 04-09 (non-taxed)group omitted if pis_cst/cofins_cst are None
IPICST 00/49/50/99 (taxed) or other (non-taxed)group omitted if ipi_cst is None

IBS/CBS (item IBSCBS including gTribSN, and the monofásico group gIBSCBSMono), Imposto Seletivo and the totals groups (ISTot, IBSCBSTot) are modeled and XSD-validated against PL_010h_v1.03. Emitters without emit/IE (contribuinte exclusivo do IBS/CBS, NT 2026.007) are supported and authorized on SVRS. Diferimento, devolução, redução and Suframa subgroups are not yet modeled.


br__validate_nfe_xml

Validates an NF-e/NFC-e 4.00 XML document against the official PL_010d XSD, patched with the PL_010e_v.1.02 and PL_010f_v.1.04 deltas (local "unsigned" variant, see note below).

ParameterTypeRequiredDescription
xml_contentstringno*XML as a string
xml_base64stringno*Base64-encoded XML

* Exactly one of xml_content/xml_base64 must be provided.

Returns {"valid": bool, "errors": [...], "metadata": {"schema_version": ...}}.

[Inference]: the official XSD (nfe_v4.00.xsd/leiauteNFe_v4.00.xsd, PL_010d) requires <ds:Signature> as a mandatory child of <NFe>. Since Phase 1 generates unsigned documents, this tool validates against a local derived copy (nfe_v4.00_unsigned.xsd) where <ds:Signature> has been made optional (minOccurs="0"). Validation of signed documents (future phase) should use the official XSD without modifications.


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 number.

ParameterTypeRequiredDescription
c_ufstringyesIBGE state code (2 digits)
dh_emistringyesIssue date/time (ISO 8601)
cnpjstringyesIssuer CNPJ (numeric or alphanumeric PL_010d)
modelostringyes55 (NF-e) or 65 (NFC-e)
seriestringyesDocument series
nnfstringyesDocument number
tp_emisstringnoIssuance type (default "1")
c_nfstringnoRandom numeric code (cNF, 8 digits); auto-generated if omitted

Returns {"chave_acesso": ..., "cnf": ...}.

CT-e (modelo 57) tools

CT-e (Conhecimento de Transporte Eletrônico) coverage started at v0.6.0. v1 scope is intentionally narrow: modal rodoviário only (other modais raise an error), ICMS CST 00 (tributação normal) and 40/41/51 (ICMS45) only, and no bundled/verified SEFAZ CT-e endpoint table — every SEFAZ call below requires an explicit endpoint_override. Since v0.7.0, br__generate_cte also accepts the Reforma Tributária do Consumo (IBS/CBS) fields introduced by NT 2026.002 — imp/IBSCBS, emit/ISUFEmit, and ide/tpPagAnt+gPagAntecipado — with the NT's self-contained business rules enforced at the model layer; rules that require a live SEFAZ database lookup are not checked. Since v0.10.0 it also supports vPrest/vTPrestLiq, imp/vTotDFe, emit/tpRegimeIBSCBS, and imp/IBSCBS/gTribSN (NT 2026.004 v1.01 and NT 2026.005 v1.00); ide/gMultaJuros (NT 2026.004, with the stateless rules RV 1072, 1073 and 1078) and pgtoVinc (NT 2026.001) are supported since v0.13.0; the ICMS advance-payment group is not yet.

br__generate_cte

Generates an unsigned CT-e 4.00 document (<CTe><infCte>…</infCte></CTe>) from a BRCTeDocument object.

ParameterTypeRequiredDescription
cteobjectyesBRCTeDocument (modelo 57, modal rodoviário, ICMS CST 00/40/41/51)

Returns {"xml": ..., "chave_acesso": ..., "warnings": [...]}.

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> presence).

ParameterTypeRequiredDescription
xml_contentstringno*XML as a string
xml_base64stringno*Base64-encoded XML

* Exactly one of xml_content/xml_base64 must be provided.

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 pull.

br__submit_cte

Submits 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 (ConfirmationGate) and BR_CTE_READ_ONLY.

br__cancel_cte

Requests cancellation of an authorized CT-e (event 110111, CTeRecepcaoEventoV4). cStat=135 indicates the cancellation was homologated. Gated.

br__correct_cte

Issues 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.

Not yet implemented: br__distribute_cte_dfe (CTeDistribuicaoDFe) — the bundled specification confirms the request payload shape but not the webservice's method name, WSDL namespace, or message-wrapper element.

Architecture

mcp-nfe-br/├── src/│   └── mcp_nfe_br/│       ├── __init__.py│       ├── server.py              # MCP entry point and tool registration│       ├── models/│       │   ├── __init__.py│       │   └── invoice.py         # BRInvoice, BRInvoiceLine, NFeModelo, TipoOperacao│       ├── standards/│       │   ├── __init__.py│       │   └── nfe_generator.py   # NFeGenerator — generates unsigned NF-e/NFC-e 4.00│       ├── validators/│       │   ├── __init__.py│       │   └── nfe_xsd.py         # NFeXSDValidator — validates against PL_010d XSD (unsigned variant)│       ├── schemas/nfe/           # Bundled XSDs (official + "_unsigned" variants)│       ├── tools/│       │   ├── __init__.py│       │   ├── validation.py      # br__validate_cpf, br__validate_cnpj│       │   └── generation.py      # br__generate_nfe, br__validate_nfe_xml, br__build_access_key│       └── utils/│           ├── __init__.py│           ├── document_ids.py    # validate_cpf, validate_cnpj│           └── access_key.py      # build_access_key, access_key_check_digit├── tests/│   ├── conftest.py│   ├── fixtures/│   ├── test_tools/│   │   ├── test_validation.py│   │   └── test_generation.py│   ├── test_standards/│   │   └── test_nfe_generator.py│   ├── test_validators/│   │   └── test_nfe_xsd.py│   └── test_utils/│       └── test_access_key.py├── specs/nfe/                     # Normative material (XSDs, MOC, Technical Notes, not published)├── audit/│   ├── audit_vs_core.py│   └── report.json├── .github/workflows/publish.yml├── pyproject.toml├── RELEASE.md└── LICENSE

Relationship with mcp-einvoicing-core

mcp-einvoicing-core provides:

  • Base Pydantic models for invoices, parties, line items, and validation results (InvoiceDocument, InvoiceLineItem, TaxIdValidationResult)
  • Shared MCP server infrastructure (EInvoicingMCPServer)
  • HTTP/OAuth2 client, token cache, structured logging, exception hierarchy

mcp-nfe-br adds Brazil-specific logic:

  • BRInvoice (extends InvoiceDocument, as NF-e/NFC-e has no EN 16931 lineage)
  • Group I fields (NCM, CFOP, ICMS/IPI/PIS/COFINS) in BRInvoiceLine
  • CPF/CNPJ validation (including the alphanumeric CNPJ from NT 2026.004)

Vendor neutrality

This server implements the standard itself: it builds, validates, and signs the document locally. It is not a client for a commercial invoicing platform, and your signing keys and credentials never leave your own infrastructure.

Invoices go directly to SEFAZ (NF-e/NFC-e) and the CT-e SEFAZ endpoint with your own digital certificate; no intermediary is involved.

Contributing

Contributions are welcome. Please open an issue to discuss significant changes before submitting a pull request.

bash
git clone https://github.com/cmendezs/mcp-nfe-br.gitcd mcp-nfe-bruv sync --all-extrasuv run pytestuv run ruff check src/mcp_nfe_br tests audituv run mypy src/mcp_nfe_br

Other e-invoicing MCP servers

CountryServer
🌍 Globalmcp-einvoicing-core
🇧🇪 Belgiummcp-einvoicing-be
🇧🇷 Brazilmcp-nfe-br
🇫🇷 Francemcp-facture-electronique-fr
🇩🇪 Germanymcp-einvoicing-de
🇮🇳 Indiamcp-einvoicing-in
🇮🇹 Italymcp-fattura-elettronica-it
🇲🇽 Mexicomcp-cfdi-mx
🇵🇱 Polandmcp-ksef-pl
🇸🇬 Singaporemcp-invoicenow-sg
🇪🇸 Spainmcp-facturacion-electronica-es
🇦🇪 United Arab Emiratesmcp-einvoicing-ae

License

This project is licensed under Apache 2.0. See LICENSE for details. For the full version history, see CHANGELOG.md.

來源:README.md,提交 b4eb5e4

工具

22

br__validate_cnpj

Br Validate Cnpj

Validate a Brazilian CNPJ (company tax ID). Accepts both the legacy all-numeric form (14 digits) and the alphanumeric form introduced by NT 2026.004 / PL_010d (12 alphanumeric characters + 2 numeric check digits, production from 2026-07-01).

輸入參數cnpj必填

br__validate_cpf

Br Validate Cpf

Validate a Brazilian CPF (individual taxpayer ID).

輸入參數cpf必填

br__generate_nfe

Br Generate Nfe

Generate an unsigned NF-e/NFC-e XML (modelo 55/65, schema 4.00). The returned `<NFe><infNFe>…</infNFe></NFe>` document does not include `<Signature>` — sign it with `br__sign_nfe` before SEFAZ submission. SEFAZ webservice submission itself is not implemented in this phase. Returns a dict with: - ``xml``: the generated NF-e/NFC-e XML string - ``chave_acesso``: the computed 44-character access key (chNFe) - ``warnings``: list of non-fatal notices

輸入參數invoice必填

br__sign_nfe

Br Sign Nfe

Apply an ICP-Brasil enveloped XML-DSig signature to an NF-e/NFC-e XML. Signs `<infNFe>` per MOC 7.0 Table 4-2 (RSA-SHA1 / SHA-1, enveloped transform, `ds:Signature` appended as the last child of `<NFe>`) using `mcp_nfe_br.standards.nfe_signer.build_nfe_signer`. Only ICP-Brasil A1 (PKCS#12 file-based) certificates are supported. A3 (hardware token/HSM) certificates `[NEED: not modeled]`. Returns a dict with ``xml`` (the signed document) or ``error``.

輸入參數cert_path必填xml_base64xml_contentcert_password

br__validate_nfe_xml

Br Validate Nfe Xml

Validate an NF-e/NFC-e XML (modelo 55/65, schema 4.00) against the bundled PL_010d XSD. `NFeXSDValidator` selects the schema automatically: documents without a `<ds:Signature>` are validated against the unsigned derivative; signed documents (produced by `br__sign_nfe`) are validated against the unmodified official schema, which requires `<ds:Signature>`. Returns a dict with ``valid``, ``errors``, ``warnings``, and ``schema_version``.

輸入參數xml_base64xml_content

br__build_access_key

Br Build Access Key

Assemble and check-digit a 44-character NF-e/NFC-e access key (chNFe). Returns a dict with ``chave_acesso`` (44 characters) and ``cnf`` (the 8-digit random code used, whether provided or generated).

輸入參數nnf必填c_nfc_uf必填cnpj必填serie必填dh_emi必填modelo必填tp_emis

br__submit_nfe

Br Submit Nfe

Submete um NF-e/NFC-e assinado à autorização SEFAZ (`NFeAutorizacao4`, síncrono). Submissão para SEFAZ é uma operação irreversível em produção e exige confirmação em duas etapas (`ConfirmationGate`). Define `BR_READ_ONLY=1` para desabilitar esta ferramenta. NF-e modelo 55 sem `emit/IE` (contribuinte exclusivo do IBS/CBS) é roteada automaticamente para a SVRS, a única autorizadora permitida (NT 2026.007, regra C17-11), independentemente de `c_uf`. Retorna `protNFe` (incluindo `nProt`, o `protocolo de autorização`) em caso de sucesso, ou `error`.

輸入參數c_uf必填tp_ambid_lote必填cert_path必填xml_base64xml_contentcert_passwordendpoint_overrideconfirmation_token

br__consult_sefaz_status

Br Consult Sefaz Status

Consulta a disponibilidade do webservice SEFAZ (`NFeStatusServico4`). Read-only — não requer confirmação. Retorna `cStat`/`xMotivo` (`cStat=107` indica serviço em operação `[Unverified]`).

輸入參數c_uf必填tp_ambcert_path必填cert_passwordendpoint_overridecontribuinte_exclusivo_ibs_cbs

br__distribute_dfe

Br Distribute Dfe

Consulta/distribui DF-e via `NFeDistribuicaoDFe` (`NT2014.002_v1.30`, `[Verified locally]`). Exatamente um de `ult_nsu`, `nsu`, ou `ch_nfe` deve ser informado, selecionando `distNSU`, `consNSU`, ou `consChNFe` respectivamente. Esta ferramenta consulta dados fiscais de terceiros vinculados ao certificado e requer confirmação em duas etapas. Define `BR_READ_ONLY=1` para desabilitar.

輸入參數nsuch_nfetp_ambult_nsucert_path必填c_uf_autor必填document_id必填cert_passworddocument_id_typeendpoint_overrideconfirmation_token

br__generate_nfse

Br Generate Nfse

Gerar um DPS não assinado para NFS-e Nacional (ADN), schema v1.01. O DPS (Declaração de Prestação de Serviços) gerado não contém ``<ds:Signature>`` — assine-o com ``br__sign_nfse`` antes de submeter ao ADN via ``br__submit_nfse``. Returns a dict with: - ``xml``: the generated unsigned DPS XML string - ``dps_id``: the 45-character DPS Id (``infDPS Id`` attribute) - ``warnings``: list of non-fatal notices

輸入參數dps必填

br__sign_nfse

Br Sign Nfse

Aplicar assinatura XML-DSig ICP-Brasil ao DPS da NFS-e Nacional. Assina o elemento ``<infDPS>`` com enveloped ``ds:Signature`` adicionada como último filho de ``<DPS>``, usando ``mcp_nfe_br.standards.nfse_signer.build_nfse_signer``. Algoritmo: RSA-SHA1 (padrão XMLDSigSigner). `[Unverified para NFS-e Nacional — confirme no manual ADN antes de usar em produção.]` Somente certificados A1 (PKCS#12 em arquivo) são suportados. A3 (hardware token/HSM) `[NEED: não modelado]`. Returns a dict with ``xml`` (the signed DPS) or ``error``.

輸入參數cert_path必填xml_base64xml_contentcert_password

br__validate_nfse_xml

Br Validate Nfse Xml

Validar um DPS ou NFSe contra o XSD v1.01 do ADN. Seleciona automaticamente o schema com base no elemento raiz: - ``<DPS>`` → valida contra ``DPS_v1.01.xsd`` (``<ds:Signature>`` opcional) - ``<NFSe>`` → valida contra ``NFSe_v1.01.xsd`` (``<ds:Signature>`` obrigatória) Returns a dict with ``valid``, ``errors``, ``warnings``, and ``schema_version``.

輸入參數xml_base64xml_content

br__submit_nfse

Br Submit Nfse

Submeter um DPS assinado ao ADN para geração da NFS-e Nacional. Submissão ao ADN é uma operação irreversível em produção e exige confirmação em duas etapas (``ConfirmationGate``). Defina ``BR_READ_ONLY=1`` para desabilitar esta ferramenta. `[Unverified — endpoint ADN, formato de requisição e resposta são inferidos de fontes secundárias. Verifique no manual ADN antes do uso em produção.]` Retorna campos de status do ADN (``cStat``, ``xMotivo``) e opcionalmente o XML da NFS-e gerada (``nfse_xml``).

輸入參數scopetp_ambclient_id必填xml_base64xml_contentclient_secret必填endpoint_overrideconfirmation_token

br__consult_nfse_status

Br Consult Nfse Status

Consultar o status de uma NFS-e pelo chave de acesso (chNFSe). Read-only, não requer confirmação. `[Unverified — endpoint e formato de resposta são inferidos.]`

輸入參數scopetp_ambch_nfse必填client_id必填client_secret必填endpoint_override

br__cancel_nfse

Br Cancel Nfse

Solicitar cancelamento de uma NFS-e no ADN. Cancelamento é uma operação irreversível e exige confirmação em duas etapas (``ConfirmationGate``). Defina ``BR_READ_ONLY=1`` para desabilitar. `[Unverified — endpoint e formato de requisição são inferidos.]`

輸入參數scopemotivo必填tp_ambch_nfse必填client_id必填client_secret必填endpoint_overrideconfirmation_token

br__generate_cte

Br Generate Cte

Generate an unsigned CT-e XML (modelo 57, schema 4.00). v1 supports modal rodoviário only and ICMS CST 00 (tributação normal) only — other modais/CSTs raise an error. The returned `<CTe><infCte>…</infCte></CTe>` document does not include `<Signature>` — sign it with `br__sign_cte` (roadmap BR-CTE-6 factory, tool not yet registered) before SEFAZ submission. Returns a dict with: - ``xml``: the generated CT-e XML string - ``chave_acesso``: the computed 44-character access key (chCTe) - ``warnings``: list of non-fatal notices

輸入參數cte必填

br__validate_cte_xml

Br Validate Cte Xml

Validate a CT-e XML (modelo 57, schema 4.00) against the bundled PL_CTe_400 XSD. `CTeXSDValidator` selects the schema automatically: documents without a `<ds:Signature>` are validated against the unsigned derivative; signed documents are validated against the unmodified official schema, which requires `<ds:Signature>`. Returns a dict with ``valid``, ``errors``, ``warnings``, and ``schema_version``.

輸入參數xml_base64xml_content

br__consult_cte_sefaz_status

Br Consult Cte Sefaz Status

Consulta a disponibilidade do webservice SEFAZ CT-e (`CTeStatusServicoV4`). Read-only — não requer confirmação. Nenhuma URL de endpoint CT-e está embutida/verificada nesta versão — `endpoint_override` é obrigatório (ver `mcp_nfe_br.standards.sefaz_cte_client` docstring). Retorna `cStat`/`xMotivo` (`cStat=107` indica serviço em operação `[Unverified]`, mesmo código do padrão NF-e).

輸入參數c_uf必填tp_ambcert_path必填cert_passwordendpoint_override必填

br__consult_cte

Br Consult Cte

Consulta a situação de um CT-e por chave de acesso (`CTeConsultaV4`). Read-only — não requer confirmação (consulta um CT-e específico e já conhecido pela chave de acesso, não um lote de dados fiscais de terceiros — diferente de `br__distribute_dfe` no NF-e). Nenhuma URL de endpoint CT-e está embutida/verificada nesta versão — `endpoint_override` é obrigatório. Retorna `cStat`/`xMotivo`/`protCTe` (quando aplicável) ou `error`.

輸入參數c_uf必填ch_cte必填tp_ambcert_path必填cert_passwordendpoint_override必填

br__submit_cte

Br Submit Cte

Submete um CT-e assinado à autorização SEFAZ (`CTeRecepcaoSincV4`, síncrono). O payload é automaticamente compactado em GZip e codificado em Base64 antes do envio, conforme exigido pelo MOC CT-e §3.4.1 `[Verified locally]`. Submissão para SEFAZ é uma operação irreversível em produção e exige confirmação em duas etapas (`ConfirmationGate`). Define `BR_CTE_READ_ONLY=1` para desabilitar esta ferramenta. Nenhuma URL de endpoint CT-e está embutida/verificada nesta versão — `endpoint_override` é obrigatório. Retorna `protCTe` (incluindo `nProt`, o `protocolo de autorização`) em caso de sucesso, ou `error`.

輸入參數c_uf必填tp_ambcert_path必填xml_base64xml_contentcert_passwordendpoint_override必填confirmation_token

br__cancel_cte

Br Cancel Cte

Solicita o cancelamento de um CT-e autorizado (evento `110111`, `CTeRecepcaoEventoV4`). Constrói, assina (`build_cte_event_signer`, alvo `infEvento`) e submete o evento de cancelamento. `cStat=135` indica cancelamento homologado `[Verified locally]` — MOC CT-e Visão Geral v4.00 §6.2.2. Cancelamento é uma operação irreversível em produção e exige confirmação em duas etapas (`ConfirmationGate`). Define `BR_CTE_READ_ONLY=1` para desabilitar. `endpoint_override` é obrigatório — nenhuma URL de endpoint CT-e está embutida/verificada nesta versão. Retorna `cStat`/`xMotivo` ou `error`.

輸入參數cnpj必填ch_cte必填n_prot必填tp_ambx_just必填c_orgao必填cert_path必填dh_evento必填cert_passwordendpoint_override必填confirmation_token

br__correct_cte

Br Correct Cte

Emite uma Carta de Correção Eletrônica para um CT-e (evento `110110`, `CTeRecepcaoEventoV4`). Constrói, assina (`build_cte_event_signer`, alvo `infEvento`) e submete o evento de CC-e. `cStat=135` indica CC-e homologada `[Verified locally]` — MOC CT-e Visão Geral v4.00 §6.4. Por força do Art. 58-B do CONVÊNIO/SINIEF 06/89, a CC-e não pode alterar valores de impostos, dados cadastrais das partes, ou a data de emissão/saída. Exige confirmação em duas etapas (`ConfirmationGate`). Define `BR_CTE_READ_ONLY=1` para desabilitar. `endpoint_override` é obrigatório. Retorna `cStat`/`xMotivo` ou `error`.

輸入參數cnpj必填ch_cte必填tp_ambc_orgao必填cert_path必填correcoes必填dh_evento必填cert_passwordendpoint_override必填confirmation_token

版本歷史

5
  1. v0.13.0最新Nov 21, 2026
  2. v0.11.1Nov 21, 2026
  3. v0.11.0Nov 16, 2026
  4. v0.10.0Nov 16, 2026
  5. v0.9.1Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分