Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
mx__get_supported_scopeA

Return the CFDI document types, complementos, and sealing modes this package supports.

Reflects Phase 1 scope locked in context-library/countries/mx.md (workspace root repo): CFDI 4.0 Ingreso + Egreso + Complemento de Pagos 2.0, PAC-agnostic sealing. Build (mx__build_cfdi/mx__build_pago), XSD validation (mx__validate_cfdi), sealing (mx__seal_cfdi), and TFD verification (mx__verify_tfd) are all implemented. PAC submission transport and later-phase complementos are not — see roadmap-2026.md.

Returns: A ScopeInfo describing current scope, for callers to check before assuming a document type or complemento is supported.

mx__build_cfdiA

Build a well-formed, unsealed CFDI 4.0 Comprobante XML (Ingreso or Egreso).

comprobante_data is validated against CFDIComprobante — see that model for the full field list (seller/buyer as MXEmisor/ MXReceptor, lines as CFDIConcepto, tipo_de_comprobante, etc.). RFC fields are validated via TaxIdentifier.validate_mx_rfc as part of model construction; a malformed RFC is reported as a validation error, not a generated document.

The output XML omits Sello/NoCertificado/Certificado — those three schema-required attributes are populated by mx__seal_cfdi, run afterward. mx__validate_cfdi run on this output is expected to report exactly those three attributes missing; that is not a bug in this tool.

For TipoDeComprobante="P" (Complemento de Pagos), use mx__build_pago instead — this tool only builds Ingreso/Egreso Comprobantes.

Returns a dict with:

  • xml: the generated, unsealed CFDI 4.0 XML string

  • total: the computed Total attribute (SubTotal - Descuento + traslados - retenciones)

mx__build_pagoA

Build a well-formed, unsealed Complemento de Pagos 2.0 CFDI.

Composes the fixed single-Concepto wrapper SAT's Guía de llenado de pagos mandates for a Pago-type Comprobante (ClaveProdServ, ClaveUnidad, Descripcion, ValorUnitario, Importe, ObjetoImp are all fixed conventional values — see this module's docstring constants) with the Pagos20 complement built from pagos_data, and attaches the complement under cfdi:Complemento.

buyer.uso_cfdi is forced to "CP01" (the schema requires it for every Pagos CFDI per the same guide, regardless of what the caller passes) — mirrors how this tool already forces SubTotal/Moneda/etc.

The output XML omits Sello/NoCertificado/Certificado, same as mx__build_cfdi — seal afterward with mx__seal_cfdi.

Returns a dict with:

  • xml: the generated, unsealed CFDI XML string (with the Pagos complement attached)

mx__validate_cfdiA

Validate a CFDI 4.0 document against the official SAT XSD schemas.

Always validates the root Comprobante against cfdv40.xsd. If a TimbreFiscalDigital complement is present (i.e. the document has been stamped by a PAC), it is additionally validated against TimbreFiscalDigitalv11.xsd.xml. If a Pagos complement is present (TipoDeComprobante="P"), it is additionally validated against Pagos20.xsd.xml.

This is XSD-only — business-rule checks from SAT's Matriz de errores (specs/MatrizDeErrores_CFDI_v40_20260325.xls) are not run, mirroring mcp-nfe-br's br__validate_nfe_xml precedent (XSD-first, business rules deferred). A document that passes this validator is structurally conformant but not guaranteed to pass PAC certification.

Returns a dict with:

  • valid: True only if every schema that applies passed

  • comprobante: the cfdv40.xsd validation result

  • tfd: the TFD validation result, present only if a TimbreFiscalDigital element was found

  • pagos: the Pagos 2.0 validation result, present only if a Pagos element was found

mx__seal_cfdiA

Seal (or deliberately not seal) a CFDI 4.0 Comprobante, PAC-agnostic.

sealing_mode="local" computes the cadena original via the actual SAT XSLT transform (specs/cadenaoriginal_4_0.xslt, with its utilerias.xslt and Pagos20.xslt includes resolved from specs/; any other complemento include a document might reference is not in Phase-1 scope and stubs to a no-op template — see SelloDigitalSigner's docstring), then computes Sello/NoCertificado/Certificado via mcp_einvoicing_core.digital_signature.SelloDigitalSigner — no local reimplementation of the signing algorithm.

sealing_mode="pac" returns xml unchanged: some PACs accept an unsealed, schema-valid CFDI and seal it on the emisor's behalf. This tool does not submit to any PAC — see the package README for the PAC-agnostic design.

CSD key material is always a file path, never accepted as plaintext key content in a tool argument.

Returns a dict with:

  • xml: the sealed (or, for "pac", unchanged) XML string

  • sealing_mode: echoes the mode used

mx__verify_tfdA

Parse a Timbre Fiscal Digital 1.1 stamp and, optionally, verify SelloSAT.

Always returns the TFD's own attributes (UUID, FechaTimbrado, RfcProvCertif, SelloCFD, NoCertificadoSAT, SelloSAT, ...) and the recomputed cadena original (via cadenaoriginal_TFD_1_1.xslt, per Anexo 20 Rubro III.B). If pac_certificado_der_b64 is supplied, additionally verifies SelloSAT (SHA-256 + RSA-PKCS#1v1.5, the same algorithm as the emisor's own Sello) against that certificate's public key. Without it, sello_sat_verified is null — parsing succeeded but cryptographic verification was not attempted, not "passed".

Returns a dict with:

  • found: False if no TimbreFiscalDigital element exists in xml

  • fields: the TFD's own attributes

  • cadena_original: the recomputed cadena original string

  • sello_sat_verified: True/False if pac_certificado_der_b64 was supplied, else null

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cmendezs/mcp-cfdi-mx'

If you have feedback or need assistance with the MCP directory API, please join our Discord server