verifactu-qr
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@verifactu-qr what's the VeriFactu QR URL for NIF 89890001K, invoice 12345678&G33, date 01-01-2024, amount 241.4?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
verifactu-qr
URL del código QR tributario de VeriFactu (AEAT) y validación de NIF/CIF/NIE — sin dependencias, en una sola línea.
Herramienta en Python para generar la URL que debe llevar el QR obligatorio de las facturas españolas (RD 1007/2023 · Orden HAC/1177/2024) validando antes NIF, número de serie, fecha e importe, con los códigos de error oficiales de la AEAT (2001-2006). Incluye CLI y servidor MCP para agentes de IA.
Mantenido por Plataforma IA, consultora de automatización con IA para pymes en Madrid y toda España. Guía de plazos y preparación: VeriFactu 2027 para pymes.
Instalación
pip install verifactu-qr # solo librería + CLI (0 dependencias)
pip install "verifactu-qr[svg]" # + exportar el QR a SVG (segno)Related MCP server: mcp-europe-business
Uso rápido (CLI)
$ verifactu-qr qr --nif 89890001K --numserie "12345678&G33" --fecha 01-01-2024 --importe 241.4
https://www2.agenciatributaria.gob.es/wlpl/TIKE-CONT/ValidarQR?nif=89890001K&numserie=12345678%26G33&fecha=01-01-2024&importe=241.4
# entorno de pruebas, sistema que NO remite registros (no VERI*FACTU) y QR en SVG
$ verifactu-qr qr --nif 89890001K --numserie "12345678&G33" --fecha 01-01-2024 --importe 241.4 \
--pruebas --no-verifactu --svg qr.svg
$ verifactu-qr validar 89890001K
VALIDO: 89890001K (DNI)Uso como librería
from verifactu_qr import build_qr_url, nif_valido, url_consulta_json
url = build_qr_url(
nif="89890001K",
numserie="12345678&G33", # se codifica como 12345678%26G33 (URL encoding UTF-8)
fecha="01-01-2024", # o un datetime.date
importe=241.4, # o "241.40", Decimal
verifactu=True, # False -> .../ValidarQRNoVerifactu
entorno="produccion", # o "pruebas"
)
print(url)
print(url_consulta_json(url)) # añade &formato=json para parsear la respuesta de la AEATErrores con el código oficial: QRError.code ∈ {2001 NIF inválido, 2002 nº de serie demasiado
largo, 2003 caracteres no permitidos, 2004 fecha inválida, 2005 importe inválido, 2006 importe
demasiado largo}.
Uso como servidor MCP (agentes de IA)
{
"mcpServers": {
"verifactu-qr": { "command": "verifactu-qr-mcp" }
}
}Herramientas expuestas: verifactu_qr_url, validar_identificacion_fiscal, url_consulta_json.
Probarlo a mano:
$ printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' | verifactu-qr-mcpQué cubre y qué no
Cubre: los 4 parámetros obligatorios del QR (
nif,numserie,fecha,importe), las 4 URLs base (producción/pruebas × VERI*FACTU/no verificable), el URL encoding con la misma semántica quejava.net.URLEncoder(el detalle que más falla:&→%26, espacio →+), la validación con dígito de control de NIF/NIE/CIF y los códigos de error de la AEAT.No cubre: la huella (hash) de encadenamiento de registros, la firma electrónica XAdES, el envío SOAP de registros ni el diseño/maquetación del QR dentro del PDF (30-40 mm, nivel M). Para eso, ver
pyverifactuoverifactuen PyPI.
Aviso: herramienta no oficial, sin vinculación con la AEAT. Verifica siempre el resultado con el portal de pruebas de la AEAT antes de producción.
Referencias
Real Decreto 1007/2023, de 5 de diciembre (BOE-A-2023-24840).
Orden HAC/1177/2024, arts. 20 y 21 (contenido del QR: NIF, serie y número, fecha, importe).
AEAT, «Características del QR y especificaciones del servicio de cotejo» (sede electrónica).
Los tests incluyen el vector de ejemplo oficial de la AEAT
(nif=89890001K, numserie=12345678&G33 → 12345678%26G33, fecha=01-01-2024, importe=241.4).
Tests
PYTHONPATH=src python -m unittest discover -s tests -vLicencia
MIT — úsalo libremente en tu software de facturación.
English
verifactu-qr builds the URL that Spanish invoices must embed in their mandatory tax QR code
(VeriFactu, RD 1007/2023) while validating the Spanish tax ID, invoice number, date and amount,
returning the official AEAT error codes. Zero dependencies, plus a CLI and a stdio MCP server so
AI agents can generate compliant QR URLs. Maintained by Plataforma IA,
an AI automation consultancy based in Madrid, Spain.
Available Tools
3 toolsurl_consulta_jsonA
Añade formato=json a una URL de QR para consultar el servicio de la AEAT en JSON (no va dentro del QR).
Inputs: url_qr (required).
validar_identificacion_fiscalA
Comprueba si un NIF, NIE o CIF español tiene formato y dígito de control correctos.
Inputs: identificacion (required).
verifactu_qr_urlA
Genera la URL del código QR tributario de una factura española (VeriFactu, RD 1007/2023 y Orden HAC/1177/2024) validando NIF, número de serie, fecha e importe.
Inputs: nif (required), fecha (required), importe (required), numserie (required), +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The three tools target distinct operations: generating a VeriFactu QR URL, validating a Spanish tax ID, and appending format=json for AEAT JSON queries. The two URL-related tools (verifactu_qr_url and url_consulta_json) could be momentarily confused, but the descriptions clearly separate generation from query-format transformation.
Names mix Spanish and English and mix verb-first (validar_identificacion_fiscal) with noun-first patterns (verifactu_qr_url, url_consulta_json). Although all use snake_case, the underlying conventions are inconsistent, making the set feel ad hoc.
Three tools is on the thin side for the stated purpose, though the domain (VeriFactu QR generation) is narrow enough that a small surface is defensible. It borders on under-scoped.
The core generation and validation workflow is covered, but there is no tool to decode/parse an existing QR URL or validate a full invoice payload, leaving some notable gaps. The JSON-query helper partially compensates but the lifecycle feels incomplete.
Maintenance
Related MCP Connectors
Spanish e-invoicing with VeriFactu (AEAT): issue invoices, manage customers, validate NIFs.
Spanish Veri*factu invoicing: create invoices, expenses and VAT returns from your AI assistant.
Validate EU, UK, AU VAT numbers for AI agents. EU ViDA e-invoicing compliance.
Audit VERI*FACTU hash chains, build the AEAT tax QR, build and validate Facturae 3.2.2 invoices.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides access to official Spanish fiscal data and tools based on AEAT and BOE sources, covering income tax, VAT, and regional deductions. It enables AI assistants to answer tax-related queries and verify filing deadlines using verified information.1010 npm13MIT
- AlicenseAqualityDmaintenanceEuropean business compliance suite for AI agents — 28 tools covering tax ID validation (PT, ES, FR, DE, IT, UK, NL), IBAN verification, EU VAT rates, invoice requirements, e-invoicing rules, payment terms, labor calendar helpers, VAT breakdown calculations and invoice schema validation for 18+ European countries.28MIT

BeeL MCP serverofficial
AlicenseAqualityBmaintenanceEnables AI agents to issue, correct, and register legally compliant Spanish electronic invoices with AEAT VeriFactu, supporting F1/F2 types, R1–R5 correctives, and NIF validation from Claude, ChatGPT, Cursor, or VS Code.136480 npm2MIT- AlicenseNot gradedqualityBmaintenanceEnables AI agents to build and structurally validate Indian GST e-invoice JSON payloads (INV/CRN/DBN) and render IRP-returned signed QR strings as PNG images.1Apache 2.0