Skip to main content

bankstatementparser-mcp logo

bankstatementparser-mcp

Model Context Protocol server that lets AI agents read, validate and summarise bank statements (CAMT.053, pain.001, MT940, OFX/QFX, CSV) through the bankstatementparser library.

Build Registry Docs OpenSSF Scorecard License: Apache-2.0 OR MIT Python 3.10+

A terminal running bankstatementparser-mcp --version (0.0.37), then the 01_mcp_tools.py and 02_validate_pipeline.py examples detecting, parsing, validating and summarising inline statements


Contents

Getting started

The bankstatementparser-mcp ecosystem

Library reference

Operational


Install

As a Python library

pip install bankstatementparser-mcp

That installs the bankstatementparser-mcp command, bankstatementparser >= 0.0.36 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.36 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.

Metadata

Release files for bankstatementparser-mcp 0.0.37

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bankstatementparser-mcp 0.0.37
File Size Uploaded Provenance Actions
bankstatementparser_mcp-0.0.37.tar.gz 33.1 kB With provenance Details for bankstatementparser_mcp-0.0.37.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bankstatementparser-mcp 0.0.37
File Interpreter ABI Platform Actions
bankstatementparser_mcp-0.0.37-py3-none-any.whl Python 3 none any Details for bankstatementparser_mcp-0.0.37-py3-none-any.whl

Total release size: 73.0 kB

Release files / bankstatementparser_mcp-0.0.37.tar.gz

Download URL bankstatementparser_mcp-0.0.37.tar.gz
Size 33.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1d65bcd0d0773226b0232ad7878e56ffbca5eb55f5e5374b27e8611e7e1298cb
BLAKE2b-256 checksum
How to use checksums
5e2ccbc1e0cf1f217f69902be2128f93a9193d15e35258a2340ee8cf1fd61793
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / bankstatementparser_mcp-0.0.37-py3-none-any.whl

Download URL bankstatementparser_mcp-0.0.37-py3-none-any.whl
Size 40.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78bf82826748c876d34d90e4a0256e36eee02ef8f4ae27e1960be873be3af727
BLAKE2b-256 checksum
How to use checksums
f6cf42c7a916d64de69ed87a868c44d8c4b6580a3082b5b57d71b113f00dc675
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for bankstatementparser-mcp 0.0.37

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bankstatementparser_mcp-0.0.37.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page