mcp-facturacion-electronica-es
The mcp-facturacion-electronica-es server provides tools for generating, validating, and submitting electronic invoices across Spain's six coexisting e-invoicing systems.
VERI*FACTU: Generate tamper-proof records with SHA-256 chaining; validate against the official XSD; submit to AEAT via MTLS; generate mandatory QR codes; create cancellation records.
Facturae / FACe (B2G): Generate Facturae 3.2.2 XML; apply XAdES-EPES digital signatures; submit to the FACe portal; query invoice status (Registered, Acknowledged, Rejected, Paid); validate against the XSD schema.
SII: Build SII records for issued/received invoices (types A0/A1/A4); submit batches of up to 10,000 records to AEAT's SOAP endpoint; query invoice status; generate modification or cancellation correction records.
TicketBAI: Generate TicketBAI XML with provincial-specific schemas (Araba, Gipuzkoa, Bizkaia); submit to the corresponding Basque authority; validate against the correct provincial XSD.
Crea y Crece / B2B (Ley 18/2022): Generate B2B invoices in UBL 2.1 or Facturae 3.2.2 format; check mandate applicability based on turnover, province, and SII enrollment per RD 254/2025.
Utility & Compliance Tools: Detect the applicable regional regime (VERIFACTU, TICKETBAI, NATICKET, or VERIFACTU+SII) from the INE province code; get current mandate deadlines and applicable systems for a business profile; parse and normalize AEAT XML responses into structured JSON with status codes, CSV verification codes, and error details.
mcp-facturacion-electronica-es 🇪🇸
Introduction
mcp-facturacion-electronica-es is an MCP (Model Context Protocol) server specialized
in Spanish e-invoicing. It provides tools to generate, validate, and submit electronic
invoices under the six coexisting systems in Spain: VERI*FACTU, Facturae/FACe,
SII, TicketBAI (Basque Country), NaTicket (Navarre), and the B2B obligations of Ley 18/2022
"Crea y Crece". The server is built on mcp-einvoicing-core, the shared base library
used by mcp-facture-electronique-fr (France, XP Z12-013) and mcp-einvoicing-be
(Belgium, Peppol BIS 3.0).
Spain operates one of the most complex e-invoicing landscapes in Europe, with six overlapping systems that apply depending on taxpayer size, sector, and region. VERI*FACTU (Royal Decree 1007/2023, Order HAC/1177/2024) is the forthcoming mandatory real-time invoice registry for non-SII taxpayers, with hard deadlines in January and July 2027 (RD-ley 15/2025). SII (Suministro Inmediato de Informacion, Immediate Information Supply) already applies to large taxpayers (>6M EUR turnover). The Basque Country runs TicketBAI and Navarre runs NaTicket, both independent of the national AEAT framework. B2G invoicing via Facturae XML on the FACe portal has been mandatory since 2015 (Ley 25/2013).
Related MCP server: mcp-facture-electronique-fr
Built on
This package is built on mcp-einvoicing-core,
the shared base library used by all MCP servers in the mcp-einvoicing ecosystem. It provides
common models, validation abstractions, XML utilities, and the exception hierarchy.
mcp-einvoicing-core is installed automatically as a transitive dependency, no additional
steps are required.
Overview
The Spanish e-invoicing ecosystem has six coexisting systems with distinct scopes,
formats, and timelines. VERI*FACTU introduces tamper-proof chained invoice records
submitted in real time to the AEAT (Agencia Estatal de Administracion Tributaria),
applicable to most businesses from 2027 (RD-ley 15/2025). SII is already mandatory for
large taxpayers under a 4-day communication window. Facturae XML with XAdES-EPES signing
covers all B2G invoicing through the FACe portal. The Basque Country applies TicketBAI
independently, with three provincial authorities each maintaining their own XSD schemas and
endpoints. Navarre operates NaTicket. The Ley Crea y Crece mandates B2B e-invoicing for
all businesses, with the format still pending implementing regulations. Regime detection
based on tax domicile and turnover is a prerequisite to all other operations: use
es__detect_regional_regime first.
Regulatory coverage
System | Scope | Format | Mandatory from | Status |
VERI*FACTU | All non-SII businesses | Proprietary XML (XSD v1.0 HAC/1177/2024) | IS: Jan 2027 / Others: Jul 2027 (RD-ley 15/2025) | Implemented (pending regulatory confirmation) |
Facturae / FACe | B2G (public sector) | Facturae 3.2.2 + XAdES-EPES | Mandatory since 2015 (Ley 25/2013) | Implemented (pending regulatory confirmation) |
SII | Turnover >6M EUR, VAT groups, REDEME | XML SOAP/REST AEAT | Already mandatory (RD 596/2016) | Implemented (pending regulatory confirmation) |
TicketBAI | Araba, Gipuzkoa, Bizkaia | Provincial XML + XAdES + QR | By province, 2022-2023 | Removed from scope (v0.2.0) |
Crea y Crece (B2B) | All businesses (threshold pending) | UBL 2.1 or Facturae 3.2.2 (EN 16931) | Implementing regulations pending | Implemented (pending regulatory confirmation) |
NaTicket | Navarre | Foral XML + signature | Foral mandate (phased rollout) | Partial (via |
SII / VERI*FACTU mutual exclusion (Real Decreto 254/2025): Taxpayers enrolled in SII are exempt from VERI*FACTU. Use
es__check_b2b_mandate_applicabilitybefore generating any record.
Tools
VERI*FACTU
es__generate_verifactu_record
Generates a tamper-proof invoice record (Orden HAC/1177/2024) with SHA-256 Huella
chaining that links it to the previous record.
Parameter | Type | Required | Description |
|
| Yes | Core invoice model (seller, buyer, lines, VAT) |
|
| No | SHA-256 |
|
| Yes |
|
|
| Yes | NIF of the software manufacturer |
|
| Yes |
|
{
"tool": "es__generate_verifactu_record",
"arguments": {
"invoice": { "date": "2025-03-15", "number": "2025-0042", "currency": "EUR",
"seller": { "tax_id": { "country_code": "ES", "identifier": "B12345678" }, "name": "Empresa SL" },
"buyer": { "tax_id": { "country_code": "ES", "identifier": "A98765432" }, "name": "Cliente SA" },
"lines": [{ "line_number": 1, "description": "Servicios", "quantity": 10, "unit_price": 100.00, "vat_rate": 21.0 }]
},
"previous_hash": "3C4A9B...", "software_id": "SW-001", "software_nif": "B87654321", "invoice_type": "F1"
}
}The
Huellachaining algorithm (SHA-256 over the keyedcampo=valor&canonical string) is confirmed byte-for-byte against AEAT's own huella specification and its worked examples (specs/verifactu/documentation/Veri-Factu_especificaciones_huella_hash_registros.pdf). ⚠️ Still pending: full XSD v1.0 validation against a live AEAT test-environment acknowledgement.
es__validate_verifactu_record
Validates a VERI*FACTU XML record against the official XSD published with Orden HAC/1177/2024 (BOE-A-2024-22138).
Parameter | Type | Required | Description |
|
| Yes | Raw VERI*FACTU XML record |
|
| No | Schema version (default: |
{ "tool": "es__validate_verifactu_record", "arguments": { "xml": "<RegistroFacturacion>...</RegistroFacturacion>" } }Structural checks now branch correctly on
RegistroAltavs.RegistroAnulacion(a prior version false-flagged validRegistroAnulaciondocuments as missingTipoFactura/CuotaTotal/ImporteTotal, fields that only apply toRegistroAlta). Full XSD-mode validation (SuministroLR.xsd, bundled underspecs/verifactu/xsd/) requires network access at runtime — it imports the W3C xmldsig-core schema by remote URL — and falls back to the structural checks above when that import can't resolve.
es__submit_verifactu_to_aeat
Submits a signed VERI*FACTU record to the AEAT real-time endpoint via MTLS
(FNMT-RCM Class 1 certificate) or, if EINVOICING_SIGNER_SOCKET is configured, via the
signer microservice. Respects AEAT_ENV=sandbox|production. The submission endpoint
(.../SistemaFacturacion/VerifactuSOAP) is confirmed from the official AEAT WSDL and shared
by both the alta/anulación submission and the es__query_verifactu_status query operation.
Parameter | Type | Required | Description |
|
| Yes | Signed VERI*FACTU XML |
|
| Yes | Sender NIF |
{ "tool": "es__submit_verifactu_to_aeat", "arguments": { "xml": "<RegistroFacturacion>...</RegistroFacturacion>", "nif": "B12345678" } }The response includes a chain object implementing the accepted-only chain contract:
chain.safe_to_chain_from (the submitted record's own emisor_nif/num_serie/fecha/huella)
is populated only when AEAT's EstadoRegistro is Correcto or AceptadoConErrores — both mean
the record was actually stored under that Huella. Otherwise safe_to_chain_from is null with
an explicit warning not to use this record's Huella as the next record's previous_hash, or
(for a deferred result) a note to call es__query_verifactu_status first.
es__generate_qr_verifactu
Generates the mandatory VERI*FACTU QR code (HAC/1177/2024 Art. 10) as a base64-encoded PNG.
Encodes the AEAT verification URL with the text "Factura verificable en la sede
electronica de la AEAT". Candidate for promotion to mcp-einvoicing-core (QR generation).
URL format (host, path, nif/numserie/fecha/importe query parameters, and per-parameter
URL-encoding) is confirmed against the official AEAT QR specification
(specs/verifactu/documentation/DetalleEspecificacTecnCodigoQRfactura.pdf); the URL switches
between the sandbox and production ValidarQR host based on AEAT_ENV.
Parameter | Type | Required | Description |
|
| Yes | Issuer NIF |
|
| Yes |
|
|
| Yes |
|
|
| Yes | Invoice total including VAT |
|
| No | QR size in pixels (default: 200) |
{ "tool": "es__generate_qr_verifactu", "arguments": { "nif": "B12345678", "invoice_number": "2025-0042", "invoice_date": "2025-03-15", "total_amount": 1210.00 } }es__cancel_verifactu_record
Generates a VERI*FACTU cancellation record (RegistroAnulacion, TipoHuella=01) chained to
the current fingerprint sequence. Both the anulación Huella (SHA-256 over
IDEmisorFacturaAnulada/NumSerieFacturaAnulada/FechaExpedicionFacturaAnulada/Huella/
FechaHoraHusoGenRegistro — a distinct field set from RegistroAlta's, not a reduced copy of
it) and the top-level <IDFactura> block's element names are confirmed against the official AEAT
huella specification and SuministroInformacion.xsd.
Parameter | Type | Required | Description |
|
| Yes |
|
|
| Yes |
|
|
| Yes | Issuer NIF |
|
| Yes |
|
{ "tool": "es__cancel_verifactu_record", "arguments": { "original_invoice_number": "2025-0042", "original_invoice_date": "2025-03-15", "issuer_nif": "B12345678", "previous_hash": "3C4A9B..." } }es__query_verifactu_status
Queries the EstadoRegistro of an already-submitted VERI*FACTU record
(ConsultaFactuSistemaFacturacion / ConsultaLR.xsd). Use after a deferred result from
es__submit_verifactu_to_aeat: wait retry_after_seconds, then call this tool to confirm
the final state (Correcto / AceptadoConErrores / Anulado) before chaining the next
record. Requires AEAT_ENV, AEAT_CERTIFICATE_PATH, and AEAT_CERTIFICATE_PASSWORD, same
as es__submit_verifactu_to_aeat.
Parameter | Type | Required | Description |
|
| Yes | NIF of the |
|
| Yes | Name/razón social of the |
|
| Yes | Invoice date being queried, |
|
| No |
|
{ "tool": "es__query_verifactu_status", "arguments": { "nif": "B12345678", "name": "Empresa SL", "invoice_date": "2025-03-15", "num_serie_factura": "2025-0042" } }Root element name (
ConsultaFactuSistemaFacturacion) and endpoint — the same.../SistemaFacturacion/VerifactuSOAPURL used byes__submit_verifactu_to_aeat, per the official WSDL — are both confirmed. ⚠️ Still pending: response parsing has not been validated against a live AEAT sandbox acknowledgement.
Facturae / FACe
es__generate_facturae_xml
Generates a Facturae 3.2.2 compliant XML invoice for B2G submission. Uses
InvoiceDocument from mcp-einvoicing-core.
Parameter | Type | Required | Description |
|
| Yes | Core invoice model |
|
| No | Facturae schema version (default: |
|
| No | Indirect tax regime: |
|
| No | Recargo de Equivalencia rate (%), if applicable |
|
| No | Explicit Recargo de Equivalencia amount; if omitted, computed as |
|
| No | IRPF withholding rate (%), emitted in |
{ "tool": "es__generate_facturae_xml", "arguments": { "invoice": { "date": "2025-03-15", "number": "2025-0042", "seller": { "tax_id": { "country_code": "ES", "identifier": "B12345678" }, "name": "Proveedor SL" }, "buyer": { "tax_id": { "country_code": "ES", "identifier": "S2800000D" }, "name": "Ayuntamiento de Madrid" }, "lines": [{ "line_number": 1, "description": "Suministro", "quantity": 5, "unit_price": 200.00, "vat_rate": 21.0 }] } } }⚠️ Pending regulatory confirmation
es__sign_facturae_xades
Applies an XAdES-EPES digital signature (ETSI EN 319 132-1) to a Facturae XML document.
Candidate for promotion to mcp-einvoicing-core (XAdES signing, score 3/3).
Parameter | Type | Required | Description |
|
| Yes | Unsigned Facturae XML |
|
| Yes | Path to PKCS#12 certificate ( |
|
| No | Signature policy OID (default: Facturae standard) |
The certificate password is not accepted as a tool argument (ES-SH-6, avoids plaintext
credential exposure in LLM context/logs); set AEAT_CERTIFICATE_PASSWORD instead.
{ "tool": "es__sign_facturae_xades", "arguments": { "xml": "<Facturae>...</Facturae>", "cert_path": "/certs/empresa.p12" } }⚠️ Pending regulatory confirmation
es__submit_to_face
Submits a signed Facturae XML to FACe (Punto General de Entrada de Facturas Electronicas)
via the FACe integrator REST API. Authenticates with a JWS-signed JWT (RS256, x5c header)
minted from the same AEAT_CERTIFICATE_PATH / AEAT_CERTIFICATE_PASSWORD certificate used
for VERI*FACTU/SII, per FACe-manual-api-integradores.pdf s2.3.
Parameter | Type | Required | Description |
|
| Yes | Facturae XML with XAdES signature |
|
| Yes | FACe |
|
| Yes | FACe |
|
| Yes | FACe |
{ "tool": "es__submit_to_face", "arguments": { "xml": "<Facturae>...</Facturae>", "administrative_unit": "U00000038", "accounting_office": "U00000038", "management_body": "U00000038" } }⚠️ Pending regulatory confirmation
es__get_face_invoice_status
Queries the processing status of an invoice on FACe. Returns standard status codes:
1200 (Registered), 2400 (Acknowledged), 3100 (Rejected), 4100 (Paid). The raw FACe
response is never echoed to the LLM; only a structured, non-sensitive subset
(status_code, codigo, descripcion, numeroRegistro) is returned (ES-SH-7).
Parameter | Type | Required | Description |
|
| Yes | FACe registration number |
{ "tool": "es__get_face_invoice_status", "arguments": { "invoice_id": "FAC-2025-00012345" } }⚠️ Pending regulatory confirmation
es__validate_facturae_schema
Validates a Facturae XML against the official Facturae 3.2.2 XSD using lxml. Returns
structured errors with XPath locations.
Parameter | Type | Required | Description |
|
| Yes | Facturae XML to validate |
|
| No | Schema version (default: |
{ "tool": "es__validate_facturae_schema", "arguments": { "xml": "<Facturae>...</Facturae>" } }⚠️ Pending regulatory confirmation
SII (Suministro Inmediato de Informacion)
es__build_sii_invoice_record
Builds an AEAT SII XML record (issued FacturaExpedida or received FacturaRecibida)
conforming to the AEAT SII technical guide v3.0 (April 2024). Supports TipoComunicacion A0/A1/A4.
Parameter | Type | Required | Description |
|
| Yes | Core invoice model |
|
| Yes |
|
|
| No |
|
{ "tool": "es__build_sii_invoice_record", "arguments": { "invoice": { "date": "2025-03-15", "number": "2025-0042" }, "record_type": "issued", "communication_type": "A0" } }⚠️ Pending regulatory confirmation
es__submit_sii_batch
Submits a batch of invoices (up to 10,000 records) to the AEAT SII SOAP endpoint. Requires MTLS.
Parameter | Type | Required | Description |
|
| Yes | List of XML strings from |
|
| Yes |
|
|
| Yes | Fiscal year (YYYY) |
{ "tool": "es__submit_sii_batch", "arguments": { "records": ["<RegistroLRFacturasEmitidas>...</RegistroLRFacturasEmitidas>"], "record_type": "issued", "fiscal_year": 2025 } }⚠️ Pending regulatory confirmation:
AuthMode.MTLSis not yet implemented inmcp-einvoicing-core.
es__query_sii_status
Queries the status of a submitted SII batch via ConsultaFactInformadasEmitidas or
ConsultaFactInformadasRecibidas.
Parameter | Type | Required | Description |
|
| Yes | Batch reference returned by |
|
| Yes |
|
{ "tool": "es__query_sii_status", "arguments": { "batch_id": "SII-BATCH-20250315-001", "record_type": "issued" } }⚠️ Pending regulatory confirmation
es__generate_sii_correction
Generates an SII modification (A1) or cancellation (A4) record referencing the original
invoice via IDFactura. The credit note builder is a candidate for mcp-einvoicing-core
(score 3/3).
Parameter | Type | Required | Description |
|
| Yes | Invoice being corrected |
|
| No | Corrected data ( |
|
| Yes |
|
|
| Yes |
|
{ "tool": "es__generate_sii_correction", "arguments": { "original_invoice": { "number": "2025-0042" }, "correction_type": "A1", "record_type": "issued" } }⚠️ Pending regulatory confirmation
TicketBAI
es__generate_ticketbai_xml
Generates a TicketBAI XML invoice with XAdES signature and HuellaTBAI chain. Automatically
selects the correct provincial XSD: Araba v1.2, Gipuzkoa v1.2, Bizkaia v2.1.
Parameter | Type | Required | Description |
|
| Yes | Core invoice model |
|
| Yes |
|
|
| No |
|
|
| Yes | TicketBAI software license key |
|
| Yes | Signing certificate path |
|
| Yes | Certificate password |
{ "tool": "es__generate_ticketbai_xml", "arguments": { "invoice": { "date": "2025-03-15", "number": "2025-0042" }, "province": "gipuzkoa", "software_license": "TBAI-GI-12345", "cert_path": "/certs/empresa.p12", "cert_password": "s3cr3t" } }⚠️ Pending regulatory confirmation: the three provincial XSDs must be packaged separately; cross-province validation is not permitted.
es__submit_ticketbai
Submits a TicketBAI XML record to the corresponding Basque provincial authority. The endpoint
is automatically routed: Araba (batuz.eus), Gipuzkoa (tbai.egoitza.gipuzkoa.eus),
Bizkaia (www.bizkaia.eus/ogasun).
Parameter | Type | Required | Description |
|
| Yes | Signed TicketBAI XML |
|
| Yes |
|
|
| Yes | Sender NIF |
{ "tool": "es__submit_ticketbai", "arguments": { "xml": "<T:TicketBai>...</T:TicketBai>", "province": "bizkaia", "nif": "B12345678" } }⚠️ Pending regulatory confirmation
es__validate_ticketbai_schema
Validates a TicketBAI XML document against the correct provincial XSD. The schemas are not interchangeable between provinces.
Parameter | Type | Required | Description |
|
| Yes | TicketBAI XML |
|
| Yes |
|
{ "tool": "es__validate_ticketbai_schema", "arguments": { "xml": "<T:TicketBai>...</T:TicketBai>", "province": "gipuzkoa" } }⚠️ Pending regulatory confirmation
Crea y Crece / B2B
es__generate_b2b_einvoice_es
Generates a B2B invoice conforming to EN 16931 in UBL 2.1 or Facturae 3.2.2 format per Ley 18/2022.
Parameter | Type | Required | Description |
|
| Yes | Core invoice model |
|
| No |
|
{ "tool": "es__generate_b2b_einvoice_es", "arguments": { "invoice": { "date": "2025-03-15", "number": "2025-0042" }, "format": "ubl" } }⚠️ Pending regulatory confirmation: the B2B mandate implementing regulations have not been published yet.
es__check_b2b_mandate_applicability
Determines the applicable regime (VERI*FACTU, SII, TicketBAI, NaTicket) based on turnover, province code, and SII enrollment. Applies the mutual exclusion logic of Real Decreto 254/2025.
Parameter | Type | Required | Description |
|
| Yes | Annual VAT turnover in EUR |
|
| Yes | INE province code (e.g., |
|
| No | SII enrollment (default: |
|
| No |
|
{ "tool": "es__check_b2b_mandate_applicability", "arguments": { "annual_turnover_eur": 2500000, "tax_address_province_code": "28", "enrolled_in_sii": false, "entity_type": "IS" } }⚠️ Pending regulatory confirmation
Utility tools
es__detect_regional_regime
Detects the applicable e-invoicing regime based on the INE province code.
Returns VERIFACTU, TICKETBAI, NATICKET, or VERIFACTU+SII.
Basque provinces: 01 Araba, 20 Gipuzkoa, 48 Bizkaia. Navarre: 31.
All others return VERIFACTU. Candidate for promotion to mcp-einvoicing-core.
Parameter | Type | Required | Description |
|
| Yes | Two-digit INE province code |
|
| No | SII enrollment (default: |
{ "tool": "es__detect_regional_regime", "arguments": { "province_code": "20", "enrolled_in_sii": false } }⚠️ Pending regulatory confirmation
es__get_compliance_status
Returns the current mandate deadlines and operating system for a business profile.
Reflects RD-ley 15/2025, subject to changes by subsequent legislation.
Candidate for promotion to mcp-einvoicing-core (generic deadline registry).
Parameter | Type | Required | Description |
|
| Yes |
|
|
| Yes | INE province code |
|
| No | For SII threshold check (6M EUR) |
|
| No | SII enrollment |
{ "tool": "es__get_compliance_status", "arguments": { "entity_type": "IS", "province_code": "28", "annual_turnover_eur": 1000000, "enrolled_in_sii": false } }⚠️ Pending regulatory confirmation
es__parse_aeat_response
Parses and normalizes an AEAT XML response (VERI*FACTU or SII) into structured JSON.
Extracts EstadoEnvio (Correcto/AceptadoConErrores/Incorrecto), CSV
(secure verification code), and error details. Candidate for promotion to
mcp-einvoicing-core (generic vendor XML response parser, score 2/3).
Parameter | Type | Required | Description |
|
| Yes | Raw AEAT XML response |
|
| No |
|
{ "tool": "es__parse_aeat_response", "arguments": { "xml": "<RespuestaRegFactuSistemaFacturacion>...</RespuestaRegFactuSistemaFacturacion>", "response_type": "verifactu" } }⚠️ Pending regulatory confirmation
Installation
From PyPI (recommended)
pip install mcp-facturacion-electronica-esWithout prior installation, using uvx:
uvx mcp-facturacion-electronica-esFrom source
git clone https://github.com/cmendezs/mcp-facturacion-electronica-es.git
cd mcp-facturacion-electronica-es
uv sync --all-extrasConfiguration
Claude Desktop
{
"mcpServers": {
"facturacion-es": {
"command": "uvx",
"args": ["mcp-facturacion-electronica-es"],
"env": {
"AEAT_ENV": "sandbox",
"AEAT_CERTIFICATE_PATH": "/path/to/cert.p12",
"AEAT_CERTIFICATE_PASSWORD": "certificate-password"
}
}
}
}All configuration is done through environment variables or a .env file.
AEAT / VERI*FACTU / SII
Variable | Description | Required |
|
| Yes |
| Path to FNMT-RCM PKCS#12 certificate | For submission |
| Certificate password | For submission |
| Taxpayer NIF | For submission |
FACe
Variable | Description | Required |
|
| Yes |
FACe authenticates via JWS using the same AEAT_CERTIFICATE_PATH / AEAT_CERTIFICATE_PASSWORD
certificate as VERI*FACTU/SII (see the AEAT section above); no separate FACe credentials are
required.
TicketBAI
Variable | Description | Required |
|
| Yes |
| Provincial signing certificate path | Yes |
| Certificate password | Yes |
Common (inherited from mcp-einvoicing-core)
Variable | Description | Default |
|
|
|
Architecture
mcp-facturacion-electronica-es is a country adapter within the mcp-einvoicing family,
built on mcp-einvoicing-core.
mcp-einvoicing-core (v0.1.0+)
│ BaseDocumentGenerator, BaseDocumentValidator, BaseLifecycleManager
│ InvoiceDocument, InvoiceParty, InvoiceLineItem, VATSummary, PaymentTerms
│ EInvoicingError, ValidationError, XSDValidationError, PlatformError
│ BaseEInvoicingClient, OAuthConfig, AuthMode (OAUTH2 / BEARER / MTLS)
│ get_logger, format_amount, xml_element, format_error
│
├── mcp-facture-electronique-fr (France — XP Z12-013, Chorus Pro)
├── mcp-einvoicing-be (Belgium — Peppol BIS 3.0, PINT-BE, Mercurius)
├── mcp-facturacion-electronica-es (Spain — this package)
│ ├── verifactu/ record generation, hash chain, QR, cancellation
│ ├── facturae/ Facturae 3.2.2 XML, XAdES-EPES, FACe submission
│ ├── sii/ batch building, AEAT SOAP, corrections
│ ├── ticketbai/ XML generation, provincial routing, validation
│ ├── b2b/ UBL/Facturae Crea y Crece, mandate detector
│ └── utils/ regime detection, AEAT response parser, deadline registry
├── mcp-fattura-elettronica-it (Italy — FatturaPA / SDI)
└── mcp-ksef-pl (Poland — KSeF / FA(2))Compliance notes
Notice: Mandate dates reflect RD-ley 15/2025 (December 2025) and are subject to changes by subsequent legislation or AEAT administrative instructions. This software does not constitute legal or tax advice.
Mandate timeline
System | Targets | Deadline |
SII | Turnover >6M EUR / VAT groups / REDEME | Already mandatory (RD 596/2016) |
Facturae/FACe | All B2G suppliers | Already mandatory (Ley 25/2013) |
TicketBAI | All businesses in the Basque Country | Phased rollout by sector 2022-2023 |
VERI*FACTU | IS (Impuesto sobre Sociedades) taxpayers | January 2027 (RD-ley 15/2025) |
VERI*FACTU | IRPF + other non-SII | July 2027 (RD-ley 15/2025) |
Crea y Crece B2B | All businesses | Pending, implementing regulations not yet published |
Regional exceptions
Basque Country: TicketBAI applies instead of VERI*FACTU. Each of the three provinces (Araba, Gipuzkoa, Bizkaia) has a different XSD, endpoint, and software certification process. National AEAT endpoints do not apply.
Navarre: NaTicket applies (Hacienda Foral de Navarra). VERI*FACTU does not apply.
Ceuta / Melilla: IPSI (not VAT); SII/VERI*FACTU applicability differs, verify with the AEAT.
SII / VERI*FACTU mutual exclusion: Real Decreto 254/2025 makes these systems mutually exclusive. Taxpayers enrolled in SII do not submit VERI*FACTU records.
All AEAT submission endpoints require an FNMT-RCM certificate or one from an accredited CA.
The AEAT provides a free test environment at prewww2.aeat.es.
Tests
# Install development dependencies
uv sync --all-extras
# Run the full test suite
uv run pytest tests/ -v
# With coverage report
uv run pytest --cov=mcp_facturacion_electronica_es --cov-report=term-missingContributing
Open an issue before starting significant work. For reusable utility logic across country
adapters, open a core-promotion issue in mcp-einvoicing-core before implementing it:
use the scoring rubric (3 = MUST promote, 2 = SHOULD, 1 = keep here).
git clone https://github.com/cmendezs/mcp-facturacion-electronica-es.git
cd mcp-facturacion-electronica-es
uv sync --all-extras
uv run pytest
make auditAll regulatory assertions must reference a specific BOE publication, an official XSD version,
or an AEAT technical guide version. Do not remove
⚠️ Pending regulatory confirmation without linking the verified source in the
PR description.
Other e-invoicing MCP servers
Country | Server |
🌍 Global | |
🇧🇪 Belgium | |
🇧🇷 Brazil | |
🇫🇷 France | |
🇩🇪 Germany | |
🇮🇹 Italy | |
🇵🇱 Poland | |
🇪🇸 Spain |
License
Released under the Apache License 2.0. Copyright 2025-2026 Christophe Mendez and contributors.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for DACH e-invoicing. Create XRechnung (UBL) and ZUGFeRD 2.3 (Factur-X CII) invoices, validate against EN 16931 rules, extract data from XML, and convert between UBL, CII and JSON formats.6392MIT
- AlicenseAqualityCmaintenanceModel Context Protocol (MCP) server for French Electronic Invoicing (NF XP Z12-013). Provide tools to validate, generate, and explore API specifications for PDP/OD interoperability.34Apache 2.0
- AlicenseAqualityAmaintenanceModel Context Protocol (MCP) server for Italian Electronic Invoicing (FatturaPA / SDI). Provide tools to validate, generate, and explore API specifications for Sistema di Interscambio (SDI) interoperability.271Apache 2.0
- AlicenseAqualityAmaintenanceModel Context Protocol (MCP) server for Belgian Electronic Invoicing (Peppol BIS 3.0 / PINT-BE / Mercurius). Provides tools to validate, generate, and transform UBL 2.1 e-invoices, and look up BCE/KBO enterprise data and Peppol participants.7Apache 2.0
Related MCP Connectors
Brazilian fiscal MCP server - issue NF-e, NFC-e, NFS-e, CT-e, MDF-e and DC-e via SEFAZ.
AI-native ERP MCP: ES/EU fiscal compliance (VeriFactu/TicketBAI/Facturae), invoicing, tax, banking
Create, validate, convert & extract compliant e-invoices (UBL, Factur-X, ZUGFeRD, XRechnung)
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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-facturacion-electronica-es'
If you have feedback or need assistance with the MCP directory API, please join our Discord server