comdirect

io.github.mad4msv0.4.0更新于 Oct 10, 2026

Read-only access to comdirect bank accounts, transactions, depots and postbox documents.

已验证STDIO仅桌面Data & AnalyticsFinance

概览

AI 生成的概览

通过 MCP 客户端只读访问 comdirect 银行账户、交易、证券托管账户和信箱文档。

功能
将 MCP 客户端连接到 comdirect REST API,仅读取银行数据。工具涵盖登录与登出、账户与余额列表、资产总览、带服务端现金流汇总的交易、证券托管账户与持仓、投资组合配置汇总、卡片余额、订单与订单维度,以及信箱文档(含有限长度的 PDF 文本提取)。没有任何工具可以转账或下单。
适用场景
适合让助手查看自己的 comdirect 账户、支出、托管持仓或对账单,而无需手动登录网上银行。适合本地、注重隐私的环境,最好搭配本地模型,因为每个工具结果都会发送给 MCP 客户端背后的模型。
运行要求
通过 uvx 以 stdio 本地进程运行,需要 Python 的 uv 工具。需要 comdirect API 访问权限(在网上银行开发者访问中获取 Client ID 和 Client Secret)、Zugangsnummer 和 PIN,并将 photoTAN Push 设为默认 TAN 方式。可用 configure 命令将凭据存入操作系统钥匙串,或通过 COMDIRECT_CLIENT_ID、COMDIRECT_CLIENT_SECRET、COMDIRECT_USERNAME 和 COMDIRECT_PASSWORD 环境变量提供。
安装前请注意
它会处理银行凭据,并把财务数据发送给 MCP 客户端背后的模型;使用云端助手时这些数据会离开你的电脑。机密包括 COMDIRECT_CLIENT_ID、COMDIRECT_CLIENT_SECRET、COMDIRECT_USERNAME 和 COMDIRECT_PASSWORD,切勿写入会被提交的文件。登录需在 photoTAN 应用中批准。下载文档会在 comdirect 侧标记为已读。该项目为非官方项目,与 comdirect 无关联,API 或依赖可能发生变化。

安装

在 SourceWeft 中

  1. 打开 控制台中的 comdirect,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

comdirect-mcp

[PyPI] [Python] [Tests] [MCP] [License: MIT]

Read-only Model Context Protocol server and typed Python client for the comdirect REST API.

Let Claude, GitHub Copilot or any other MCP client look at your accounts, transactions, securities depot and postbox documents. The login is confirmed with your photoTAN app, and there is no tool that can move money.

[!WARNING] This is an unofficial project, not affiliated with comdirect. It handles your banking credentials and sends your financial data to the AI model you connect it to. Read the warning below and SECURITY.md.

Warnung (in Deutsch weil Comdirect)

Leute es geht hier um euer Geld. Nutzt diese Bibliothek nur, wenn ihr den Code versteht und euch den Risiken bewusst seid.

Ich bin auch nicht perfekt, aber übernehme keine Haftung für Schäden, die durch die Nutzung dieser Software entstehen. Falls Euch was auffällt, gern PRs oder Issues.

Die API und damit das Repo hier nutzen aktuell nur lesende Endpunkte, aber Fehler können immer passieren. Comdirect kann die API ändern, Dependencies können im Zweifel auch Mist bauen (Supply-Chain Attacks) und 2FA hilft zwar, ist aber kein Freifahrtschein.

Bitte:

  • Nutzt das nur lokal auf eurem eigenen Rechner.
  • Teilt eure Zugangsdaten mit niemandem.
  • Packt Secrets in .env und committet die Datei nie.
  • Nutzt die Pre-Commit Hooks um Secrets zu scannen. Gute Zeit bissel Devops-Kram zu lernen.
  • Spielt Updates nicht blind ein (Lockfile/Pinning hilft) und schaut bei Änderungen kurz drüber.

MCP-Server: Wenn ihr den Server an einen nicht-lokalen AI-Client hängt, gehen deine Daten raus. Je nach Client/Setup können Kontodaten/Transaktionen in Logs/Telemetry landen oder durch Prompt-Injection aus Dokumenten/Verwendungszwecken in komische Richtungen gehen (MCP Horror Stories: The GitHub Prompt Injection Data Heist). Nutzt MCP nur, wenn ihr der Umgebung wirklich vertraut, und gebt nur die Daten frei, die ihr dafür braucht.

Da der gemeine r/finanzen User eh schon seine Kontoauszüge in ChatGPT kopiert, könnt ihr damit machen, was ihr wollt, auf eure eigene Verantwortung!

