Skip to main content
Glama
norma43-mcp

norma43-mcp

norma43-mcp

MCP para extractos bancarios españoles Norma 43 (Cuaderno 43 / AEB43 / CSB43) y conciliación bancaria para agentes de IA. Cobro por créditos con KeyFlint.

Todos los bancos españoles exportan Norma 43; gestorías y departamentos financieros concilian cada mes. Este servidor lee el fichero como lo valida un banco y cruza movimientos con facturas sin adivinar nunca.

Herramientas

Tool

Créditos

Qué hace

parse_norma43

1

Cuentas, IBAN calculado, banco, titular, saldos, movimientos, textos 23 y campos SEPA (modalidad 3). Comprueba totales del registro 33, saldo inicial + movimientos = final, recuento del 88, fechas, signos y formatos.

norma43_to_csv

1

CSV listo para Excel español (;, coma decimal), protegido contra inyección de fórmulas.

reconcile_movements

3

Conciliación 1:1, 1:N (una transferencia paga varias facturas) y N:1 (pagos parciales). Puntuación 0-100, confianza y evidencias. Empates → ambiguous.

validate_identifier

0

IBAN, CCC, NIF/NIE/CIF, identificador de acreedor SEPA, Referencia 1.

sepa_direct_debits

2

Remesa de recibos SEPA (pain.008.001.02, Cuaderno 19.14 XML) para subir al banco: cuotas de la asesoría o recibos de los clientes. Valida cada IBAN, el identificador de acreedor y los mandatos; un recibo erróneo rechaza el fichero entero (gratis). Mismos datos, mismos bytes.

sepa_credit_transfers

2

Transferencias SEPA (pain.001.001.03, Cuaderno 34.14 XML): pagos a proveedores y nóminas en un solo fichero.

sepa_creditor_id

0

Identificador de acreedor SEPA (AT-02) a partir del NIF.

pricing, credits_balance

0

Precios y saldo de la licencia.

Precios configurables: NORMA43_PRICES="parse_norma43=2,reconcile_movements=5".

Importes: cadenas con 2 decimales; negativo = cargo (sale dinero), positivo = abono (entra).

Related MCP server: InvoiceOracle

Instalación

Solo necesitas tu licencia KeyFlint (LIC-...). La URL del gateway, su clave pública y el enlace de compra vienen por defecto.

Claude Desktop, 1 clic: descarga norma43-mcp-X.Y.Z.mcpb de la última release, ábrelo con doble clic y pega tu licencia. Sin terminal ni JSON.

Claude Code:

claude mcp add norma43 -e KEYFLINT_LICENSE=LIC-... -- uvx norma43-mcp

Cursor, Windsurf, Claude Desktop (JSON):

{
  "mcpServers": {
    "norma43": {
      "command": "uvx",
      "args": ["norma43-mcp"],
      "env": { "KEYFLINT_LICENSE": "LIC-..." }
    }
  }
}

Opcionales: KEYFLINT_URL, KEYFLINT_PUBLIC_KEYS (si no se pone, se descarga del gateway y se guarda en ~/.keyflint/keyring.json), KEYFLINT_CHECKOUT_URL.

Tarjetas visuales (MCP Apps)

En Claude, ChatGPT, VS Code y Goose cada herramienta de pago y credits_balance se muestran como una tarjeta interactiva en el chat: saldo de créditos con barra y botón para recargar, o resumen del resultado (cifras clave, incidencias, tabla de vista previa y créditos cobrados). Es el recurso ui://norma43/card.html, autocontenido y sin red. El resto de clientes siguen recibiendo el JSON de siempre.

Modo hosted (HTTP, licencia por petición)

docker build -t norma43-mcp .
docker run -p 8080:8080 \
  norma43-mcp

El cliente envía Authorization: Bearer LIC-... (o X-License-Key).

Variables: NORMA43_TRANSPORT (stdio|http), NORMA43_PRICES, NORMA43_MAX_BYTES (por defecto 5 MB), PORT, HOST.

Flujo de cobro por llamada

  1. Se decodifica y valida la entrada. Entrada ilegible u opciones inválidas: no se cobra.

  2. Se verifica la licencia (Ed25519, offline) antes de gastar CPU.

  3. Se parsea el fichero.

  4. Se descuentan los créditos (idempotente).

  5. Si la herramienta falla después del cobro, se reembolsa.

  6. Sin créditos: error -32062 con la URL de compra.

Reglas de conciliación

  • Céntimos enteros, sin coma flotante.

  • Evidencias: importe exacto (o dentro de amount_tolerance), referencia de factura en el concepto bancario, nombre de la contraparte, distancia de fechas y unicidad.

  • Una referencia solo cuenta con ≥4 caracteres; las numéricas, con ≥6 dígitos y límites de dígito.

  • Agrupaciones (1:N, N:1) solo si la suma exacta es única y hay evidencia de referencia o nombre; si no, van a suggestions.

  • Dos candidatos con la misma puntuación nunca se resuelven: van a ambiguous para revisión humana.

