# Brazil NF-e XML Auditor & Key Engine (x402)

> SEFAZ 4.00 NF-e/NFC-e XML audit, ~90% token compression & Mod-11 key decoder via x402 Base USDC.

- name: io.github.brunopompeo1/br-nfe-xml-auditor-x402
- version: 2.7.1
- connection class: R0 (autonomous)
- trust: 92/100 flags: duplicate-repo
- quality: 89/100 (good)
- charges per call: the server says so (`` audit_cbs_ibs_credit_items ``, `` audit_nfe_xml ``, `` audit_nfe_xml_batch ``)
- owner: not claimed
- descriptor: https://api.protogrid.dev/v1/servers/io.github.brunopompeo1%2Fbr-nfe-xml-auditor-x402
- tools: https://api.protogrid.dev/v1/servers/io.github.brunopompeo1%2Fbr-nfe-xml-auditor-x402/tools

**An agent can connect right now, no human step.** Remote endpoint, no authentication, reachable on the last probe.

## Connection (mcpServers)

```json
{
  "mcpServers": {
    "br-nfe-xml-auditor-x402": {
      "type": "http",
      "url": "https://br-nfe-xml-auditor-x402.architect-x402.workers.dev/mcp"
    }
  }
}
```


## Trust

- hygiene: 80
- liveness: 98
- freshness: 100
- provenance: 90
- drivers: +repository +namespace-matches-repo +website +reachable +uptime-96% +updated-4d-ago -duplicate-repo(13 names)
- Derived from observable signals (official registry feed and our own credential-free probes); no code audit performed.

## Quality 89/100 (good)

### protocol: 75 (weight 25)

- warn `protocol.modern`: newest supported version is 2025-06-18; 2026-07-28 not supported, older versions are deprecated until 2027-07-28
- n/a `protocol.stateless`: only applies to 2026-07-28 servers
- pass `protocol.transport`: streamable HTTP
- n/a `protocol.list_ttl`: only applies to 2026-07-28 servers

### authorization: n/a (weight 15)

- n/a `auth.prm`, `auth.as_metadata`, `auth.cimd`: no remote uses OAuth
- n/a `auth.secret_in_url`: no templated URL

### tool hygiene: 94 (weight 30)

- pass `tools.descriptions`: every tool has a description
- warn `tools.description_length`: 3 tools have descriptions over 1,024 characters, which crowds the context
- pass `tools.schemas`: every tool has an object input schema
- pass `tools.annotations`: 3 of 3 tools declare readOnlyHint or destructiveHint
- pass `tools.directory_hints`: every tool declares readOnlyHint, destructiveHint, idempotentHint and openWorldHint
- pass `tools.token_cost`: about 2,503 tokens to load every tool
- pass `tools.api_dump`: tools are not a one-to-one API dump
- pass `tools.hidden_text`: no hidden text in tool names, descriptions, schemas or annotations
- pass `tools.poisoning`: no instructions aimed at the model in tool definitions

### stability: 100 (weight 15)

- pass `stability.changes`: 5 tool changes in 30 days
- pass `stability.rug_pull`: no tool changed its meaning under the same name
- pass `stability.new_links`: no tool change named a new site

### dependencies: n/a (weight 15)

- n/a `deps.known_vulns`, `deps.mcp_sdk_version`, `deps.resolvable`: no npm or PyPI package

- tools: 3, about 2,503 tokens to load them all
- tool set hash: 64ca76a9886acefdc4f69d543bd5103e
- tools last changed: 2026-11-25T11:57:08.336Z
- badge: [![protogrid quality](https://protogrid.dev/badge/io.github.brunopompeo1/br-nfe-xml-auditor-x402.svg)](https://protogrid.dev/servers/io.github.brunopompeo1/br-nfe-xml-auditor-x402)
- Checks run on what our credential-free, read-only probes observe; tools are never called and no code audit is performed.

### Definition changes

- 2026-11-25 `br_nfe_xml_auditor` removed
  - Brazilian NF-e/NFC-e XML-to-JSON compressor (~90% token savings), mathematical & CFOP tax auditor, 44-digit Access Key Mod-11 decoder, and LC 214/2025 CBS/IBS Tax Credit Auditor (single XML, batch xmls[], or direct items[]) with ready-to-send supplierAlert (0.01 USDC via x402 on Base).
- 2026-11-25 `audit_cbs_ibs_credit_items` added
  - Audits the CBS and IBS tax credit of up to 100 purchase or fleet items given as plain JSON, for when there is no XML at hand, such as an ERP export or a spreadsheet: for each item it finds the expected rate in the official RFB classification tables by NCM or cClassTrib for the reference year, compares it with the CBS and IBS the supplier highlighted, and returns the credit at risk and overcharged tax in reais, projections to 2027 and 2033 and a supplier alert with a ready e-mail draft. Use it for procurement and fleet cost reviews and to quantify the cash impact of the tax reform on a supplier. Do not use it when you have the invoice XML, which audit_nfe_xml audits more completely, or to compute ICMS, IPI or PIS/COFINS, which are not covered. Read 'rtcCreditAudit' and 'supplierAlert'. Costs 0.010 USDC per call, paid with x402 v2 on Base (eip155:8453), a B2B X-API-Key or a Wafermap marketplace signature; an unpaid call returns HTTP 402 with a PAYMENT-REQUIRED header instead of an exception, and every failure is a JSON body with 'error', so an agent loop never breaks on a thrown error. Pure parsing and arithmetic at the edge: the XML is not stored, SEFAZ is not queried (authorisation is read from the protocol embedded in the XML) and no e-mail is sent.
- 2026-11-25 `audit_nfe_xml_batch` added
  - Audits a batch of up to 25 Brazilian NF-e or NFC-e XMLs in one paid call and returns one compact audit per invoice plus batch totals: total invoiced, number of invoices with credit risk, total CBS/IBS credit at risk and overcharged tax in reais, the 2027 projection, a severity breakdown and one supplier alert per invoice that needs action. Use it for a monthly purchase-ledger review, a supplier compliance sweep before the CBS/IBS transition, or any time several invoices would otherwise mean several calls. Do not use it when you need the full detail of one invoice, such as its items, which audit_nfe_xml returns, and do not send more than 25 XMLs: extras are ignored and 'truncatedAtMax25' turns true. An XML that fails to parse is reported in its own entry instead of failing the batch. Read 'batchSummary' and 'supplierAlerts'. Costs 0.010 USDC per call, paid with x402 v2 on Base (eip155:8453), a B2B X-API-Key or a Wafermap marketplace signature; an unpaid call returns HTTP 402 with a PAYMENT-REQUIRED header instead of an exception, and every failure is a JSON body with 'error', so an agent loop never breaks on a thrown error. Pure parsing and arithmetic at the edge: the XML is not stored, SEFAZ is not queried (authorisation is read from the protocol embedded in the XML) and no e-mail is sent.
- 2026-11-25 `audit_nfe_xml` added
  - Parses one Brazilian NF-e (model 55) or NFC-e (model 65) XML in SEFAZ layout 4.00, including the 2025 tax-reform <IBSCBS> group, into compact JSON with about 90% fewer tokens, then audits it: checks that items, freight, discounts and taxes add up to the invoice total, that CFOPs fit an in-state or interstate operation, that the access key passes Mod-11 and that the embedded SEFAZ protocol says authorised; and, under LC 214/2025, compares the CBS and IBS highlighted per item with the official rates to compute the credit at risk in reais and draft a supplier alert. Use it when an agent receives a purchase invoice to book, pay or reconcile, or must answer questions about one without spending tokens on raw XML. Do not use it for a batch of invoices, which is audit_nfe_xml_batch, for an NFS-e service invoice, whose XML is different, or to confirm the current status at SEFAZ, since a later cancellation does not appear in the XML. Read 'auditReport', then 'rtcCreditAudit' and 'supplierAlert'. Costs 0.010 USDC per call, paid with x402 v2 on Base (eip155:8453), a B2B X-API-Key or a Wafermap marketplace signature; an unpaid call returns HTTP 402 with a PAYMENT-REQUIRED header instead of an exception, and every failure is a JSON body with 'error', so an agent loop never breaks on a thrown error. Pure parsing and arithmetic at the edge: the XML is not stored, SEFAZ is not queried (authorisation is read from the protocol embedded in the XML) and no e-mail is sent.
- 2026-11-22 `br_nfe_xml_auditor` changed (description, inputSchema)
  - before: Brazilian NF-e/NFC-e XML-to-JSON compressor (~90% token savings), mathematical & CFOP tax auditor, and 44-digit Access Key Mod-11 decoder (0.01 USDC via x402 on Base).
  - after: Brazilian NF-e/NFC-e XML-to-JSON compressor (~90% token savings), mathematical & CFOP tax auditor, 44-digit Access Key Mod-11 decoder, and LC 214/2025 CBS/IBS Tax Credit Auditor (single XML, batch xmls[], or direct items[]) with ready-to-send supplierAlert (0.01 USDC via x402 on Base).

Full history: https://api.protogrid.dev/v1/servers/io.github.brunopompeo1%2Fbr-nfe-xml-auditor-x402/changes

## Remotes

- https://br-nfe-xml-auditor-x402.architect-x402.workers.dev/mcp (streamable-http, auth none, reachable true, uptime30d 0.9607843)

## Packages

_none_

## Tools (3)

- `audit_cbs_ibs_credit_items`: Audits the CBS and IBS tax credit of up to 100 purchase or fleet items given as plain JSON, for when there is no XML at hand, such as an ERP export or a spreadsheet: for each item it finds the expected rate in the official RFB classification tables by NCM or cClassTrib for the reference year, compares it with the CBS and IBS the supplier highlighted, and returns the credit at risk and overcharged tax in reais, projections to 2027 and 2033 and a supplier alert with a ready e-mail draft. Use it for procurement and fleet cost reviews and to quantify the cash impact of the tax reform on a supplier. Do not use it when you have the invoice XML, which audit_nfe_xml audits more completely, or to compute ICMS, IPI or PIS/COFINS, which are not covered. Read 'rtcCreditAudit' and 'supplierAlert'. Costs 0.010 USDC per call, paid with x402 v2 on Base (eip155:8453), a B2B X-API-Key or a Wafermap marketplace signature; an unpaid call returns HTTP 402 with a PAYMENT-REQUIRED header instead of an exception, and every failure is a JSON body with 'error', so an agent loop never breaks on a thrown error. Pure parsing and arithmetic at the edge: the XML is not stored, SEFAZ is not queried (authorisation is read from the protocol embedded in the XML) and no e-mail is sent.
- `audit_nfe_xml`: Parses one Brazilian NF-e (model 55) or NFC-e (model 65) XML in SEFAZ layout 4.00, including the 2025 tax-reform <IBSCBS> group, into compact JSON with about 90% fewer tokens, then audits it: checks that items, freight, discounts and taxes add up to the invoice total, that CFOPs fit an in-state or interstate operation, that the access key passes Mod-11 and that the embedded SEFAZ protocol says authorised; and, under LC 214/2025, compares the CBS and IBS highlighted per item with the official rates to compute the credit at risk in reais and draft a supplier alert. Use it when an agent receives a purchase invoice to book, pay or reconcile, or must answer questions about one without spending tokens on raw XML. Do not use it for a batch of invoices, which is audit_nfe_xml_batch, for an NFS-e service invoice, whose XML is different, or to confirm the current status at SEFAZ, since a later cancellation does not appear in the XML. Read 'auditReport', then 'rtcCreditAudit' and 'supplierAlert'. Costs 0.010 USDC per call, paid with x402 v2 on Base (eip155:8453), a B2B X-API-Key or a Wafermap marketplace signature; an unpaid call returns HTTP 402 with a PAYMENT-REQUIRED header instead of an exception, and every failure is a JSON body with 'error', so an agent loop never breaks on a thrown error. Pure parsing and arithmetic at the edge: the XML is not stored, SEFAZ is not queried (authorisation is read from the protocol embedded in the XML) and no e-mail is sent.
- `audit_nfe_xml_batch`: Audits a batch of up to 25 Brazilian NF-e or NFC-e XMLs in one paid call and returns one compact audit per invoice plus batch totals: total invoiced, number of invoices with credit risk, total CBS/IBS credit at risk and overcharged tax in reais, the 2027 projection, a severity breakdown and one supplier alert per invoice that needs action. Use it for a monthly purchase-ledger review, a supplier compliance sweep before the CBS/IBS transition, or any time several invoices would otherwise mean several calls. Do not use it when you need the full detail of one invoice, such as its items, which audit_nfe_xml returns, and do not send more than 25 XMLs: extras are ignored and 'truncatedAtMax25' turns true. An XML that fails to parse is reported in its own entry instead of failing the batch. Read 'batchSummary' and 'supplierAlerts'. Costs 0.010 USDC per call, paid with x402 v2 on Base (eip155:8453), a B2B X-API-Key or a Wafermap marketplace signature; an unpaid call returns HTTP 402 with a PAYMENT-REQUIRED header instead of an exception, and every failure is a JSON body with 'error', so an agent loop never breaks on a thrown error. Pure parsing and arithmetic at the edge: the XML is not stored, SEFAZ is not queried (authorisation is read from the protocol embedded in the XML) and no e-mail is sent.
