mcp-facturacion-electronica-es
Model Context Protocol (MCP) server for Spanish Electronic Invoicing. Provides tools to generate, validate, and submit invoices across VERI*FACTU, Facturae/FACe, SII, TicketBAI, and Crea y Crece B2B. Vendor-neutral: builds, validates, and signs locally, direct to the tax authority, no intermediary.
Install / Use
claude mcp add cmendezs -- npx -y github:cmendezs/mcp-facturacion-electronica-esIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
Finance & AccountingSupported Platforms
Our assessment of mcp-facturacion-electronica-es
mcp-facturacion-electronica-es scores 83/100 on our quality scale, 78th of 106 Finance & Accounting skills we index.
Its MCP Server is 33 KB long, well organised into 50 sections with 29 code examples: a thorough specification that gives an agent plenty to work with.
It has 3 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated 3 days ago, so mcp-facturacion-electronica-es is actively maintained.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 92/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
mcp-facturacion-electronica-es compared with similar skills
All 4 of these similar skills score higher than mcp-facturacion-electronica-es; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| mcp-facturacion-electronica-es (this skill)by cmendezs | 83 | 3 | 3d ago | MCP Server |
| Agent-Reachby Panniantong | 100 | 114.5k | today | CLAUDE.md |
| hyperframesby heygen-com | 100 | 89.4k | today | CLAUDE.md |
| rufloby ruvnet | 100 | 82.4k | today | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 80.7k | today | CLAUDE.md |
Frequently asked questions
- How do I install mcp-facturacion-electronica-es?
- Run
claude mcp add cmendezs -- npx -y github:cmendezs/mcp-facturacion-electronica-es. The install tabs above show the steps for each supported agent. - Which AI agents does mcp-facturacion-electronica-es work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is mcp-facturacion-electronica-es safe to use?
- It is Apache-2.0-licensed and scores 92/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is mcp-facturacion-electronica-es still maintained?
- The repository was last updated 3 days ago, so mcp-facturacion-electronica-es is actively maintained.
Skill content
View source on GitHubmcp-facturacion-electronica-es 🇪🇸
<!-- mcp-name: io.github.cmendezs/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), 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).
Installation
From PyPI (recommended)
pip install mcp-facturacion-electronica-es
Without prior installation, using uvx:
uvx mcp-facturacion-electronica-es
From source
git clone https://github.com/cmendezs/mcp-facturacion-electronica-es.git
cd mcp-facturacion-electronica-es
uv sync --all-extras
Configuration
All configuration is done through environment variables or a .env file.
AEAT / VERI*FACTU / SII
| 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 |
FACe
| 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.
Common (inherited from mcp-einvoicing-core)
| Variable | Description | Default |
|---|---|---|
| LOG_LEVEL | DEBUG, INFO, WARNING, ERROR | INFO |
Claude Desktop integration
To use this server with Claude, add this configuration to your claude_desktop_config.json file:
{
"mcpServers": {
"facturacion-es": {
"command": "uvx",
"args": ["mcp-facturacion-electronica-es"],
"env": {
"AEAT_ENV": "sandbox",
"AEAT_CERTIFICATE_PATH": "/path/to/cert.p12",
"AEAT_CERTIFICATE_PASSWORD": "cert…[redacted]"
}
}
}
}
Cursor integration
Cursor supports MCP servers via stdio. Add the configuration in:
- Global (all projects):
~/.cursor/mcp.json - Project (this repository only):
.cursor/mcp.json
{
"mcpServers": {
"facturacion-es": {
"command": "uvx",
"args": ["mcp-facturacion-electronica-es"],
"env": {
"AEAT_ENV": "sandbox",
"AEAT_CERTIFICATE_PATH": "/path/to/cert.p12",
"AEAT_CERTIFICATE_PASSWORD": "cert…[redacted]"
}
}
}
}
Reload the Cursor window (Ctrl+Shift+P then Reload Window) to apply the changes.
Kiro integration
Kiro supports MCP servers via its dedicated configuration file. Two levels are available:
- Global (all projects):
~/.kiro/settings/mcp.json - Workspace (this repository only):
.kiro/settings/mcp.json
{
"mcpServers": {
"facturacion-es": {
"command": "uvx",
"args": ["mcp-facturacion-electronica-es"],
"env": {
"AEAT_ENV": "sandbox",
"AEAT_CERTIFICATE_PATH": "/path/to/cert.p12",
"AEAT_CERTIFICATE_PASSWORD": "cert…[redacted]"
},
"disabled": false,
"autoApprove": []
}
}
}
The 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.
Available 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 |
|---|---|---|---|
| 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 |
{
"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). Generated records validate against the bundled XSD v1.0 (SuministroLR and SuministroInformacion, with the W3C XML-DSig schema resolved locally). ⚠️ Still pending: 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 |
|---|---|---|---|
| xml | string | Yes | Raw VERI*FACTU XML record |
| schema_version | string | No | Schema version (default: "1.0") |
{ "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 underresources/verifactu/) 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 |
|---|---|---|---|
| xml | string | Yes | Signed VERI*FACTU XML |
| nif | string | 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 |
|---|---|---|---|
| nif | string | Yes | Issuer NIF |
| invoice_number | string | Yes | NumSerieFactura |
| invoice_date | string | Yes | FechaExpedicionFactura (YYYY-MM-DD) |
| total_amount | number | Yes | Invoice total including VAT |
| size_px | integer | 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 |
|---|---|---|---|
| original_invoice_number | string | Yes | NumSerieFactura to cancel |
| original_invoice_date | string | Yes | FechaExpedicionFactura (YYYY-MM-DD) |
| issuer_nif | string | Yes | Issuer NIF |
| previous_hash | string | Yes | Huella of the last record in the chain |
{ "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
Truncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
114.5kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
hyperframes
89.4kOpen-source AI video editor: edit your own footage, or create and remake any video with Claude Code, Codex or the free Studio app. Write HTML, render MP4. By HeyGen.
ruflo
82.4k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
headroom
80.7kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
