facturas-inbox-mcp

v0.1.0
io.github.pedrozapatadev/facturas-inbox-mcp Checked 1 day ago Published 1 month ago

Spanish invoice PDFs to validated data: NIF/IVA/IRPF extraction, arithmetic checks, IVA per quarter.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

scan_folder Scan a folder of documents

Classify every PDF/TXT in a folder and extract invoice fields in one call. Returns one compact row per document (type, status, number, date, NIFs, amounts, failed checks). Paginated: pass next_cursor to continue. Use this first to triage a folder; use extract_invoice for full detail on a single document.

ParameterTypeDescription
cursorstringnext_cursor from a previous call
folderstringFolder to read. Absolute, or relative to the first allowed folder. Defaults to the first allowed folder.
limitintegerDocuments per page
recursivebooleanInclude subfolders

classify_document Classify a document

Label one document as invoice, credit_note (factura rectificativa), simplified_invoice (ticket), payroll (nómina), tax_form (modelo AEAT), bank_statement or other, with a confidence score and the signals behind the label.

ParameterTypeDescription
path *stringPath to a .pdf or .txt document. Absolute, or relative to the first allowed folder.

extract_invoice Extract invoice fields

Extract invoice number, issue date, issuer/recipient NIF/CIF, taxable base, VAT lines, IRPF withholding and total from one document, then cross-check them (NIF checksum, base × rate = VAT, base + VAT − IRPF = total). status is 'ok' only when every check passes. Non-invoices are skipped unless force is true. response_format 'concise' lists only failed checks; 'detailed' adds every check, classifier signals and a text preview.

ParameterTypeDescription
path *stringPath to a .pdf or .txt document. Absolute, or relative to the first allowed folder.
forcebooleanExtract even if the document does not look like an invoice
response_formatstring

validate_tax_id Validate a Spanish tax ID

Check a Spanish NIF (DNI), NIE or CIF with the official control-character algorithm. Accepts spaces, hyphens and an 'ES' VAT prefix. Says which kind it is and, when invalid, what the control character should be. Offline: it does not confirm the ID is registered with AEAT or VIES.

ParameterTypeDescription
tax_id *stringe.g. 'B12345674', '12345678-Z', 'ES X1234567L'

vat_summary Summarize VAT for a period

Total IVA repercutido (issued invoices) and IVA soportado (received invoices) for one taxpayer over a period, broken down by rate, plus the net figure. Direction comes from whether own_tax_id is the issuer or the recipient. Only invoices whose checks all pass are counted; everything else is listed under 'excluded' with a reason. Give either quarter (e.g. '2026-Q3') or from + to.

ParameterTypeDescription
own_tax_id *stringNIF/CIF of the business whose VAT position you want
folderstringFolder to read. Absolute, or relative to the first allowed folder. Defaults to the first allowed folder.
fromstringStart date, inclusive (YYYY-MM-DD)
quarterstringCalendar quarter, e.g. '2026-Q3'
recursiveboolean
tostringEnd date, inclusive (YYYY-MM-DD)

export_csv Export a folder to CSV

Scan a folder and write one row per document to a new CSV file (semicolon-separated, decimal comma, UTF-8 with BOM: opens directly in Spanish-locale Excel). Returns the file path and row counts, not the data. Never overwrites: fails if the file already exists. The output must be inside an allowed folder.

ParameterTypeDescription
output_path *stringWhere to write the .csv. Absolute, or relative to the first allowed folder.
folderstringFolder to read. Absolute, or relative to the first allowed folder. Defaults to the first allowed folder.
recursiveboolean