verifactu-mcp
On PyPI as verifactu-keyflint-mcp (the name verifactu-mcp belongs to another project).
MCP server for Spanish invoicing compliance, built for AI agents working for gestorías, accountants and invoicing-software teams. Offline and stateless: nothing is stored and nothing is sent to the AEAT.
- Audit VERI*FACTU chains: recompute the SHA-256 fingerprint (huella) of every record (alta and anulación)
exactly as the AEAT specifies, and check that each record links to the previous one. Works on JSON records or
on the XML any invoicing program exports (validated against the official
SuministroLR.xsd). - AEAT tax QR: URL and PNG/SVG image (error correction M) for VERI*FACTU and non-VERI*FACTU systems, production or test portal, with the printing rules.
- Facturae 3.2.2: build an invoice from plain data (totals, VAT breakdown, IRPF withholding, recargo de equivalencia, DIR3 codes for FACe, IBAN) and validate any Facturae file: official XSD, the arithmetic FACe checks, NIFs, DIR3 roles and signature presence.
The fingerprint code is tested against the three reference vectors published by the AEAT.
Tools
| Tool | Credits | What it does |
|---|---|---|
validate_invoice_chain |
3 | Audit a chain of records (JSON, up to 20,000): fingerprints, links, PrimerRegistro, duplicates, cancellations of unknown invoices, timestamps, NIF/date/amount/TipoFactura formats. continues_from audits a chain in pieces. |
validate_verifactu_xml |
3 | Same audit on exported XML (RegFactuSistemaFacturacion, SOAP envelope or any XML with RegistroAlta/RegistroAnulacion), plus XSD validation. |
verifactu_hash |
1 | Fingerprint of one record, with the exact string hashed. |
generate_verifactu_qr |
1 | Tax QR URL + image + printing rules. |
build_facturae |
3 | Facturae 3.2.2 XML (unsigned) from plain invoice data, XSD-validated. |
validate_facturae |
2 | XSD + arithmetic + NIF + DIR3 + signature check of a Facturae file. |
verifactu_calendar |
free | Deadlines in force and what is pending in the BOE, with sources. |
check_qr_url, validate_nif, pricing, credits_balance |
free | Helpers. |
Unreadable or invalid input is never charged; a tool that fails after charging is refunded.
Install
Claude Desktop / Claude Code / Cursor (mcpServers entry):
{
"verifactu": {
"command": "uvx",
"args": ["--from", "verifactu-keyflint-mcp", "verifactu-mcp"],
"env": { "KEYFLINT_LICENSE": "LIC-..." }
}
}
Hosted (one server, many buyers): verifactu-mcp --http or the Dockerfile; each request carries
Authorization: Bearer LIC-....
Environment: KEYFLINT_LICENSE, KEYFLINT_URL, KEYFLINT_PUBLIC_KEYS, KEYFLINT_CHECKOUT_URL,
VERIFACTU_PRICES (e.g. validate_invoice_chain=5,build_facturae=4), VERIFACTU_MAX_BYTES (default 10 MB).
Visual cards (MCP Apps)
In Claude, ChatGPT, VS Code and Goose every paid tool and credits_balance renders as an interactive card in the
chat: credit balance with a refill bar and a buy button, or a result summary (key figures, issues, table preview and
credits charged). It is the ui://verifactu/card.html resource, self-contained with no network access. Other clients
keep getting the same JSON as before.
Legal status (checked 2026-11-05)
- VERI*FACTU (RD 1007/2023, Orden HAC/1177/2024; dates from RD-ley 15/2025): 1 Jan 2027 for corporate income tax payers, 1 Jul 2027 for everyone else. Hacienda announced on 5 Oct 2026 a further delay to October 2028, not yet published in the BOE. Taxpayers on SII and the foral territories are out of scope.
- Mandatory B2B e-invoicing (RD 238/2026, Orden HAC/1028/2026): 6 Oct 2027 for turnover above 8 M EUR, 6 Oct 2028 for the rest; EN 16931 in UBL, CII, EDIFACT or Facturae.
- Facturae with XAdES signature is mandatory for invoices to public administrations through FACe.
verifactu_calendar returns this with sources. Always confirm in the BOE.
Scope and limits
- Not an invoicing system (SIF): it keeps no records, sends nothing to the AEAT and does not replace the producer's declaración responsable. Use it to check what a SIF produced, or to prepare data.
build_facturaeproduces unsigned XML. Sign it (XAdES-EPES) with the issuer's certificate before sending to FACe or a B2B platform. Corrective invoices (InvoiceClassOR) and batches are validated but not built yet.- If a stored fingerprint only matches after removing trailing zeros from the amounts, it is reported as a
warning (
correcta_sin_ceros): the record was generated with amounts written differently from the XML.
Sources
- AEAT, Detalle de las especificaciones técnicas para generación de la huella o hash de los registros de
facturación (reference vectors in
tests/test_core.py). - AEAT, Características del QR y especificaciones del servicio de cotejo.
- AEAT web service schemas
SuministroLR.xsd/SuministroInformacion.xsd, andFacturaev3_2_2.xsd(facturae.gob.es), bundled insrc/verifactu_mcp/schemas/with the W3C xmldsig schema.
Development
pip install -e '.[test]'
pytest -q
Business Source License 1.1. Source available; production use needs a KeyFlint license (or must be non-commercial). Each version becomes Apache 2.0 four years after release. See LICENSE. The bundled XSD files belong to their publishers (AEAT, Ministerio de Hacienda, W3C).
Metadata
Release files for verifactu-keyflint-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| verifactu_keyflint_mcp-0.1.0.tar.gz | 82.0 kB | With provenance | Details for verifactu_keyflint_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| verifactu_keyflint_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for verifactu_keyflint_mcp-0.1.0-py3-none-any.whl |
Total release size: 162.5 kB
Release files / verifactu_keyflint_mcp-0.1.0.tar.gz
| Download URL | verifactu_keyflint_mcp-0.1.0.tar.gz |
|---|---|
| Size | 82.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f0d8034e73e0ad7493e68b0a95eee9c81992f6791a3acdb3c33cf15a006d72a
|
|
BLAKE2b-256 checksum How to use checksums |
14eca30f9dbef56561fdfc5cd66f7eb39147689e733056e48310096324c951dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logRelease files / verifactu_keyflint_mcp-0.1.0-py3-none-any.whl
| Download URL | verifactu_keyflint_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 80.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d6e3465889a0d1d845cc02c6be98a450b7ba3de6d087a12c2f866edb7f09466
|
|
BLAKE2b-256 checksum How to use checksums |
a32a559c99d7d78b3b3fc739bdeb1f87507863c529949c6e1b658e7ac01662d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logSecurity for verifactu-keyflint-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for verifactu_keyflint_mcp-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.