Skip to main content
Glama
bankstatementparser-mcp

bankstatementparser-mcp


Contents

Getting started

The bankstatementparser-mcp ecosystem

Library reference

Operational


Related MCP server: MCP Toolkit Server

Install

As a Python library

pip install bankstatementparser-mcp

That installs the bankstatementparser-mcp command, bankstatementparser >= 0.0.35 and the MCP SDK.

Channel

Command

Notes

PyPI

pip install bankstatementparser-mcp

Add [langchain] for the LangChain adapter

Source

git clone https://github.com/sebastienrousseau/bankstatementparser-mcp && cd bankstatementparser-mcp && poetry install

For development

Docker (GHCR)

docker pull ghcr.io/sebastienrousseau/bankstatementparser-mcp:latest

Multi-arch (linux/amd64, linux/arm64); runs bankstatementparser-mcp over stdio; pass --transport streamable-http --host 0.0.0.0 and publish port 8000 for HTTP

An isolated virtual environment keeps the server's dependencies apart:

python -m venv venv
source venv/bin/activate        # macOS/Linux
venv\Scripts\activate           # Windows
python -m pip install -U bankstatementparser-mcp

MCP Registry

The server is listed in the MCP Registry under this name, which the registry checks against this README:

mcp-name: io.github.sebastienrousseau/bankstatementparser-mcp

Shell completions

Bash and zsh completions for the command line live in completions/, generated from the server's own argument parser (make completions).

Packaging status

Packaging status

Repology lists every repository that packages bankstatementparser-mcp. PyPI and GHCR are the channels this project publishes to itself.


Requirements

  • Python 3.10 or later. CI tests CPython 3.10, 3.11, 3.12, 3.13 and 3.14 on Linux, macOS and Windows; docs/POLICIES.md says when the floor moves.

  • bankstatementparser 0.0.35 or later, the parser core every tool delegates to.

  • The MCP SDK, mcp >= 1.30 on the 1.x line or >= 2.2 on 2.x (2.0 and 2.1 are excluded for GHSA-84m7-p3x7-pcfv).

  • An MCP client (Claude Desktop, Claude Code, an IDE, or an agent framework) to launch it. The Docker image needs only a container runtime.


Quick Start

{
  "mcpServers": {
    "bankstatementparser": { "command": "bankstatementparser-mcp" }
  }
}

Add this to your MCP client's configuration (Claude Desktop shown) and restart the client: the five tools, the resource and the prompt are then available to the agent. By default the server speaks JSON-RPC over stdin/stdout, so it is meant to be launched by an MCP client, not used interactively. For a shared deployment over HTTP, see Configuration.


The bankstatementparser-mcp ecosystem

bankstatementparser-mcp is the agent-facing layer of the bankstatementparser suite, whose packages ship one version together, and the multi-format ingestion server of the ISO 20022 MCP servers. Dependency ranges are kept aligned, so the servers co-install in one Python environment. The full tables are in The suite.

Component

Purpose

Use case

bankstatementparser

The parser core: CAMT, pain.001, CSV, OFX, QFX, MT940 and PDF statements

Parsing statements from Python or the CLI

bankstatementparser-mcp

This server: five MCP tools, one resource, one prompt

An agent reading statements in mixed or legacy formats

bankstatementparser-lsp

Language server with live MT940 diagnostics

Editing MT940 files

Loaders, writers and transport

BAI2, MT942, CFONB, CAMT.054, SEPA and BACS loaders; XLSX, QIF, OFX and SWIFT writers; EBICS transport

Formats beyond the core, and retrieval over EBICS

camt053-mcp

ISO 20022 camt.053/camt.052 statements end to end

Deep camt.05x work

reconcile-mcp

Matches pain.001 payments against camt.053 entries

Statement and payment reconciliation


Capabilities at a glance

Area

Capability

Status

Tools

list_supported_formats, detect_format, parse_statement, validate_statement, summarize_statement

Shipped

Resource

bankstatementparser://formats, the supported-format catalogue

Shipped

Prompt

analyze_statement, a guided read-and-reconcile walkthrough

Shipped

Formats

camt, pain001, csv, ofx, qfx, mt940

Shipped

Transports