Limitaciones

  • La interpretación SEPA de los registros 23 (Anexo 4) solo se aplica en modalidad 3; en las demás se devuelve el texto tal cual.

  • El nombre del banco es informativo (tabla de las entidades principales).

  • Validado contra la especificación oficial (AEB/CECA/UNACC, junio 2012) y sus ejemplos, con ficheros generados por un escritor independiente; conviene probarlo con extractos reales de cada banco.

Tests

pip install -e ".[test]"
python -m pytest -q

Licencia

Business Source License 1.1. Código visible; el uso en producción requiere una licencia KeyFlint (o ser no comercial). Pasa a Apache 2.0 cuatro años después de cada versión. Ver LICENSE.

Available Tools

9 tools
credits_balanceCheck credit balanceB
Read-only
Inspect

Remaining credits on your KeyFlint license. Free.

Inputs: no named parameters. Returns: object

norma43_to_csvConvert Norma 43 to CSVA
Read-onlyIdempotent
Inspect

Convert a Norma 43 statement to CSV (one row per movement, with IBAN, running balance and concept names).

Defaults suit Spanish Excel (';' separator, decimal comma). Free-text cells are protected against spreadsheet formula injection. Integrity issues are returned alongside the CSV.

Inputs: content, delimiter, decimal_comma, content_base64. Returns: object

parse_norma43Read Norma 43 bank statementA
Read-onlyIdempotent
Inspect

Read a Spanish Norma 43 (Cuaderno 43 / AEB43 / CSB43) bank statement into structured JSON.

Returns every account (CCC, computed IBAN, bank, holder, period, opening/closing balance, debit/credit totals, breakdown by AEB common concept) and its movements (dates, signed amount, running balance, concept, references, record-23 texts, decoded SEPA fields in modalidad 3). Checks the file the way a bank does: record 33 counts and totals, opening + movements = closing, record 88 record count, dates, signs and field formats. valid is false when any error is found; each issue names its line.

Args: content: The file as text (paste the .n43/.txt content). content_base64: The raw file bytes as base64 (use for CP850/Latin-1 files with Ñ and accents). include_movements: False returns only accounts, totals and checks. max_movements: Cap on returned movements across all accounts (default 2000, max 20000).

Inputs: content, max_movements, content_base64, include_movements. Returns: object

pricingShow tool pricesA
Read-only
Inspect

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

Inputs: no named parameters. Returns: object

reconcile_movementsReconcile bank movements with invoicesA
Read-onlyIdempotent
Inspect

Bank reconciliation (conciliación bancaria): match bank movements to expected items, deterministically.

Bank side: a Norma 43 file (content / content_base64) or a movements list of {id, date, amount, text}. Expected side: expected list of {id, date, amount, reference?, counterparty?} such as issued invoices (+, cobros), supplier invoices or payroll (-, pagos), or ledger entries. Signs: + is money in, - is money out, as on the statement.

Finds 1:1 matches, one transfer paying several invoices (1:N) and partial payments (N:1). Each match has a 0-100 score, a confidence (alta/media/baja) and the evidence used (amount, invoice reference found in the bank concept, counterparty name, date distance, uniqueness). Ties are never guessed: they are returned under ambiguous. Weak candidates go to suggestions. Group matches require a unique exact sum plus reference or name evidence.

Args: expected: Items to find in the bank (max 5000). content: Norma 43 file as text (alternative to movements). content_base64: Norma 43 raw bytes as base64. movements: Bank movements if you do not have a Norma 43 file (max 5000). date_window_days: Max days between bank date and item date (default 10, max 180). amount_tolerance: Max amount difference accepted, e.g. "0.50" for bank fees (default "0", max "10"). max_group_size: Max items combined in 1:N / N:1 matches (1 disables grouping, max 5). min_score: Minimum score to confirm a match (default 50).

Inputs: expected (required), content, min_score, movements, +4 more. Returns: object

sepa_creditor_idBuild SEPA creditor identifierA
Read-onlyIdempotent
Inspect

Compute the Spanish SEPA creditor identifier (AT-02, 'identificador de acreedor') from a NIF. Free.

Format: ES + 2 check digits + 3-character business code (default '000') + NIF, per EPC262-08. Needed to issue SEPA direct debits (adeudos / remesas de recibos, Cuaderno 19.14).

Inputs: nif (required), business_code. Returns: object

sepa_credit_transfersBuild SEPA credit transfer batchA
Read-onlyIdempotent
Inspect

Transferencias SEPA: the pain.001.001.03 XML (Cuaderno 34.14) to pay suppliers or payroll in one upload.

Every IBAN is checked first; one wrong payment refuses the whole file with the reason (free).

