CAT
/MCP
SkillsMCPMarketplacesDigestToolsAdvertise

This week in Claude

Every Monday: Claude Code, Agent SDK, MCP, and the Anthropic platform moves worth your time.

Skills by Category
Frontend DevelopmentBackend & APIsTesting & QASecurityDevOps & CI/CDGit & Pull RequestsDocumentationCode Review & QualityAI & Agent BuildingSkill Development
MCP Servers by Category
Sales & MarketingWeb & Browser AutomationDatabasesAI & LLM ToolsCloud & InfrastructureCommunication & MessagingDeveloper ToolsDesign & CreativeDocuments & KnowledgeSearch & Web Crawling
Marketplaces by Category
AI Agents & OrchestrationLLM IntegrationDevelopment ToolsFrontend & UIBackend & APIsDatabasesTesting & Code QualityDevOps & CloudSecurity & ComplianceGit & Version Control

Cross AI Tools

Discover Claude Code plugins, extensions, and tools. Automatically updated directory of Anthropic Claude AI marketplaces with development tools, productivity plugins, and integrations.

Resources

  • Browse Skills
  • Browse MCP Servers
  • Browse Marketplaces
  • Plugins Reference

Community

  • About
  • Tools
  • Feedback
  • Privacy Policy
  • Advertise

Built for the Claude Code community with Claude Code by @mertduzgun

Independent project, not affiliated with Anthropic

Mcp Facturacion Electronica Es

cmendezs/mcp-facturacion-electronica-es
authSTDIOregistry active
Summary

If you're dealing with Spanish tax compliance, this server bridges Claude to Spain's famously complex six-system e-invoicing landscape. It generates and validates VERI*FACTU records with chained SHA-256 hashes for real-time AEAT submission, handles Facturae 3.2.2 XML with XAdES-EPES signatures for B2G invoicing via FACe, and detects which regime applies based on fiscal address and revenue. You get tools for SII SOAP/REST submissions (mandatory over €6M turnover), TicketBAI provincial XML variants for the Basque Country, and Crea y Crece B2B compliance checks. Built on mcp-einvoicing-core alongside the French and Belgian servers. Most functionality is marked pending regulatory confirmation, so treat this as pre-production until the January 2027 VERI*FACTU deadline firms up.

CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →

mcp-facturacion-electronica-es 🇪🇸

English | Espanol

License PyPI version Python mcp-facturacion-electronica-es MCP server


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).


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

SystemScopeFormatMandatory fromStatus
VERI*FACTUAll non-SII businessesProprietary XML (XSD v1.0 HAC/1177/2024)IS: Jan 2027 / Others: Jul 2027 (RD-ley 15/2025)Implemented (pending regulatory confirmation)
Facturae / FACeB2G (public sector)Facturae 3.2.2 + XAdES-EPESMandatory since 2015 (Ley 25/2013)Implemented (pending regulatory confirmation)
SIITurnover >6M EUR, VAT groups, REDEMEXML SOAP/REST AEATAlready mandatory (RD 596/2016)Implemented (pending regulatory confirmation)
TicketBAIAraba, Gipuzkoa, BizkaiaProvincial XML + XAdES + QRBy province, 2022-2023Removed 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 pendingImplemented (pending regulatory confirmation)
NaTicketNavarreForal XML + signatureForal mandate (phased rollout)Partial (via es__detect_regional_regime)

SII / VERI*FACTU mutual exclusion (Real Decreto 254/2025): Taxpayers enrolled in SII are exempt from VERI*FACTU. Use es__check_b2b_mandate_applicability before 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.

ParameterTypeRequiredDescription
invoiceInvoiceDocumentYesCore invoice model (seller, buyer, lines, VAT)
previous_hashstringNoSHA-256 Huella of the preceding record (null = first in chain)
software_idstringYesIDSistemaInformatico of the certified software
software_nifstringYesNIF of the software manufacturer
invoice_typestringYesF1, 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"
  }
}

⚠️ Pending regulatory confirmation: XSD v1.0 (HAC/1177/2024) not yet validated against the AEAT test environment.


es__validate_verifactu_record

Validates a VERI*FACTU XML record against the official XSD published with Orden HAC/1177/2024 (BOE-A-2024-22138).

ParameterTypeRequiredDescription
xmlstringYesRaw VERI*FACTU XML record
schema_versionstringNoSchema version (default: "1.0")
{ "tool": "es__validate_verifactu_record", "arguments": { "xml": "<RegistroFacturacion>...</RegistroFacturacion>" } }

⚠️ Pending regulatory confirmation


es__submit_verifactu_to_aeat

Submits a signed VERI*FACTU record to the AEAT real-time endpoint via MTLS (FNMT-RCM Class 1 certificate). Respects AEAT_ENV=sandbox|production.

ParameterTypeRequiredDescription
xmlstringYesSigned VERI*FACTU XML
nifstringYesSender NIF
{ "tool": "es__submit_verifactu_to_aeat", "arguments": { "xml": "<RegistroFacturacion>...</RegistroFacturacion>", "nif": "B12345678" } }

⚠️ Pending regulatory confirmation: AuthMode.MTLS is not yet implemented in mcp-einvoicing-core; tracked in the core gaps backlog.


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).

ParameterTypeRequiredDescription
nifstringYesIssuer NIF
invoice_numberstringYesNumSerieFactura
invoice_datestringYesFechaExpedicionFactura (YYYY-MM-DD)
total_amountnumberYesInvoice total including VAT
size_pxintegerNoQR 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 } }

⚠️ Pending regulatory confirmation


es__cancel_verifactu_record

Generates a VERI*FACTU cancellation record (IndicadorAnulacion=S, TipoHuella=01) chained to the current fingerprint sequence.

ParameterTypeRequiredDescription
original_invoice_numberstringYesNumSerieFactura to cancel
original_invoice_datestringYesFechaExpedicionFactura (YYYY-MM-DD)
issuer_nifstringYesIssuer NIF
previous_hashstringYesHuella 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..." } }

⚠️ Pending regulatory confirmation


Facturae / FACe

es__generate_facturae_xml

Generates a Facturae 3.2.2 compliant XML invoice for B2G submission. Uses InvoiceDocument from mcp-einvoicing-core.