stdio; streamable HTTP (2026-07-28 and 2025-11-25); HTTP+SSE (2024-11-05)

Shipped

Adapters

LangChain, CrewAI, LlamaIndex tool objects

Shipped

Distribution

PyPI wheel and sdist, multi-arch GHCR image, MCP Registry entry

Shipped


Ecosystem comparison

The choice is between this server, the library it wraps, and a deeper single-format server. Every cell comes from the projects' own READMEs.

Project

Input formats

Interface

Input model

bankstatementparser-mcp

CAMT.053, pain.001, MT940, OFX, QFX, CSV

MCP (stdio, streamable HTTP, SSE)

Inline content and a filename hint

bankstatementparser

The same, plus PDF

Python library and CLI

Paths on disk

camt053-mcp

camt.053/camt.052

MCP (stdio, authenticated streamable HTTP)

Tool arguments

See docs/COMPARISON.md for the evidence and complete matrix.


Benchmarks

benches/bench_detect_and_parse.py times detect_format and parse_statement on generated statements. Detection costs 5 to 11 ms per call whatever the size, because it peeks at the head of the document; parsing grows with the document.

Scenario

Result

Environment

detect_format, CAMT.053, 2,000 entries (530 KiB)

6.6 ms

Apple M1 Pro, macOS 27.2.1, CPython 3.12.16

parse_statement, CAMT.053, 2,000 entries (530 KiB)

132.8 ms

Apple M1 Pro, macOS 27.2.1, CPython 3.12.16

parse_statement, MT940, 2,000 entries (132 KiB)

40.7 ms

Apple M1 Pro, macOS 27.2.1, CPython 3.12.16

parse_statement, CSV, 2,000 entries (82 KiB)

9.4 ms

Apple M1 Pro, macOS 27.2.1, CPython 3.12.16

See docs/BENCHMARKS.md for methodology and full results.


Features

  • bankstatementparser_mcp.server: the MCP server. Five tools (list_supported_formats, detect_format, parse_statement, validate_statement, summarize_statement), one resource and one prompt. Every tool is a thin wrapper over the bankstatementparser parser core (create_parser, detect_statement_format), so results behave identically to the library.

  • Inline content. An MCP client does not share the server's filesystem, so the tools take the statement text plus a filename hint and write it to a private temporary file for the duration of one call.

  • Errors as data. detect_format, parse_statement and summarize_statement refuse an unparseable payload with a ToolError naming the filename and the parser's reason; validate_statement returns {"is_valid": false, "error": ...} instead of raising.

  • bankstatementparser_mcp.adapters: the same tools as LangChain, CrewAI and LlamaIndex tool objects, each framework imported only when its adapter is called.

  • bankstatementparser_mcp._cli and _transports: the command line shared by the suite's servers, and the stdio, streamable HTTP and SSE launchers.

  • bankstatementparser_mcp._mcp_compat: one codebase on MCP SDK 1.x (FastMCP) and 2.x (MCPServer).

The tools, resource and prompt are described in full in the manual.


Configuration

The server has no configuration file and reads no environment variables. Everything is a command-line flag:

Flag

Default

Effect

--transport

stdio

stdio, streamable-http (HTTP at /mcp) or sse (HTTP+SSE at /sse and /messages/)

--host

127.0.0.1

Interface the HTTP transports bind

--port

8000

Port the HTTP transports bind

--version

Print the version and exit

The HTTP transports carry no authentication of their own: bind loopback, or put the server behind a gateway you trust before binding a routable address. A client registers the HTTP endpoint with {"mcpServers": {"bankstatementparser": {"url": "http://127.0.0.1:8000/mcp"}}}. See Transports and ADR 0001.


Examples

The tools are plain functions on bankstatementparser_mcp.server, so you can call them in-process:

from bankstatementparser_mcp.server import (
    detect_format,
    parse_statement,
    summarize_statement,
)

csv = (
    "date,description,amount,currency,balance\n"
    "2023-01-02,Salary,500.00,EUR,1500.00\n"
    "2023-01-03,Groceries,-40.50,EUR,1459.50\n"
)

# 1. Detect the format from the filename hint + content.
print(detect_format(csv, "statement.csv"))
# -> csv

