Spanish e-invoicing MCP server: VERI*FACTU, Facturae/FACe, SII, TicketBAI, Crea y Crece B2B.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
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), which 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.
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).
Without prior installation, using uvx:
All configuration is done through environment variables or a .env file.
| Variable | Description | Required |
|---|---|---|
AEAT_ENV | sandbox or production | Yes |
AEAT_CERTIFICATE_PATH | Path to FNMT-RCM PKCS#12 certificate | For submission |
AEAT_CERTIFICATE_PASSWORD | Certificate password | For submission |
AEAT_NIF | Taxpayer NIF | For submission |
| Variable | Description | Required |
|---|---|---|
FACE_ENV | sandbox or production | 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.
| Variable | Description | Required |
|---|---|---|
TICKETBAI_ENV | sandbox or production | Yes |
TICKETBAI_CERTIFICATE_PATH | Provincial signing certificate path | Yes |
TICKETBAI_CERTIFICATE_PASSWORD | Certificate password | Yes |
mcp-einvoicing-core)| Variable | Description | Default |
|---|---|---|
LOG_LEVEL | DEBUG, INFO, WARNING, ERROR | INFO |
To use this server with Claude, add this configuration to your claude_desktop_config.json file:
Cursor supports MCP servers via stdio. Add the configuration in:
~/.cursor/mcp.json.cursor/mcp.jsonReload the Cursor window (Ctrl+Shift+P then Reload Window) to apply the changes.
Kiro supports MCP servers via its dedicated configuration file. Two levels are available:
~/.kiro/settings/mcp.json.kiro/settings/mcp.jsonThe file is automatically reloaded on save. You can also open the config via the command palette (Cmd+Shift+P / Ctrl+Shift+P) then MCP.
Kiro security tip: rather than writing secrets in plain text, use the syntax
"AEAT_CERTIFICATE_PASSWORD": "${AEAT_CERTIFICATE_PASSWORD}", Kiro resolves shell environment variables at startup.
es__generate_verifactu_recordGenerates 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 |
|---|---|---|---|
invoice | InvoiceDocument | Yes | Core invoice model (seller, buyer, lines, VAT) |
previous_hash | string | No | SHA-256 Huella of the preceding record (null = first in chain) |
software_id | string | Yes | IDSistemaInformatico of the certified software |
software_nif | string | Yes | NIF of the software manufacturer |
invoice_type | string | Yes | F1, F2, R1-R5 or F3 |
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_recordValidates a VERI*FACTU XML record against the official XSD published with Orden HAC/1177/2024 (BOE-A-2024-22138).
| Parameter | Type | Required | Description |
|---|---|---|---|
xml | string | Yes | Raw VERI*FACTU XML record |
schema_version | string | No | Schema version (default: "1.0") |
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_aeatSubmits 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 |
|---|---|---|---|
xml | string | Yes | Signed VERI*FACTU XML |
nif | string | Yes | Sender NIF |
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_verifactuNo reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mcp-facturacion-electronica-es)<a href="https://allmcps.com/mcp/mcp-facturacion-electronica-es"><img src="https://allmcps.com/api/badge/mcp-facturacion-electronica-es?style=directory" alt="MCP Facturacion Electronica Es on AllMCPs" /></a>