Idealerweise ohne unnötige personenbezogene Daten. (Hauptsache, ihr lasst 'nen Stern da.)

Privacy: prefer a local model

The server runs on your machine, but every tool result is sent to the language model behind your MCP client. With cloud assistants (Claude, GitHub Copilot, ChatGPT, ...) your balances, transactions and documents leave your computer and are processed under that provider's data policy.

  • Most private: use an MCP client with a local model, e.g. LM Studio (supports MCP servers directly) or Ollama with the ollmcp client. Then nothing leaves your machine except the requests to comdirect. Pick a model with good tool-calling support.
  • With a cloud assistant: check its data retention and training settings, use an account where your data is not used for training, and ask only what you need.

Details: Privacy and security · Use a local model

Features

  • MCP specification 2026-07-28 on the official MCP Python SDK v2, with fallback for older clients
  • Push TAN login via elicitation: your client asks you to approve the login in the photoTAN app; the TAN never reaches the model
  • Credentials in the OS keychain: comdirect-mcp configure stores them once, client configs contain no secrets
  • No tool can move money: only read endpoints, truthful tool annotations, structured output with JSON schemas
  • Protects your access: stops logging in before comdirect's lock after five unconfirmed TAN challenges, and revokes the session at comdirect on logout and shutdown so it cannot be extended
  • Built for agents: compact results without empty fields, one counterparty instead of SEPA roles, cleaned-up payment texts, server-side summaries for cash flow questions
  • Privacy defaults: IBANs and account numbers masked, optional name pseudonyms, documents size-limited, untrusted-content hint for the model
  • Automatic token refresh and explicit session handling
  • Typed Python client (py.typed) for scripts and notebooks, independent of MCP
  • Listed in the MCP Registry as io.github.mad4ms/comdirect-mcp

Tools

ToolDescription
loginStarts a session; asks you to approve the push TAN
logoutEnds the session and revokes it at comdirect (no further refresh)
list_accountsAccounts with type (Girokonto, Tagesgeld, ...) and balances
get_wealth_overviewAll product balances with bank-supplied EUR totals, including loans and savings
list_depot_transactionsSecurities purchases, sales and transfers with filters and continuation
get_instrumentSecurity metadata; optional fund fees/ratings and derivative details
list_transactionsTransactions with date, amount, counterparty and cleaned-up purpose; compact by default
summarize_transactionsCash flow and spending per month, counterparty or type, computed on the server
list_cardsCard balances (Visa); the API has no card transactions
list_depotsSecurities accounts
get_depot_positionsPositions (name, ISIN, WKN, values, P&L) and depot balance
list_documentsPostbox documents (statements, order confirmations, tax documents)
download_documentA document as embedded resource (comdirect marks it as read)
get_account_balanceBalance and masked static data for one account
get_depot_positionOne securities position, with optional details
summarize_portfolioLargest positions and allocation percentages per currency
list_orders / get_orderRead the order book and individual orders; never place or change orders
get_order_dimensionsAvailable trading venues, currencies and order types
get_document_coverBounded plain text from the document pre-page
extract_document_textBounded PDF text with page continuation; downloading marks it as read

Arguments and results: Tools reference.

Quickstart

New to this? Follow the Getting started tutorial.

1. Prerequisites

  • uv (provides uvx)
  • comdirect API access: in the online banking under Verwaltung → Entwicklerzugang you get a Client ID and Client Secret (step by step)
  • photoTAN Push as your default TAN method

2. Store your credentials in the OS keychain

bash
uvx [email protected] configure

Prompts for Client ID, Client Secret, Zugangsnummer and PIN and stores them in the macOS Keychain, Windows Credential Manager or Linux Secret Service. Other options (VS Code inputs, environment, .env): Manage credentials.

3. Add the server to your MCP client

Claude Desktop (Settings → Developer → Edit Config) and LM Studio (Program → Install → Edit mcp.json):

json
{  "mcpServers": {    "comdirect": {      "command": "uvx",      "args": ["[email protected]"]    }  }}

Claude Code

bash
claude mcp add --transport stdio --scope user comdirect -- uvx [email protected]

VS Code (MCP: Open User Configuration)

json
{  "servers": {    "comdirect": {      "type": "stdio",      "command": "uvx",      "args": ["[email protected]"]    }  }}

Ollama (via ollmcp)

bash
uvx ollmcp mcp add --scope user comdirect -- uvx [email protected]uvx ollmcp -m <model>

Pinning the version (@0.5.0) means updates only happen when you decide. More clients: Configure MCP clients.

4. Ask

Wie haben sich meine Ausgaben im letzten Monat entwickelt, und welche Depotposition läuft am schlechtesten?

The assistant calls login, your phone receives the push TAN, you approve it and confirm the dialog in your client. Then the assistant can use the other tools. Problems: Troubleshoot.

Python library

The same client is available for your own scripts:

python
from comdirect_mcp import ComdirectClientfrom comdirect_mcp.utils import default_push_tan_callback
client = ComdirectClient(    {"client_id": "...", "client_secret": "...", "username": "...", "password": "..."},    {"push_tan_cb": default_push_tan_callback},)client.login()  # approve the push TAN, then press Enter
for account in client.list_accounts():    print(account.id, account.balance, account.currency)

See Use the Python library, the Python API reference and the examples.

Documentation

The documentation is organized as tutorial, how-to guides, reference and explanation:

SECURITY.md describes the threat model and how to report vulnerabilities, CHANGELOG.md lists the changes per release.

Contributing

Issues and pull requests are welcome, see CONTRIBUTING.md and the Code of Conduct. AI coding agents find their instructions in AGENTS.md.

Disclaimer

This project is not affiliated with, maintained, or endorsed by comdirect bank AG. Use it at your own risk. There is no warranty and no liability for any financial losses or damages resulting from its use.

The software runs locally and does not send your credentials anywhere except to comdirect. Your MCP client and its model provider receive the data the tools return.

License

MIT

来源:README.md,提交 e705941

工具

0
工具元数据尚未被收录。

版本历史

1
  1. v0.4.0最新Oct 10, 2026