# 2. Parse the statement into structured rows + a summary.
parsed = parse_statement(csv, "statement.csv")
print(parsed["transaction_count"], parsed["columns"])

# 3. Read just the opening/closing balances.
print(summarize_statement(csv, "statement.csv"))

The resource and prompt are plain functions too: formats_resource backs bankstatementparser://formats, and analyze_statement returns the guided multi-step prompt.

from bankstatementparser_mcp.server import (
    analyze_statement,
    formats_resource,
)

print(formats_resource())          # the supported-formats catalogue
print(analyze_statement("statement.csv"))  # the guided analysis prompt

examples/ holds four runnable walkthroughs, each run in CI:

Example

Demonstrates

01_mcp_tools.py

list_supported_formats, detect_format and parse_statement

02_validate_pipeline.py

validate_statement then summarize_statement before trusting a statement

03_parse_bank_replies.py

Detecting and parsing an inline SWIFT MT940 statement

04_resource_and_prompt.py

The bankstatementparser://formats resource and the analyze_statement prompt


When not to use bankstatementparser-mcp

  • You're not driving an MCP-aware agent. Use the bankstatementparser CLI or library directly: it exposes the same surface with less indirection.

  • You need to parse files already on disk in bulk. The library's CLI reads paths directly and avoids the inline-content round trip the MCP tools use.

  • You need authentication on the HTTP transports. The server adds none; it belongs on loopback or behind a gateway you trust.

  • Your format is not one of the six. BAI2, MT942, CFONB, CAMT.054, SEPA and BACS are read by the suite's loader packages, not by this server.


Development

git clone https://github.com/sebastienrousseau/bankstatementparser-mcp.git
cd bankstatementparser-mcp
mise install
poetry install
make check

make check runs the local gates: ruff and black, mypy --strict, the complexity baseline (scripts/check_complexity.py), pytest with a 100% line + branch coverage floor, interrogate at 100% docstring coverage, and the examples. Other targets: make fuzz (Atheris, 60 s, Linux x86_64 with Python 3.12+), make docs (the MkDocs manual, --strict), make completions, make demo (re-renders the GIF above with VHS from .github/demo.tape) and make security (Bandit). CI adds the OS by Python matrix, the Docker build, CodeQL, pip-audit on the locked requirements, the Docs Lint gates, and MCP protocol conformance. CONTRIBUTING.md covers branches, commit signing and sign-off.


Security

  • No persistent filesystem writes from tools. Each call writes the inline content to a private temporary file that is deleted as soon as the call returns.

  • Validation failures from validate_statement are returned as structured {"is_valid": false, "error": ...} payloads, never as stack traces.

  • Loopback by default. The HTTP transports bind 127.0.0.1 unless --host says otherwise.

  • Fuzzing. fuzz/fuzz_tools.py drives every payload-taking tool with Atheris in CI and fails on any exception other than the ToolError the tools promise.

  • Supply chain. Dependencies are locked in poetry.lock, CI installs hash-pinned exports of it, and pip-audit, Bandit and CodeQL run on every change. Releases publish to PyPI through OIDC trusted publishing and carry cosign signatures, SLSA provenance and SBOMs; every workflow action is pinned by commit SHA except the SLSA generator, which must be referenced by tag.

Report vulnerabilities according to SECURITY.md.


Documentation


Stability guarantees

  • Versioning. Releases stay on the 0.0.x line and step by exactly 0.0.1, in lockstep with the rest of the bankstatementparser suite. Under SemVer a 0.0.x release may break anything; this project names each break in the CHANGELOG instead.

  • The breaking axis is the MCP surface: tool, resource and prompt names, their arguments, and the shape of what they return. Renaming or removing any of them, or changing a returned field, is a breaking change and is called out in the CHANGELOG, even though no Python signature moves.

  • Output stability. Parsing is deterministic: the same statement and filename hint give the same result on the same bankstatementparser version. A change in what a tool returns for the same input is treated as breaking.

  • Command line. --transport, --host, --port and --version keep their names and defaults; the shell completions are regenerated from the parser so they cannot drift.

  • Minimum toolchain. Python 3.10 is the floor; it moves only in a release, for the whole suite at once, with the reason in the CHANGELOG (docs/POLICIES.md).


