bankstatementparser-mcp
Model Context Protocol server exposing the bankstatementparser library as first-class agent tools for reading bank statements.
README
<!-- SPDX-License-Identifier: Apache-2.0 -->
<p align="center"> <img src="https://cloudcdn.pro/bankstatementparser/v1/logos/bankstatementparser.svg" alt="bankstatementparser-mcp logo" width="120" height="120" /> </p>
<h1 align="center">bankstatementparser-mcp</h1>
<p align="center"> <b>Model Context Protocol server exposing the bankstatementparser library as first-class agent tools for reading bank statements.</b> </p>
<p align="center"> <a href="https://pypi.org/project/bankstatementparser-mcp/"><img src="https://img.shields.io/pypi/v/bankstatementparser-mcp?style=for-the-badge" alt="PyPI version" /></a> <a href="https://pypi.org/project/bankstatementparser-mcp/"><img src="https://img.shields.io/pypi/pyversions/bankstatementparser-mcp.svg?style=for-the-badge" alt="Python versions" /></a> <a href="https://pypi.org/project/bankstatementparser-mcp/"><img src="https://img.shields.io/pypi/dm/bankstatementparser-mcp.svg?style=for-the-badge" alt="PyPI downloads" /></a> <a href="https://github.com/sebastienrousseau/bankstatementparser-mcp/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/sebastienrousseau/bankstatementparser-mcp/ci.yml?branch=main&label=Tests&style=for-the-badge" alt="Tests" /></a> <a href="https://github.com/sebastienrousseau/bankstatementparser-mcp/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/sebastienrousseau/bankstatementparser-mcp/ci.yml?branch=main&label=Coverage&style=for-the-badge" alt="Coverage" /></a> <a href="#license"><img src="https://img.shields.io/pypi/l/bankstatementparser-mcp?style=for-the-badge" alt="License" /></a> <a href="https://glama.ai/mcp/servers/sebastienrousseau/bankstatementparser-mcp"><img src="https://glama.ai/mcp/servers/sebastienrousseau/bankstatementparser-mcp/badges/score.svg" alt="Glama MCP server score" /></a> </p>
Contents
Getting started
- What is bankstatementparser-mcp? — the problem it solves
- Install — PyPI, virtualenv, Docker
- Quick start — register with Claude Desktop in 30 seconds
Library reference
- Tools — the five tools, one resource, one prompt
- Using the tools — call them in-process from Python
Operational
- When not to use bankstatementparser-mcp — honest boundaries
- Development — gates, make targets
- Security — sandboxing posture
- Documentation — examples, guides
- Contributing — how to get changes in
- License — Apache-2.0
What is bankstatementparser-mcp?
The Model Context Protocol (MCP) is
an open standard that lets AI agents discover and call external tools in
a uniform way. bankstatementparser-mcp is the MCP server that turns the
bankstatementparser
library into first-class agent tools — so an assistant can read,
validate, and summarise bank statements in formats such as ISO 20022
CAMT.053, SWIFT MT940, OFX/QFX, and CSV directly from a conversation.
Every tool is a thin wrapper over the bankstatementparser parser core
(create_parser, detect_statement_format), so the results behave
identically to the CLI. Because an MCP client does not share the
server's filesystem, the tools take inline statement content (plus a
filename hint) and materialise it in a private temporary file for the
duration of a single call. Tools return JSON-serialisable data.
| Concern | How bankstatementparser-mcp handles it |
|---|---|
| Transport | stdio (FastMCP default); zero config beyond the client manifest |
| Input model | Inline content + filename hint; no shared filesystem required |
| Format fidelity | Tools delegate to bankstatementparser's create_parser pipeline |
| Format detection | detect_format mirrors the library's detect_statement_format |
| Validation | validate_statement is a dry run that returns structured results |
| Isolation | Each call writes to a private temp file that is deleted on exit |
Install
| Channel | Command | Notes |
|---|---|---|
| PyPI | pip install bankstatementparser-mcp |
Pulls in bankstatementparser >= 0.0.9 + MCP SDK |
| 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 |
Requires Python 3.10 or later. Works on macOS, Linux, and Windows.
<details> <summary>Using an isolated virtual environment (recommended)</summary>
python -m venv venv
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # Windows
python -m pip install -U bankstatementparser-mcp
</details>
Quick start
Register the server with any MCP client (Claude Desktop shown):
{
"mcpServers": {
"bankstatementparser": { "command": "bankstatementparser-mcp" }
}
}
That's it. Restart the client and the tools are available to the agent.
The server speaks JSON-RPC over stdin/stdout — it is meant to be launched by an MCP client, not used interactively.
Tools
All tools delegate to the bankstatementparser parser core, so they
behave identically to the library.
| Tool | Purpose |
|---|---|
list_supported_formats |
List every bank statement format the parser can read |
detect_format |
Detect which statement format an inline payload is |
parse_statement |
Parse a statement into structured transactions plus a summary |
validate_statement |
Dry-run check whether a statement parses cleanly |
summarize_statement |
Return only the statement summary (no per-transaction rows) |
Plus one resource and one prompt:
| Kind | Name | Purpose |
|---|---|---|
| Resource | bankstatementparser://formats |
Read-only catalogue of supported formats and their file extensions |
| Prompt | analyze_statement |
Guided multi-step prompt that walks an agent through reading and reconciling a statement |
Supported formats: camt (ISO 20022 CAMT.053, .xml), pain001
(ISO 20022 pain.001, .xml), csv (.csv), ofx (.ofx), qfx
(.qfx), and mt940 (SWIFT MT940, .mt940 / .sta).
Using the tools
The tools are plain functions on the bankstatementparser_mcp.server
module, 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
See the examples/ folder for runnable walkthroughs,
including 04_resource_and_prompt.py.
When not to use bankstatementparser-mcp
- You're not driving an MCP-aware agent. Use the
bankstatementparserCLI 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.
Development
bankstatementparser-mcp uses Poetry and
mise.
git clone https://github.com/sebastienrousseau/bankstatementparser-mcp.git
cd bankstatementparser-mcp
mise install
poetry install
A Makefile orchestrates the quality gates (kept in lockstep with CI):
| Target | What it runs |
|---|---|
make check |
All gates (REQUIRED before commit) |
make test |
pytest --cov=bankstatementparser_mcp --cov-branch --cov-fail-under=100 |
make lint |
ruff check + black --check |
make type-check |
mypy --strict |
make docs |
interrogate --fail-under=100 (docstring coverage) |
Current state (v0.0.11): 100% line + branch coverage against a 100%
enforced floor, mypy --strict clean, interrogate 100%.
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_statementare returned as structured{"is_valid": false, "error": ...}payloads — never as stack traces. - Dependencies are pinned via
poetry.lockand audited bypip-auditand Bandit in CI.
To report a vulnerability, please use GitHub private vulnerability reporting rather than a public issue.
Documentation
- Runnable examples:
examples/ - Release history: CHANGELOG.md
- MCP specification: modelcontextprotocol.io
Contributing
Contributions are welcome — see the
contributing instructions.
Thanks to all the
contributors
who have helped build bankstatementparser-mcp.
License
Licensed under the Apache License, Version 2.0. Any contribution submitted for inclusion shall be licensed as above, without additional terms.
<p align="center"> <a href="https://bankstatementparser.com">bankstatementparser.com</a> · <a href="https://pypi.org/project/bankstatementparser-mcp/">PyPI</a> · <a href="https://github.com/sebastienrousseau/bankstatementparser-mcp">GitHub</a> </p>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。