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

7 tools
credits_balanceA
Read-only
Inspect

Remaining credits on your KeyFlint license. Free.

Inputs: no named parameters. Returns: object

norma43_to_csvB
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_norma43A
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

pricingA
Read-only
Inspect

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

Inputs: no named parameters. Returns: object

reconcile_movementsA
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_idA
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

validate_identifierA
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.8/5.0

    Scored across 7 tools

    Disambiguation4/5

    Each tool has a distinct primary purpose: parsing to JSON, converting to CSV, reconciling, validating identifiers, computing a creditor ID, and two billing/meta tools. The only mild overlaps are parse_norma43 vs norma43_to_csv (same input, different output shape) and validate_identifier (which validates a creditor ID) vs sepa_creditor_id (which computes one), but descriptions make the boundaries clear.

    Naming Consistency3/5

    Four tools follow a clear verb_noun snake_case pattern (parse_norma43, reconcile_movements, validate_identifier, sepa_creditor_id), but norma43_to_csv uses a noun_to_format pattern and pricing / credits_balance are noun-only with no verb. Readable overall, but the convention breaks in three of seven names.

    Tool Count5/5

    Seven tools is well within a comfortable range and each earns its place: core parsing, export, reconciliation, two identifier utilities, plus pricing and balance helpers. Nothing feels redundant or padding.

    Completeness3/5

    The read/validate/reconcile/export lifecycle for Spanish bank statements is covered, but there is no tool to generate or write a Norma 43 file and nothing for Cuaderno 19 (remesas/adeudos) despite the creditor-ID tool pointing that direction. Agents hitting a 'produce a statement or remittance' workflow will dead-end.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    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
      480 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
      280 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
      Business Source 1.1