License

Dual-licensed under Apache License, Version 2.0 or MIT, at your option (SPDX-License-Identifier: Apache-2.0 OR MIT). Any contribution submitted for inclusion in the work shall be dual-licensed as above, without additional terms or conditions.

Available Tools

5 tools
detect_formatDetect statement formatA
Read-onlyIdempotent

Detect which bank statement format an inline payload is.

Use this when you hold statement text but do not yet know its format,
to resolve the ``format`` identifier from the content plus filename
hint. Once the format is known, use ``parse_statement`` to read the
transactions.

Args:
    content: The raw statement text.
    filename: Original filename; its extension is the primary hint.

Returns:
    The detected format identifier.

Raises:
    ToolError: If the format cannot be detected.

Inputs: content (required), filename. Returns: result

list_supported_formatsList supported statement formatsA
Read-onlyIdempotent

List every bank statement format identifier this server can parse.

Use this first to discover the valid ``format`` strings accepted by
``detect_format``, ``parse_statement``, ``validate_statement``, and
``summarize_statement``. For the file extensions and a human-readable
description of each format, read the ``bankstatementparser://formats``
resource instead.

Returns:
    The supported format identifiers.

Inputs: no named parameters. Returns: result

parse_statementParse statement transactions and summaryA
Read-onlyIdempotent

Parse an inline statement payload into transaction rows and a summary.

Use this to read the full transaction detail plus the statement
balances from a payload. When you only need the balances/totals use
``summarize_statement`` instead, and to merely confirm a payload parses
without returning any rows use ``validate_statement``.

Args:
    content: The raw statement text.
    filename: Original filename; its extension selects the format
        when ``format`` is omitted.
    format: Explicit format override.
    limit: Optional cap on returned transaction rows.

Returns:
    A dict with the resolved ``format``, ``columns``, full
    ``transaction_count``, the (possibly truncated) ``transactions``
    as row dicts, and the statement ``summary``.

Raises:
    ToolError: If the format is unsupported, cannot be detected, or
        the payload does not parse.

Inputs: content (required), limit, format, filename. Returns: object

summarize_statementSummarize statement balancesA
Read-onlyIdempotent

Summarize an inline statement's balances and totals only.

Use this when you need just the opening/closing balances, currency, and
other summary fields without the per-transaction rows. For the full
transaction detail alongside the summary, use ``parse_statement``
instead.

Args:
    content: The raw statement text.
    filename: Original filename; its extension selects the format.
    format: Explicit format override.

Returns:
    The summary record with Decimal values stringified.

Raises:
    ToolError: If the format is unsupported, cannot be detected, or
        the payload does not parse.

Inputs: content (required), format, filename. Returns: object

validate_statementValidate statement (dry run)A
Read-onlyIdempotent

Dry-run parse an inline statement to check it parses cleanly.

Use this to confirm a payload is well-formed and parseable before
committing to a full read; it returns a structured pass/fail with the
transaction count but never the rows themselves, and never raises on a
parse error. To actually read the transactions use ``parse_statement``.

Args:
    content: The raw statement text.
    filename: Original filename; its extension selects the format.
    format: Explicit format override.

Returns:
    A dict with ``is_valid``, the resolved ``format``, the
    ``transaction_count`` on success, and an ``error`` on failure.

Inputs: content (required), format, filename. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.6/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a distinct role: discovery, format detection, full parse, summary-only, and validation dry-run. The descriptions explicitly cross-reference each other (e.g. use summarize_statement instead of parse_statement when you only need balances), leaving no realistic chance of misselection.

    Naming Consistency5/5

    All five tools are snake_case verb_noun identifiers that map cleanly onto their action (list_, detect_, parse_, summarize_, validate_ + format/statement). The pattern is predictable and self-describing.

    Tool Count5/5

    Five tools is a tight, well-scoped surface for a statement parser: discovery, detection, parse, summarize, validate. Each tool earns its place and none is redundant padding.

    Completeness4/5

    The read-side lifecycle is well covered (list formats, detect, validate, parse, summarize) with no dead ends. Minor gaps: only inline payloads are accepted (no file path or URL input), and there is no export/conversion operation, though these are reasonable omissions for a read-only parser.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers