
Mexican Tax & Banking
io.github.OrtaMarco由 GitHub 帳號 OrtaMarco 發布v1.1.1更新於 Oct 24, 2026
Validate RFC, CURP, CLABE and NSS, read CFDI 4.0 invoices and check their SAT status. No keys.
概覽
針對墨西哥稅務與銀行資料的本地 MCP 伺服器:驗證 RFC、CURP、CLABE 與 NSS,讀取 CFDI 4.0 發票,查詢 SAT 狀態並檢索 SAT 代碼表。
- 可以做什麼
- 驗證 RFC、CURP、CLABE、NSS 等識別碼的真實檢查碼,並可產生前後一致的虛構個人或公司測試資料
- 將 CFDI 4.0 發票 XML 解析為結構化 JSON,標註 SAT 代碼、驗證雙方 RFC 並核對金額合計
- 向 SAT 公開服務查詢發票狀態、可取消性與 EFOS 名單,支援單張查詢及最多 25 張的批次查詢
- 依精確代碼或不區分重音的文字搜尋九張內建 SAT 代碼表,全程離線
- 以資源形式讀取內建代碼表,並用內建提示詞審閱發票或驗證混合的識別碼清單
- 適用情境
- 適合需要處理墨西哥發票或識別碼的情境:讀取 CFDI 並向 SAT 確認是否仍然有效、驗證 RFC、CURP、CLABE 或 NSS、解讀 SAT 代碼,或為種子檔案產生合法的虛構客戶資料。
- 執行需求
- 透過 npx 以 stdio 在本機執行,需要 Node.js 20 以上版本。不需要 API 金鑰、CSD 憑證或 PAC 合約。只有兩個狀態查詢工具會連網,存取 SAT 公開狀態服務。選用的自架 HTTP 模式使用 TRANSPORT、PORT、HOST、ALLOWED_HOSTS、ALLOWED_ORIGINS、MCP_AUTH_TOKEN 等變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Mexican Tax & Banking,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
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.
[ci] [npm] [MCP] [TypeScript] [License: MIT]
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.
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.
Tools
Identifiers
CFDI
Catalogues
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
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
Add --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/:
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
or in ~/.codex/config.toml (a project-scoped .codex/config.toml also works):
Self-host (HTTP transport)
The same server speaks stateless Streamable HTTP for remote or multi-client use.
It 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:
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):
Develop
How it works
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
來源:README.md,提交 bd84e71
工具
0版本歷史
4- v1.1.1最新Oct 16, 2026
- v1.1.0Oct 7, 2026
- v1.0.3Oct 3, 2026
- v1.0.2Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分