Skip to main content
Glama
verifactu-mcp

verifactu-mcp

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
KEYFLINT_URLNoURL of the Keyflint license server, e.g. https://licenses.keyflint.dev.
KEYFLINT_LICENSEYesYour Keyflint license key, e.g. "LIC-...". Used for authentication and credits.
VERIFACTU_PRICESNoTool credit price overrides, e.g. validate_invoice_chain=5,build_facturae=4.
VERIFACTU_MAX_BYTESNoMaximum input size in bytes. Defaults to 10 MB.10 MB
KEYFLINT_PUBLIC_KEYSNoPublic keys used to verify licenses.
KEYFLINT_CHECKOUT_URLNoCheckout URL used to purchase licenses or credits.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Spanish invoicing compliance checks, offline and stateless. validate_invoice_chain and validate_verifactu_xml recompute the SHA-256 fingerprint (huella) of every VERI*FACTU record (alta and anulación) exactly as the AEAT specifies, check that each record links to the previous one, and report breaks, altered records, bad NIFs, dates and amounts: use them to audit what any invoicing program exported. verifactu_hash computes one fingerprint. generate_verifactu_qr returns the AEAT tax QR URL and image (level M) with the printing rules. build_facturae turns plain invoice data into a Facturae 3.2.2 XML validated against the official XSD (unsigned: sign it with the issuer's certificate before sending to FACe). validate_facturae checks a Facturae file: XSD, arithmetic, NIFs, DIR3 codes, signature presence. Free: verifactu_calendar (legal deadlines in force), check_qr_url, validate_nif, pricing, credits_balance. Amounts use a decimal point. This server is not an invoicing system and sends nothing to the AEAT. Unreadable input is never charged; failures are refunded.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
verifactu_hashA

Compute the VERI*FACTU fingerprint (huella, SHA-256) of one invoicing record.

record (AEAT field names; snake_case aliases accepted): alta: IDEmisorFactura, NumSerieFactura, FechaExpedicionFactura (DD-MM-AAAA), TipoFactura (F1, F2, F3, R1-R5), CuotaTotal, ImporteTotal (as written in the XML, decimal point), FechaHoraHusoGenRegistro (AAAA-MM-DDThh:mm:ss+hh:mm). anulación (TipoRegistro="anulacion"): IDEmisorFacturaAnulada, NumSerieFacturaAnulada, FechaExpedicionFacturaAnulada, FechaHoraHusoGenRegistro. previous_huella: fingerprint of the previous record of the chain; empty for the first record. Returns the fingerprint, the exact string hashed and any field problems (an error means the AEAT would reject the record).

validate_invoice_chainA

Audit a VERI*FACTU chain of records (in generation order) given as JSON objects.

Each record has the fields of verifactu_hash plus Huella (stored fingerprint) and optionally HuellaAnterior or RegistroAnterior {IDEmisorFactura, NumSerieFactura, FechaExpedicionFactura, Huella} and PrimerRegistro ("S"). For every record the fingerprint is recomputed and compared, and the link to the previous record checked. Reports chain breaks, altered records, PrimerRegistro misuse, duplicate invoices, cancellations of unknown invoices, timestamps going backwards, invalid NIF/dates/amounts/TipoFactura. continues_from: last fingerprint of the previous batch, to audit a chain in pieces. Up to 20,000 records. last_huella is what the next record must link to.

validate_verifactu_xmlB

Audit VERI*FACTU XML exported by an invoicing program (RegFactuSistemaFacturacion, a SOAP envelope, or any XML holding RegistroAlta / RegistroAnulacion elements, in document order).

Validates RegFactuSistemaFacturacion against the official AEAT schema (SuministroLR.xsd) when present, then runs every chain and fingerprint check of validate_invoice_chain. XML that holds no records is not charged.

generate_verifactu_qrA

Generate the AEAT tax QR ("QR tributario") of an invoice: URL and image.

Args: nif: Issuer NIF. numserie: Invoice series + number exactly as registered. fecha: Issue date (DD-MM-AAAA; AAAA-MM-DD and DD/MM/AAAA are converted). importe: ImporteTotal with decimal point, e.g. "241.40". verifactu: true for VERI*FACTU systems (ValidarQR), false for non-verifiable systems (ValidarQRNoVerifactu). environment: produccion (default) or pruebas (AEAT test portal). size_px: Image width in pixels (100-2000). image_format: png (default) or svg. The image uses error correction level M. print_rules says how it must appear on the invoice.

build_facturaeA

Build a Facturae 3.2.2 invoice (XML) from plain data, with totals computed and the official XSD checked.

invoice: number (max 20), series, issue_date, operation_date?, currency (EUR), description?, notes?, legal_literals? [text], receiver_contract_reference?, seller / buyer: nif, name (company name, or first name with first_surname/second_surname for a person), address, post_code, town, province, country (ISO alfa-3, default ESP), residence? (R/U/E), email?, phone?; buyer.face: {oficina_contable, organo_gestor, unidad_tramitadora, organo_proponente?} DIR3 codes for public administration invoices (FACe), or administrative_centres: [{code, role 01-04, name?}], lines: [{description, quantity, unit_price, tax_rate (21, 10, 4, 0...), discount_pct?, surcharge_rate? (recargo de equivalencia 5.2, 1.4, 0.5), tax_type? (01 IVA, 03 IGIC, 02 IPSI), unit? (01 unidades), receiver_reference?, file_reference?, article_code?}], withholding?: {rate} (IRPF retention, e.g. 15 or 7), payment?: {due_date, method (transferencia, domiciliacion, efectivo, tarjeta...), iban, bic?}. Amounts accept "1.234,56" or "1234.56". Returns xml (UTF-8, unsigned), xml_base64, totals and the validation report. Invalid data is refused before charging. Sign the XML (XAdES) before sending to FACe.

validate_facturaeA

Validate a Facturae 3.2.2 file (.xml or signed .xsig) before sending it to FACe or a client.

Checks the official XSD, the arithmetic FACe checks (line amounts, tax quotas, header vs line bases, totals, batch totals, installments), NIFs of resident parties, the three DIR3 codes for public administrations, and whether the file is signed. Files that are not Facturae are not charged.

check_qr_urlA

Check a tax QR URL read from an invoice: official AEAT host, path, parameters and formats. Free.

validate_nifA

Check a Spanish NIF / NIE / CIF control character. Free.

verifactu_calendarA

Legal deadlines for VERI*FACTU and mandatory B2B e-invoicing in Spain, with sources and what is still pending publication. Free.

pricingA

Credit price of each tool and where to buy credits. Free.

credits_balanceB

Remaining credits on your KeyFlint license. Free.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
verifactu-cardInteractive result card (MCP Apps).

TDQS

A3.7/5.0

Scored across 11 tools

Disambiguation4/5

Most tools have clearly distinct jobs: hashing a single record, auditing a chain, auditing XML, generating vs. checking QR codes, building vs. validating Facturae. The only real overlap is validate_invoice_chain vs. validate_verifactu_xml, which run the same checks on different input formats, and verifactu_hash vs. validate_invoice_chain (single record vs. whole chain). Descriptions resolve both, so misselection risk is low.

Naming Consistency3/5

Mostly snake_case verb_noun (validate_*, build_*, generate_*, check_*), but several names break the pattern: verifactu_hash and verifactu_calendar start with a domain noun, pricing is a bare noun, and the verifactu_ prefix appears inconsistently (verifactu_hash, verifactu_calendar, validate_verifactu_xml, generate_verifactu_qr). Readable overall, but the convention is mixed.

Tool Count4/5

Eleven tools is a well-scoped set for an e-invoicing compliance server: two Facturae tools, four VERI*FACTU record/QR tools, and supporting validators. Three of the eleven (pricing, credits_balance, verifactu_calendar) are free metadata/utility tools rather than core domain operations, which is slightly over-provisioned but not problematic.

Completeness4/5

The surface covers the main lifecycle: compute fingerprints, audit JSON and XML chains, generate and verify QR, build and validate Facturae, and check NIFs. Notable gaps remain around XAdES signing (explicitly deferred to the user) and actual submission of records to AEAT, so an agent cannot complete a full end-to-end flow with these tools alone.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues