Skip to main content
Glama
verifactu-mcp

verifactu-mcp

by ArceeDev

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_urlB

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_balanceA

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

No resources

TDQS

A3.8/5.0

Scored across 11 tools

Disambiguation4/5

Each tool targets a distinct artifact and action: hash one record, audit a JSON chain, audit an XML export, generate vs. check a QR, build vs. validate Facturae, check a NIF. The cluster verifactu_hash / validate_invoice_chain / validate_verifactu_xml is related but differentiated by input (single record, JSON array, XML file), and the descriptions make the boundaries explicit. Only slight residual risk that an agent picks validate_invoice_chain when it actually has XML, or verifactu_hash when it wants the whole chain.

Naming Consistency3/5

The dominant pattern is verb_noun (validate_invoice_chain, validate_verifactu_xml, validate_facturae, validate_nif, generate_verifactu_qr, build_facturae, check_qr_url). However verifactu_calendar and verifactu_hash are resource-first with no verb, and pricing / credits_balance are bare nouns, so conventions are mixed. Still readable overall, but not a predictable single scheme.

Tool Count5/5

11 tools is well inside the comfortable range and every tool earns its place: four free utility/meta tools (calendar, pricing, balance, NIF) plus seven paid domain operations. No obvious redundancy or filler.

Completeness4/5

The surface covers the full compliance lifecycle for Spanish e-invoicing: NIF validation, record hashing, chain and XML auditing, QR generation and verification, and Facturae build/validate with XSD checks. Minor gaps: there is no tool to emit the full VERI*FACTU submission XML or sign documents, and QR checking has no counterpart image-decoding step, but these are reasonably out of scope and workable around.

Maintenance

ActivityMaintained
ResponsivenessSyncing