mx-fiscal-mcp-server
Summary: This server gives an AI agent read-only Mexican tax and banking capabilities — validating RFC/CURP/CLABE/NSS, reading and checking CFDI 4.0 invoices against the SAT, and looking up SAT code tables — with no API keys, CSD or PAC.
Validate identifiers with real check digits —
validate_rfc(12/13 chars, modulus-11, splits initials/date/homoclave/digit),validate_curp(base-37 check digit, decodes birth date, sex, RENAPO state, century marker),validate_clabe(3-7-1 control digit, names the Banxico bank),validate_nss(Luhn digit, splits subdelegación/registration year/birth year/serial).Handle the SAT generics correctly —
XAXX010101000is reported asis_genericwhilecheck_digit_satisfiedis false;XEXX010101000satisfies it.Generate coherent fake test data —
generate_test_dataproduces 1–100 people or companies whose RFC and CURP derive from the same name/birth date, with valid CLABE, NSS and check digits.Parse a CFDI 4.0 invoice —
parse_cfditurns XML into JSON (header, issuer, receiver, line items with transferred/withheld taxes, totals, Timbre Fiscal Digital), labels every catalogue code, validates both RFCs and checks the totals arithmetic (4.0 and 3.3; Pagos/Nómina complements partially; Retenciones refused).Ask the SAT whether an invoice is live —
cfdi_statusqueries the public ConsultaCFDIService SOAP endpoint (by XML or by the four key fields) and returns Estado, EsCancelable, EstatusCancelación and ValidaciónEFOS with plain-language meanings; fail-soft (available: false, never throws), 10 s timeout, one retry.Look up SAT code tables offline —
sat_catalog_lookupsearches nine bundled catalogues (regimen_fiscal, uso_cfdi, forma_pago, metodo_pago, tipo_comprobante, objeto_imp, impuestos, bancos_clabe, estados_curp) by exact code or accent-insensitive text.Access bundled resources and prompts — the
mx-fiscal://catalogsindex andmx-fiscal://catalog/<name>resources, plusreview_cfdi,validate_identifiersandseed_test_dataprompts.Choose output format — every tool returns human-readable Markdown by default or JSON via
response_format="json", with structured content and findings.Stay honest about limits — structural validity is not registration, parsing is not signature verification, an unreachable SAT is not an invalid invoice, the bank list is a subset, and only two tools touch the network.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mx-fiscal-mcp-server is RFC XAXX010101000 valid? it looks off to me"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mx-fiscal-mcp-server
An MCP server that gives an AI agent Mexican tax and banking capabilities — validate RFC, CURP, CLABE and NSS with real check digits, read a CFDI 4.0 invoice, ask the SAT whether it is still live, and look up the SAT's code tables. No API keys, no CSD certificate, no PAC contract.
Ask Claude "read this invoice and tell me whether it's still valid" and it parses the XML, labels every SAT code, checks both RFCs and the arithmetic, and queries the SAT's public status service — instead of you opening three web tools.
> Read this CFDI and check it at the SAT
parse_cfdi(xml="<cfdi:Comprobante …>")
CFDI A-1042 — 1160.00 MXN
✅ Stamped · version 4.0 · Ingreso
Emisor: TES150312DX2 ✅ 601 — General de Ley Personas Morales
Receptor: PELJ900521DK2 ✅ G03 — Gastos en general
✅ Totals add up: subtotal − discount + transferred − withheld = total
cfdi_status(xml="<cfdi:Comprobante …>")
CFDI status — Vigente
✅ The invoice exists in the SAT's records and has not been cancelled.
Es cancelable: Cancelable con aceptación
EFOS: returned 200 — the issuer is NOT on the SAT's definitive 69-B list.Why this exists
Mexican electronic invoicing has two halves, and only one of them was served.
Building and stamping a CFDI needs a CSD certificate and a contract with a PAC.
That half already has tooling — mcp-cfdi-mx
(Python) does it, and this server deliberately does not compete with it.
Reading is the other half, and it needs nothing: the check-digit algorithms are
public, the SAT's catalogues are public, and the invoice status service behind the QR
code on every printed invoice is public and unauthenticated. Yet an agent asked to
validate an RFC will happily invent a regex that rejects XAXX010101000 — the RFC of
every invoice issued to the general public — because that one does not satisfy its own
check digit. This server is the read half, done carefully.
The arithmetic comes from mx-identifiers
(MIT, zero dependencies, 101 tests against public vectors); the CFDI reader is ported
from the tool running at ortamarco.me;
the SOAP envelope was read out of nodecfdi/sat-estado-cfdi
rather than guessed. It is the third of three read-only, key-free MCP servers alongside
domain-security-mcp-server
and seo-geo-mcp-server.
Related MCP server: mcp-latam-validate
Tools
Identifiers
Tool | What it does |
| RFC for individuals (13 chars) and companies (12), full modulus-11 check digit, parsed fields, birth/incorporation date. Flags the SAT generics and says which of them satisfies the arithmetic |
| 18-character CURP with the base-37 check digit; decodes birth date, sex, state (RENAPO keys, not INEGI/ISO) and the century marker |
| 18-digit CLABE with the correct 3-7-1 control digit — each weighted product counts only its last digit ( |
| 11-digit IMSS number with its Luhn digit, split into subdelegación / registration year / birth year / serial |
| 1-100 coherent fake people or companies: the RFC and CURP derive from the same name and birth date, the CLABE's bank is a real participant, every check digit holds |
CFDI
Tool | What it does |
| CFDI XML → JSON: header, issuer, receiver, every line item with transferred and withheld taxes, tax totals, and the Timbre Fiscal Digital (or |
| Queries the SAT's public |
| Up to 25 invoices through the same service, built to be gentle on it: two requests in flight at most, duplicates asked once, answers cached in memory for 10 minutes (an outage never is), and no new request once two in a row have failed. Bad items are reported one by one and cost no request |
Catalogues
Tool | What it does |
| Nine bundled code tables — |
Every tool is read-only, declares an outputSchema and returns structuredContent
(validated by the SDK) alongside human-readable Markdown (default) or JSON
(response_format="json"). Only cfdi_status and cfdi_batch_status are annotated
openWorldHint: true: they are the two that reach the network.
Resources and prompts
Kind | Name | What it is |
Resource |
| Index of the nine bundled code tables |
Resource |
| One table ( |
Prompt |
| Parse an invoice, check it at the SAT, report both honestly |
Prompt |
| Classify and validate a mixed list of RFC / CURP / CLABE / NSS |
Prompt |
| Generate valid fake people or companies for a seed file |
Honesty notes
These are surfaced in the tool output, not buried here:
Structurally valid is not registered. A check digit that adds up says the string is well-formed and nothing more. Only the SAT can say an RFC is registered; only RENAPO that a CURP belongs to a person. This server never asks either, and its wording never implies it did.
XAXX010101000does not satisfy its own check digit. The SAT assigned the general-public RFC by decree and the modulus-11 algorithm asks for a4where the SAT wrote a0.XEXX010101000(foreign residents) does satisfy it. The tools reportis_genericandcheck_digit_satisfiedas separate fields rather than collapsing both into "valid".Reading a CFDI is not verifying it.
parse_cfdidoes not check the digital signature. A perfectly parseable invoice can be cancelled, or fabricated wholesale.An unreachable SAT is not an invalid invoice. The status endpoint publishes no SLA and no status page, and it goes down. Its documentation states capacity for up to 2 million queries per hour and asks callers not to raise their query volume, since every query reads the SAT's transactional databases.
cfdi_statusdegrades toavailable: falsewith the reason — a statement about the SAT, never about the document.The bank list is a subset.
bancos_clabecarries the main Banxico participants, not the full catalogue; an unknown code is reported as unknown rather than given an invented name. The plaza catalogue is not bundled at all, so the plaza code is returned verbatim.EFOS codes are read from the SAT's own table. The SAT documents
ValidacionEFOSin its Documentación del Servicio de Consulta de CFDI v1.4, section 3:100,101and104put the issuer on the definitive 69-B list;102and103mean the issuer is not on it but a third-party RFC the invoice was issued on behalf of (a cuenta de terceros) is;200and201mean the issuer is not on it (201: nor any third party).efos_statespeaks of the issuer only, andefos_third_party_state(listed/not_listed/not_reported/unknown) of the third parties. An empty field or an undocumented code is reported asunknownwith the raw code kept invalidacion_efos, never as "listed". Versions up to 1.0.1 reported102and103as an issuer on the list; 1.0.2 fixes it.Bineo CLABEs (bank 165). 1.0.3 requires
mx-identifiers^1.0.1, which carries the fix for them.
Protocol
Built on the v2 MCP SDK, so it speaks the 2026-07-28 revision (server/discover,
no initialize, per-request _meta envelope) and still serves 2025-era clients —
Claude Desktop, Claude Code and Cursor — from the same server factory. The entry points
own the era decision: serveStdio(factory) on stdio, createMcpHandler(factory) over
HTTP with the default legacy: 'stateless'. There is no session state and no
Mcp-Session-Id in either direction. npm run smoke exercises every tool on both
eras and asserts the negotiated era of each connection.
Because the tool list is a compile-time constant, tools/list and server/discover
advertise a real one-hour ttlMs with cacheScope: 'public' on 2026-era connections
instead of the SDK's conservative ttlMs: 0.
Install
Requires Node.js 20+. Nothing to clone — every MCP client can run it with npx.
Use it with Claude Code
claude mcp add mx-fiscal -- npx -y mx-fiscal-mcp-serverAdd --scope user (all your projects) or --scope project (writes a shared .mcp.json) before the --; the default is local to the current project.
Use it with Claude Desktop
Open Settings → Developer → Edit Config and add to claude_desktop_config.json — see examples/:
{
"mcpServers": {
"mx-fiscal": {
"command": "npx",
"args": ["-y", "mx-fiscal-mcp-server"]
}
}
}On Windows use "command": "cmd" with "args": ["/c", "npx", "-y", "mx-fiscal-mcp-server"].
Restart the client, then ask: "Generate 10 Mexican customers with valid RFC and CURP for my seed file."
Use it with Cursor
The same JSON block goes in ~/.cursor/mcp.json (every project) or .cursor/mcp.json (this project only).
Use it with Codex
codex mcp add mx-fiscal -- npx -y mx-fiscal-mcp-serveror in ~/.codex/config.toml (a project-scoped .codex/config.toml also works):
[mcp_servers.mx-fiscal]
command = "npx"
args = ["-y", "mx-fiscal-mcp-server"]Self-host (HTTP transport)
The same server speaks stateless Streamable HTTP for remote or multi-client use.
TRANSPORT=http npx -y mx-fiscal-mcp-server
# POST JSON-RPC to http://127.0.0.1:3000/mcp · health at /healthzIt is safe by default: it binds to 127.0.0.1 and only accepts localhost
Host and Origin headers, which blocks DNS-rebinding attacks from a web page.
To expose it — for example behind Coolify or Traefik — opt in explicitly:
Variable | Default | Purpose |
|
|
|
|
| Listening port, 1-65535; anything else stops the server with a one-line message |
|
| Bind address; |
| — | Comma-separated hostnames the |
| — | Comma-separated origins allowed to call from a browser |
| — | If set, every request needs |
|
| Largest CFDI accepted, in characters |
|
|
|
No CORS headers are ever sent, so a web page cannot read its responses cross-origin; ALLOWED_ORIGINS only decides which Origin headers are let through to the handler (a request without one, as from an MCP client, always is). The request body is capped at about 1.25× MAX_XML_CHARS.
A self-hosted instance makes requests to the SAT on its callers' behalf, so do
not expose it without MCP_AUTH_TOKEN: an open one is a free relay that can get
your IP rate-limited. With Docker (the image sets HOST=0.0.0.0):
docker build -t mx-fiscal-mcp .
docker run -p 3000:3000 -e ALLOWED_HOSTS=mcp.example.com -e MCP_AUTH_TOKEN=change-me mx-fiscal-mcpDevelop
npm run dev # tsx watch (stdio)
npm run typecheck # tsc --noEmit
npm test # deterministic offline unit tests, HTTP transport defaults included
npm run smoke # every tool over the real protocol, on BOTH eras (queries the SAT)
node scripts/smoke-all.mjs --offline # the same, minus the calls that reach the SAT
npm run inspect # MCP Inspector against the built server
npm run build # type-check + emit dist/How it works
src/
├── index.ts # transport selection: serveStdio | createMcpHandler + Express
├── server.ts # the server FACTORY — registers every tool, holds the instructions
├── schemas.ts # Zod 4 outputSchema for each tool
├── constants.ts # the single external host, timeouts, limits
├── format.ts # markdown/JSON response shaping, findings
├── core/ # pure logic, no MCP coupling — reusable & testable
│ ├── identifiers.ts # reporting layer over mx-identifiers (errors, labels, findings)
│ ├── cfdi.ts # the CFDI 4.0 reader, ported 1:1 from the web tool
│ ├── sat.ts # SOAP envelope, expression builder, response interpretation
│ ├── catalogs.ts # the nine code tables + lookup
│ └── testdata.ts # fixture generation
└── tools/ # thin MCP wrappers (Zod schemas, descriptions, formatting)The core/ layer carries no MCP types, so the same logic backs both this server and a
web UI. All the check-digit arithmetic lives in mx-identifiers and is not
reimplemented here.
Network surface: exactly one host, consultaqr.facturaelectronica.sat.gob.mx,
hardcoded in constants.ts. No tool accepts a URL from the caller, so there is no
SSRF surface to guard. The other seven tools make no network calls at all.
Untrusted XML: a document that declares a DOCTYPE is refused before parsing (a
CFDI never has one), and size and element-count caps bound the memory one parse can
take; attribute values are cut at 4,000 characters in the result. cfdi_status screens the RFCs, total and UUID before spending a request on
them. Found a problem? Please open a private security advisory.
En español
Un servidor MCP que le da a un agente de IA las capacidades fiscales mexicanas que todo el mundo acaba reimplementando mal: validar RFC, CURP, CLABE y NSS con sus dígitos verificadores de verdad, leer un CFDI 4.0 en XML, consultar su estado en el SAT y buscar en los catálogos del SAT. Sin API keys, sin CSD y sin PAC.
Esto es la mitad de LECTURA. Para construir y sellar un CFDI hace falta un
certificado de sello digital y un PAC, y eso ya lo cubre
mcp-cfdi-mx (Python). Este servidor no
compite con él: lo complementa.
Lo que sí hace bien y casi nadie:
XAXX010101000no satisface su propio dígito verificador. El SAT lo asignó por decreto y el módulo 11 pide un4donde el SAT puso un0.XEXX010101000(residentes en el extranjero) sí lo satisface. Por eso tantos formularios rechazan las facturas al público en general. Las tools devuelvenis_genericycheck_digit_satisfiedpor separado.El dígito de control de la CLABE se queda con la última cifra de cada producto ponderado 3-7-1, no con la suma de sus cifras. De
9 × 7 = 63cuenta el3; las implementaciones que copian a Luhn suman6 + 3 = 9y sacan otro dígito: para la base09000000000000000el algoritmo da7y el estilo Luhn da1. Reducir módulo 10 antes o después de sumar da lo mismo; el error no está ahí.Las claves de entidad de la CURP son de RENAPO, no de INEGI ni ISO 3166-2:MX.
DFes Ciudad de México,MCes Estado de México,NEes nacido en el extranjero.El servicio del SAT se cae y no publica SLA. Su documentación declara capacidad para hasta 2 millones de consultas por hora y pide no aumentar el volumen de consultas, porque cada una toca sus bases de datos transaccionales.
cfdi_statusdegrada aavailable: falsecon el motivo; nunca lanza una excepción, y nunca hay que leer un fallo del SAT como "la factura es inválida".Estructuralmente válido no es dado de alta. Que el dígito cuadre dice que la cadena está bien formada, nada más.
Se instala sin clonar nada: claude mcp add mx-fiscal -- npx -y mx-fiscal-mcp-server.
El motor aritmético es mx-identifiers
(MIT, cero dependencias); el lector de CFDI viene de la herramienta que corre en
ortamarco.me; el sobre SOAP se leyó
del código de nodecfdi/sat-estado-cfdi,
no se inventó.
Habla la revisión 2026-07-28 del protocolo y sigue atendiendo a los clientes de 2025 (Claude Desktop, Claude Code, Cursor) desde la misma factoría de servidor.
License
MIT © Marco Orta
Available Tools
9 toolscfdi_batch_statusCFDI Status at the SAT, several invoicesARead-onlyIdempotent
Ask the SAT about up to 25 invoices in one call — same service and same answer per invoice as cfdi_status, with the SAT's request for restraint built in: at most 2 requests in flight, duplicates asked once, answers remembered in memory for 10 minutes (an outage is never remembered), and once 2 consecutive requests have failed no new one is started (one already in flight still finishes). Use it to reconcile a handful of invoices; it is not a bulk-verification pipeline, and the SAT states its service is sized for up to 2 million queries per hour and asks callers not to raise their volume.
Each item is either { xml } (preferred — the four values are derived from it) or { rfc_emisor, rfc_receptor, total, uuid }. An item that cannot be queried (bad XML, unstamped, malformed field) is reported on its own line with the reason and costs no request; it does not fail the batch.
Per item, outcome is: queried (asked the SAT now), cached (answered from memory, up to 10 minutes old), duplicate (same invoice as an earlier item), rejected (never sent; see error) or skipped (not attempted after repeated outages). A queried item whose result.available is false means the SAT did not answer — a statement about the SAT, never about the invoice. The same applies to skipped.
Args:
items (array of 1-25): each with
xmlOR rfc_emisor + rfc_receptor + total + uuid.response_format ('markdown' | 'json'): output format (default 'markdown').
Returns: { total, queried, cached, duplicates, rejected, skipped, unavailable, stopped_after_outage, items[{index, outcome, source, error, uuid, result}] }, where result has the shape cfdi_status returns (without source).
Example: "Are these three invoices still live?" -> cfdi_batch_status(items=[{xml:"…"},{xml:"…"},{xml:"…"}]).
Inputs: items (required), response_format. Returns: items, total, cached, queried, +5 more
cfdi_statusCFDI Status at the SATARead-onlyIdempotent
Ask the SAT whether an invoice actually exists and is still live. This queries the public ConsultaCFDIService SOAP endpoint — the same service the QR code printed on every Mexican invoice points at — so it needs no credentials, no CSD and no PAC contract.
Pass either the four values the SAT keys on (issuer RFC, receiver RFC, total, UUID) or the whole xml, in which case they are derived from it with the same reader parse_cfdi uses. Deriving them from the XML is the more reliable route: the total must be formatted exactly the way the printed-representation spec demands (six decimals, trailing zeros trimmed), and a total written in another format can come back as a spurious 'No Encontrado'.
What comes back, each with its meaning spelled out:
Estado — Vigente / Cancelado / No Encontrado.
EsCancelable — whether the issuer can cancel it unilaterally, needs the receiver's approval, or cannot cancel it at all.
EstatusCancelacion — whether a cancellation is in progress, was accepted, was rejected, or lapsed.
ValidacionEFOS — whether the issuer, and any third-party RFC the invoice was issued on behalf of (a cuenta de terceros), appears on the SAT's definitive 69-B list of companies that invoice simulated operations. Read with the code table the SAT documents (service documentation v1.4, section 3): 100, 101 and 104 put the issuer on the list; 102 and 103 mean the issuer is NOT on it but a third-party RFC is; 200 and 201 mean the issuer is not on it (201: nor any third party).
efos_statespeaks of the issuer only andefos_third_party_stateof the third parties; an empty field or an undocumented code isunknown, with the raw code kept invalidacion_efos.CodigoEstatus — the service's own result code.
Fail-soft by design. The SAT publishes no SLA and no status page, and the endpoint does go down; its documentation states capacity for up to 2 million queries per hour and asks callers not to raise their query volume, so query once per invoice and cache the answer. On timeout, refusal or a malformed answer this returns available: false with the reason instead of raising — a failed lookup is a statement about the SAT, never about the invoice. Never report a document as invalid on the strength of an unreachable service. 10-second timeout; one retry after a timeout, network error or 5xx, never after a 4xx.
Args (either shape):
xml (string), OR rfc_emisor + rfc_receptor + total + uuid (all strings).
response_format ('markdown' | 'json'): output format (default 'markdown').
Returns: { available, unavailable_reason, endpoint, expression, attempts, elapsed_ms, source, status{codigo_estatus, query_outcome, estado, document_state, document_meaning, es_cancelable, cancellable_state, cancellable_meaning, estatus_cancelacion, cancellation_state, cancellation_meaning, validacion_efos, efos_state, efos_third_party_state, efos_meaning, raw} | null, findings[] }.
Example: "Is this invoice still valid?" -> cfdi_status(xml="<cfdi:Comprobante …>").
Inputs: xml, uuid, total, rfc_emisor, +2 more. Returns: source, status, attempts, endpoint, +5 more
generate_test_dataGenerate Mexican Test DataARead-onlyIdempotent
Generate structurally valid Mexican identifiers for fixtures, database seeds and demos — generated, not taken from any real record.
For a person each record carries a coherent set: the RFC and the CURP are derived from the same name, sex, birth date and state, the CLABE's bank code is a real Banxico participant, and the NSS satisfies its Luhn digit. For a company, a razón social with a matching persona-moral RFC and a CLABE.
Why generated instead of hand-written: an RFC or CURP typed by hand almost never satisfies its check digit, so it fails the first validation your own code runs, and a seed file full of 'AAAA010101AAA' teaches your tests nothing.
These pass validation but are nobody's on purpose. They are generated from common names, so a CURP or phone number can coincide with a real person's by chance; they are not looked up at the SAT, RENAPO, IMSS or Banxico — do not send them to the SAT's status service or to a PAC.
Args:
kind ('person' | 'company'): what to generate (default 'person').
count (integer 1-100): how many records (default 1).
response_format ('markdown' | 'json'): output format (default 'markdown').
Returns: { kind, count, people[{nombre, apellido_paterno, apellido_materno, sexo, fecha_nacimiento, entidad, entidad_nombre, rfc, curp, clabe, banco, nss, codigo_postal, telefono, email}], companies[{razon_social, rfc, clabe, banco, codigo_postal, fecha_constitucion}], findings[] }.
Example: "Give me 5 fake Mexican customers with valid RFC and CURP" -> generate_test_data(kind="person", count=5).
Inputs: kind, count, response_format. Returns: kind, count, people, findings, +1 more
parse_cfdiParse CFDI XMLARead-onlyIdempotent
Turn the XML of a Mexican electronic invoice (CFDI 4.0) into structured JSON: header, issuer, receiver, every line item with its transferred and withheld taxes, the tax totals, and the Timbre Fiscal Digital (UUID, stamp date, SAT certificate number, PAC's RFC) — or timbre: null when the document was never stamped.
Three things this does beyond reading attributes:
It labels the catalogue codes. '601' becomes 'General de Ley Personas Morales', 'G03' becomes 'Gastos en general', 'PPD' becomes 'Pago en parcialidades o diferido'. An unknown code is reported as unknown rather than guessed at.
It validates both RFCs (issuer and receiver) with the full modulus-11 check, and flags the SAT generics.
It checks the arithmetic: subtotal − discount + transferred − withheld should equal the declared total. A mismatch is a warning, not a verdict — rounding at the line level is allowed within a centavo.
It walks the document by local element name, so it does not care whether the PAC used the cfdi: and tfd: prefixes, different ones, or none.
Which documents it takes. Any XML whose root is Comprobante: CFDI 4.0 (including tipo P with the Pagos 2.0 complement and tipo N with Nómina), and 3.3 with a version warning. Of the complements it reads only the Timbre Fiscal Digital and local taxes (ImpuestosLocales); any other present is named in findings but its content is not extracted. A 'Retenciones e información de pagos' document is a different SAT document and is refused with that explanation. Input is capped (default 2,000,000 characters, 200,000 elements), a DOCTYPE is refused, and attribute values are cut at 4,000 characters.
What this does NOT do: it does not verify the digital signature, and it does not ask the SAT anything. A document that parses cleanly can still be cancelled, or have been fabricated wholesale. Use cfdi_status for the SAT's own answer.
Args:
xml (string): the CFDI XML.
response_format ('markdown' | 'json'): output format (default 'markdown').
Returns: { version, serie, folio, fecha, tipo(+label), forma_pago(+label), metodo_pago(+label), moneda, tipo_cambio, sub_total, descuento, total, lugar_expedicion, exportacion, condiciones_de_pago, no_certificado, emisor{rfc, nombre, regimen(+label), rfc_valid, rfc_kind, rfc_errors}, receptor{… domicilio, uso(+label)}, conceptos[{descripcion, clave_prod_serv, cantidad, clave_unidad, unidad, valor_unitario, importe, descuento, objeto_imp(+label), traslados[], retenciones[]}], concepto_count, total_trasladados, total_retenidos, stamped, timbre{uuid, fecha_timbrado, no_certificado_sat, rfc_prov_certif} | null, arithmetic{…}, findings[] }.
Example: "Read this invoice and tell me who issued it and for how much" -> parse_cfdi(xml="<cfdi:Comprobante …>").
Inputs: xml (required), response_format. Returns: tipo, fecha, folio, serie, +28 more
sat_catalog_lookupSAT Catalogue LookupARead-onlyIdempotent
Look up the code tables a CFDI is written in, without downloading the SAT's spreadsheet. Nine catalogues, all bundled — this tool never touches the network.
regimen_fiscal(c_RegimenFiscal) — tax regime of issuer and receiveruso_cfdi(c_UsoCFDI) — what the receiver does with the invoiceforma_pago(c_FormaPago) — cash, transfer, card, …metodo_pago(c_MetodoPago) — PUE vs PPDtipo_comprobante(c_TipoDeComprobante) — I/E/T/N/Pobjeto_imp(c_ObjetoImp) — whether a line item is subject to tax (CFDI 4.0)impuestos(c_Impuesto) — ISR / IVA / IEPSbancos_clabe— Banxico participants by the first three CLABE digitsestados_curp— RENAPO's state keys for CURP positions 12-13
With no query you get the whole catalogue. With one, an exact code match wins (leading zeros are ignored, so '1' finds '01'); failing that it falls back to a case- and accent-insensitive substring search over both code and label, so 'confianza' finds 626 and 'oaxaca' finds OC.
Two honesty notes carried in the output: the bank list is a curated subset of Banxico's participant catalogue rather than the whole thing, and the CURP state keys are RENAPO's own — they do not match INEGI or ISO 3166-2:MX codes.
Args:
catalog (enum): one of regimen_fiscal, uso_cfdi, forma_pago, metodo_pago, tipo_comprobante, objeto_imp, impuestos, bancos_clabe, estados_curp.
query (string, optional): an exact code, or text to search for.
response_format ('markdown' | 'json'): output format (default 'markdown').
Returns: { catalog, official_name, authority, description, used_in, query, match_type, total_entries, match_count, entries[{code, label}], truncated, notes[] }.
Example: "What does UsoCFDI G03 mean?" -> sat_catalog_lookup(catalog="uso_cfdi", query="G03").
Inputs: catalog (required), query, response_format. Returns: notes, query, catalog, entries, +8 more
validate_clabeValidate CLABEARead-onlyIdempotent
Validate an 18-digit CLABE (Clave Bancaria Estandarizada, Banxico Circular 3/2012) — the account number every SPEI transfer in Mexico is addressed to — and name the bank behind it.
Structure: 3 digits of bank + 3 of plaza (city/branch) + 11 of account + 1 control digit.
The control digit is the part everybody gets wrong. The weights cycle 3-7-1, and each weighted product counts only its last digit (the product modulo 10): 9 × 7 = 63 counts as 3. Implementations that borrow the Luhn habit of adding the product's digits (6 + 3 = 9) compute a different control digit — for the base 09000000000000000 the algorithm gives 7 and the Luhn-style sum gives 1. (Reducing modulo 10 before or after summing gives the same result; that is not where they go wrong.) This uses the correct algorithm.
The bank code is resolved against a curated subset of Banxico's participant catalogue. A code that is not in the subset is reported as unknown rather than given an invented name. The plaza code is reported verbatim: the full plaza catalogue is not bundled, so no city is guessed.
Args:
value (string): the CLABE. Spaces and dashes are normalised away.
response_format ('markdown' | 'json'): output format (default 'markdown').
Returns: { input, normalized, formatted, valid, parts{banco, plaza, cuenta, digito}, bank_code, bank_name, plaza_code, plaza_note, expected_check_digit, errors[{code, message}], findings[] }.
Example: "Which bank is CLABE 012180012345678903?" -> validate_clabe(value="012180012345678903").
Inputs: value (required), response_format. Returns: input, parts, valid, errors, +8 more
validate_curpValidate CURPARead-onlyIdempotent
Validate a Mexican CURP (Clave Única de Registro de Población) — the 18-character population ID issued by RENAPO — and decode everything it encodes: birth date, sex, state of birth and the century marker.
The 18th character is a base-37 modulus-10 check digit over the first 17, and this checks it. Two details it gets right that a regex does not:
The state keys are RENAPO's own. 'DF' is Ciudad de México, 'MC' is Estado de México, 'NE' means born abroad. They do not match the INEGI or ISO 3166-2:MX codes, so a lookup against those tables silently mislabels people.
The homoclave character carries the century. A digit (position 17) means born before 2000; a letter means from 2000 onwards. Without it, positions 5-10 ('99' as a year) are ambiguous.
Names that would spell one of RENAPO's inconvenient words are flagged: a real CURP carries an X in the second position instead.
Structural validity is not registration. Only RENAPO can confirm a CURP belongs to a real person, and this server never asks it.
Args:
value (string): the CURP. Spaces, dashes and lower case are normalised away.
response_format ('markdown' | 'json'): output format (default 'markdown').
Returns: { input, normalized, valid, parts{...}, birth_date, sex, sex_label, state_key, state_name, century_marker, expected_check_digit, errors[{code, message}], findings[] }.
Example: "Decode BOXW310820HNERXN09" -> validate_curp(value="BOXW310820HNERXN09").
Inputs: value (required), response_format. Returns: sex, input, parts, valid, +9 more
validate_nssValidate NSS (IMSS)ARead-onlyIdempotent
Validate an 11-digit NSS (Número de Seguridad Social) issued by the IMSS, and split it into its fields: 2 digits of subdelegación, 2 of the year the holder was registered, 2 of the year of birth, 4 of serial, and a Luhn check digit over the first ten.
The two year fields are informational only. The IMSS has issued numbers whose years do not line up with the holder's records, so a mismatch is not grounds to reject a number — only the check digit is.
Args:
value (string): the NSS. Spaces and dashes are normalised away.
response_format ('markdown' | 'json'): output format (default 'markdown').
Returns: { input, normalized, valid, parts{subdelegacion, anioAlta, anioNacimiento, folio, digito}, expected_check_digit, errors[{code, message}], findings[] }.
Example: "Is 12345678903 a valid NSS?" -> validate_nss(value="12345678903").
Inputs: value (required), response_format. Returns: input, parts, valid, errors, +3 more
validate_rfcValidate RFCARead-onlyIdempotent
Validate a Mexican RFC (Registro Federal de Contribuyentes) — the SAT taxpayer ID — and break it into its parts. Works for both shapes: 13 characters for a persona física (individual) and 12 for a persona moral (company).
The last character is a modulus-11 check digit over the preceding ones, and this checks it. Two SAT-issued generics are special-cased and reported as such:
XAXX010101000 (público en general) does NOT satisfy the check-digit algorithm — the arithmetic asks for a '4' where the SAT wrote a '0'. It is valid by decree, not by maths, which is exactly why so many home-grown validators wrongly reject invoices to the general public.
XEXX010101000 (residentes en el extranjero) DOES satisfy it on its own.
The tool reports is_generic and check_digit_satisfied separately so you never have to conflate the two.
Structural validity is not registration. A well-formed RFC may belong to nobody. Only the SAT can say whether one is registered and active, and this server never asks.
Args:
value (string): the RFC. Spaces, dashes and lower case are normalised away.
response_format ('markdown' | 'json'): output format (default 'markdown').
Returns: { input, normalized, valid, kind, is_generic, generic_note, parts{iniciales, fecha, homoclave, digito}, birth_date, expected_check_digit, check_digit_satisfied, errors[{code, message}], findings[] }.
Example: "Is GODE561231GR8 a valid RFC?" -> validate_rfc(value="GODE561231GR8").
Inputs: value (required), response_format. Returns: kind, input, parts, valid, +8 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool targets a distinct artifact: CFDI parsing (parse_cfdi), SAT status queries (cfdi_status / cfdi_batch_status), catalogue lookups (sat_catalog_lookup), identifier validators (validate_rfc/curp/clabe/nss) and fixture generation. The only near-pair, cfdi_status vs cfdi_batch_status, is explicitly delimited in the descriptions (single invoice vs up to 25, with caching/dedup semantics). An agent can pick correctly from names alone.
All names are snake_case and grouped by systematic prefixes: validate_* for the four validators, cfdi_* for the three document/status tools. The deviations are that the verb position varies (parse_cfdi, generate_test_data are verb-first while cfdi_status and sat_catalog_lookup put the resource first), but every name remains self-explanatory.
Nine tools is well inside the sweet spot and every one earns its place: parsing, single status, batch status, catalogue lookup, four validators and a fixture generator. No filler tools and no missing obvious utility within the same surface.
The read-only analysis/validation lifecycle is essentially covered: parse, verify against SAT, decode catalogues, validate every identifier the documents contain, and generate test data. Gaps are deliberate and documented (no signature verification, no cancellation submission, no Pagos/Nómina complement extraction, Retenciones refused), so agents hit dead ends only on out-of-scope operations.
Maintenance
Related MCP Connectors
Official Mexican data for AI agents: CURP, RFC, CFDI, postal codes, phone, SPEI/CEP, DOF, geocoding.
Issue, sign and manage Mexican CFDI 4.0 e-invoices, complements and credit notes.
CFDI 4.0 invoicing for Mexico: invoices, payments, receipts and SAT catalogs, stamped with SAT
Deterministic Mexican/LatAm verification + sanctions & PEP screening for AI agents. Pay via x402.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to issue Mexico CFDI 4.0 electronic invoices (factura electrónica) via Facturapi, with tools for creating, querying, canceling, and sending invoices.MIT
- AlicenseNot gradedqualityCmaintenanceValidates LatAm banking and tax IDs (Mexican CLABE, Brazilian CNPJ/CPF checksums) and performs BrasilAPI company, CEP, and bank lookups, enabling AI agents to verify financial and tax information in Latin America.141 npmMIT

Tlaloc MCP Serverofficial
AlicenseNot gradedqualityCmaintenanceProvides AI assistants with live, authenticated access to official Mexican data sources including CURP, RFC, postal codes, phone numbers, SPEI payments, CFDI status, DOF semantic search, and geocoding via INEGI/INE.MIT- FlicenseNot gradedqualityCmaintenanceEnables AI agents to query Mexican postal codes, validate addresses, and search settlements using natural language from the official SEPOMEX catalog.1-