ParameterTypeRequiredDescription
invoiceInvoiceDocumentYesCore invoice model
schema_versionstringNoFacturae schema version (default: "3.2.2")
{ "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).

ParameterTypeRequiredDescription
xmlstringYesUnsigned Facturae XML
cert_pathstringYesPath to PKCS#12 certificate (.p12 / .pfx)
cert_passwordstringYesCertificate password
signature_policy_idstringNoSignature policy OID (default: Facturae standard)
{ "tool": "es__sign_facturae_xades", "arguments": { "xml": "<Facturae>...</Facturae>", "cert_path": "/certs/empresa.p12", "cert_password": "s3cr3t" } }

⚠️ Pending regulatory confirmation


es__submit_to_face

Submits a signed Facturae XML to FACe (Punto General de Entrada de Facturas Electronicas) via the FACe B2B REST API v2. Requires OAuth2 (FACE_CLIENT_ID / FACE_CLIENT_SECRET).

ParameterTypeRequiredDescription
xmlstringYesFacturae XML with XAdES signature
administrative_unitstringYesFACe UnidadTramitadora code
accounting_officestringYesFACe OficinasContables code
management_bodystringYesFACe OrganoGestor code
{ "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).

ParameterTypeRequiredDescription
invoice_idstringYesFACe 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.

ParameterTypeRequiredDescription
xmlstringYesFacturae XML to validate
schema_versionstringNoSchema version (default: "3.2.2")
{ "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.

ParameterTypeRequiredDescription
invoiceInvoiceDocumentYesCore invoice model
record_typestringYes"issued" or "received"
communication_typestringNo"A0" new (default), "A1" modification, "A4" cancellation
{ "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.

ParameterTypeRequiredDescription
recordsarrayYesList of XML strings from es__build_sii_invoice_record
record_typestringYes"issued" or "received"
fiscal_yearintegerYesFiscal year (YYYY)
{ "tool": "es__submit_sii_batch", "arguments": { "records": ["<RegistroLRFacturasEmitidas>...</RegistroLRFacturasEmitidas>"], "record_type": "issued", "fiscal_year": 2025 } }

⚠️ Pending regulatory confirmation: AuthMode.MTLS is not yet implemented in mcp-einvoicing-core.


es__query_sii_status

Queries the status of a submitted SII batch via ConsultaFactInformadasEmitidas or ConsultaFactInformadasRecibidas.

ParameterTypeRequiredDescription
batch_idstringYesBatch reference returned by es__submit_sii_batch
record_typestringYes"issued" or "received"
{ "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).

ParameterTypeRequiredDescription
original_invoiceInvoiceDocumentYesInvoice being corrected
corrected_invoiceInvoiceDocumentNoCorrected data (null for A4)
correction_typestringYes"A1" or "A4"
record_typestringYes"issued" or "received"
{ "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.

ParameterTypeRequiredDescription
invoiceInvoiceDocumentYesCore invoice model
provincestringYes"araba", "gipuzkoa" or "bizkaia"
previous_hashstringNoHuellaTBAI of the preceding record
software_licensestringYesTicketBAI software license key
cert_pathstringYesSigning certificate path
cert_passwordstringYesCertificate 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).

ParameterTypeRequiredDescription
xmlstringYesSigned TicketBAI XML
provincestringYes"araba", "gipuzkoa" or "bizkaia"
nifstringYesSender 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.

ParameterTypeRequiredDescription
xmlstringYesTicketBAI XML
provincestringYes"araba", "gipuzkoa" or "bizkaia"
{ "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.

ParameterTypeRequiredDescription
invoiceInvoiceDocumentYesCore invoice model
formatstringNo"ubl" (default) or "facturae"
{ "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.

ParameterTypeRequiredDescription
annual_turnover_eurnumberYesAnnual VAT turnover in EUR
tax_address_province_codestringYesINE province code (e.g., "28" Madrid)
enrolled_in_siibooleanNoSII enrollment (default: false)
entity_typestringNo"IS" (Impuesto sobre Sociedades) or "IRPF"
{ "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.

ParameterTypeRequiredDescription
province_codestringYesTwo-digit INE province code
enrolled_in_siibooleanNoSII enrollment (default: false)
{ "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).

ParameterTypeRequiredDescription
entity_typestringYes"IS" or "IRPF"
province_codestringYesINE province code
annual_turnover_eurnumberNoFor SII threshold check (6M EUR)
enrolled_in_siibooleanNoSII 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).

ParameterTypeRequiredDescription
xmlstringYesRaw AEAT XML response
response_typestringNo"verifactu" (default) or "sii"
{ "tool": "es__parse_aeat_response", "arguments": { "xml": "<RespuestaRegFactuSistemaFacturacion>...</RespuestaRegFactuSistemaFacturacion>", "response_type": "verifactu" } }

⚠️ Pending regulatory confirmation


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

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

VariableDescriptionRequired
AEAT_ENVsandbox or productionYes
AEAT_CERTIFICATE_PATHPath to FNMT-RCM PKCS#12 certificateFor submission
AEAT_CERTIFICATE_PASSWORDCertificate passwordFor submission
AEAT_NIFTaxpayer NIFFor submission

FACe

VariableDescriptionRequired
FACE_ENVsandbox or productionYes
FACE_CLIENT_IDOAuth2 client IDYes
FACE_CLIENT_SECRETOAuth2 client secretYes

TicketBAI

VariableDescriptionRequired
TICKETBAI_ENVsandbox or productionYes
TICKETBAI_CERTIFICATE_PATHProvincial signing certificate pathYes
TICKETBAI_CERTIFICATE_PASSWORDCertificate passwordYes

Common (inherited from mcp-einvoicing-core)

VariableDescriptionDefault
LOG_LEVELDEBUG, INFO, WARNING, ERRORINFO

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

SystemTargetsDeadline
SIITurnover >6M EUR / VAT groups / REDEMEAlready mandatory (RD 596/2016)
Facturae/FACeAll B2G suppliersAlready mandatory (Ley 25/2013)
TicketBAIAll businesses in the Basque CountryPhased rollout by sector 2022-2023
VERI*FACTUIS (Impuesto sobre Sociedades) taxpayersJanuary 2027 (RD-ley 15/2025)
VERI*FACTUIRPF + other non-SIIJuly 2027 (RD-ley 15/2025)
Crea y Crece B2BAll businessesPending, 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-missing

Contributing

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 audit

All 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

CountryServer
🌍 Globalmcp-einvoicing-core
🇧🇪 Belgiummcp-einvoicing-be
🇧🇷 Brazilmcp-nfe-br
🇫🇷 Francemcp-facture-electronique-fr
🇩🇪 Germanymcp-einvoicing-de
🇮🇹 Italymcp-fattura-elettronica-it
🇵🇱 Polandmcp-ksef-pl
🇪🇸 Spainmcp-facturacion-electronica-es

License

Released under the Apache License 2.0. Copyright 2025-2026 Christophe Mendez and contributors.

Featured
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →

Configuration

AEAT_ENV*

Target environment for AEAT endpoints: 'sandbox' or 'production'.

AEAT_CERTIFICATE_PATH

Filesystem path to the FNMT-RCM PKCS#12 certificate (.p12 / .pfx) used for MTLS submission to AEAT (VERI*FACTU and SII).

AEAT_CERTIFICATE_PASSWORD

Passphrase for the PKCS#12 certificate at AEAT_CERTIFICATE_PATH.

AEAT_NIF

Taxpayer NIF used as the default submitter identity for AEAT submissions.

FACE_ENV

Target environment for FACe API: 'sandbox' or 'production'.

FACE_CLIENT_ID

OAuth2 client ID for FACe B2B REST API v2.

FACE_CLIENT_SECRET

OAuth2 client secret for FACe B2B REST API v2.

LOG_LEVEL

Logging level inherited from mcp-einvoicing-core: DEBUG, INFO (default), WARNING, or ERROR.

Categories
Sales & Marketing
Registryactive
Packagemcp-facturacion-electronica-es
TransportSTDIO
AuthRequired
UpdatedJun 2, 2026
View on GitHub

Related Sales & Marketing MCP Servers

View all →
Vibe Prospecting

explorium-ai/vibeprospecting-mcp

Power your chat with B2B data to create lead lists, research companies, personalize your outreach, and more.
22
Lead Enrichment API

io.github.compuute/lead-enrichment

Curated EU AI/Sec/DevTools/Fintech B2B leads, Claude-scored. MCP+x402. Free 250/mo.
Apollo Salesforce Mapper

dev.workers.selbyventurecap.cf-worker/apollo-salesforce-mapper

Apollo->Salesforce Lead mapper. No LLM. Strict-fail required fields. PASS/REPAIR/FAIL verdict.
Company Enrichment API

io.github.br0ski777/company-enrichment

Company firmographics from domain: name, socials, tech stack, emails, phone, address
Apollo

com.mcparmory/apollo

Search and enrich contact and company data from 210M+ people and 35M+ companies
25
Mcp Gtm Tech Stack Signal Scraper

mambalabsdev/mcp-gtm-tech-stack-signal-scraper

Detects a company CRM, sequencer, and marketing automation from its public website. Clay-ready.
1