Args: debtor: The paying company {"name", "iban", "bic" optional, "nif" optional}. execution_date: YYYY-MM-DD. payments: [{"name": "Proveedor XYZ SL", "iban": "ES...", "amount": "300.00", "concept": "Fra. 5521", "end_to_end_id": optional, "purpose": optional ISO code, e.g. SALA (nómina) or SUPP (proveedor)}]. created_at: Optional YYYY-MM-DDTHH:MM:SS; defaults to execution_date 09:00.

Inputs: debtor (required), payments (required), execution_date (required), created_at. Returns: object

sepa_direct_debitsBuild SEPA direct debit batch (remesa de recibos)A
Read-onlyIdempotent
Inspect

Remesa de recibos SEPA: the pain.008.001.02 XML (Cuaderno 19.14) Spanish banks accept for direct debits.

For despachos collecting monthly fees (cuotas) and for clients that charge their customers by recibo. Every IBAN, the creditor identifier and each mandate are checked first; one wrong recibo refuses the whole file with the reason (free), so a batch never reaches the bank half-wrong. Same input, same bytes.

Args: creditor: {"name": "Asesoría Pérez SL", "iban": "ES91...", "bic": optional, "creditor_id": "ES12000B..." or "nif": "B12345678" to compute it (business_code optional, default 000)}. collection_date: Requested collection date (YYYY-MM-DD). CORE needs it 1-2 business days ahead. debits: [{"name": "Talleres Ruiz SL", "iban": "ES...", "amount": "60.50", "mandate_id": "CUOTA-0012", "mandate_date": "2024-01-15", "concept": "Cuota marzo 2026", "end_to_end_id": optional, "sequence_type": optional per recibo}]. sequence_type: Default for all recibos: RCUR (recurring, default), FRST (first), OOFF (one-off), FNAL. scheme: CORE (consumers and companies, default) or B2B. created_at: Optional YYYY-MM-DDTHH:MM:SS; defaults to collection_date 09:00 so the file is reproducible.

Inputs: debits (required), creditor (required), collection_date (required), scheme, +2 more. Returns: object

validate_identifierValidate Spanish ID or IBANA
Read-onlyIdempotent
Inspect

Validate a Spanish/EU banking identifier. Free.

Recognises IBAN (any SEPA country, plus the inner CCC check for ES), CCC (20 digits, returns the IBAN), NIF/NIE/CIF (also ES-prefixed VAT numbers), SEPA creditor identifier (AT-02) and Norma 43 Referencia 1. Returns valid, the detected kind, normalized form and, when wrong, the expected control digits.

Args: value: The identifier, spaces and dashes allowed. kind: auto | iban | ccc | nif | creditor_id | reference1.

Inputs: value (required), kind. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 9 tools

    Disambiguation4/5

    Each tool targets a distinct artifact: Norma 43 parsing, CSV export, reconciliation, SEPA direct debits, SEPA credit transfers, and identifier validation. The only mild overlaps are pricing vs credits_balance (both billing-related) and reconcile_movements accepting Norma 43 content that parse_norma43 also consumes, but descriptions make the intent clear.

    Naming Consistency3/5

    Most names are readable snake_case, but the convention is mixed: verb_noun (reconcile_movements, parse_norma43, validate_identifier) sits alongside noun phrases (sepa_direct_debits, sepa_credit_transfers, credits_balance, pricing) and a format-conversion name (norma43_to_csv). The sepa_ prefix groups related tools, which helps, but there is no single predictable pattern.

    Tool Count5/5

    Nine tools is well within the sweet spot and each one maps to a concrete banking workflow (parse, convert, reconcile, generate two SEPA message types, validate identifiers, billing utilities). No tool looks redundant or like filler.

    Completeness4/5

    The surface covers the core Spanish banking lifecycle: reading Norma 43 statements, exporting them, reconciling against invoices, validating IBAN/CCC/NIF/creditor IDs, and generating pain.008 and pain.001 files. Gaps are minor for the stated scope — no camt.05x/pain.002 status or returns (devoluciones) handling and no way to inspect a generated remittance afterwards.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      136
      111 npm
      2
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to parse and analyze PDF invoices, including text, field, and table extraction, OCR for scanned documents, ZUGFeRD support, compliance validation, and batch processing via MCP.
      -
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to validate Mexican RFC, CURP, CLABE and NSS identifiers with real check digits, parse CFDI 4.0 invoices with labelled SAT catalogue codes and verified totals, and query the SAT's public status service to see whether an invoice is still valid. It also generates coherent test people and companies, all read-only and without API keys, certificates or PAC contracts.
      9
      108 npm
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to convert, build, validate, and transfer bookkeeping journals between Spanish accounting formats and spreadsheet CSV, including turning Norma 43 bank statements into journal entries.
      11
      66 PyPI
      Business Source 1.1