bank-mcp

io.github.pritch56由 GitHub 帳號 pritch56 發布v0.1.2更新於 Nov 3, 2026

Unofficial read-only MCP server for UK bank and card data via TrueLayer Open Banking

已驗證STDIO僅桌面資料庫金融

概覽

AI 產生的概覽

非官方唯讀 MCP 伺服器,透過 TrueLayer 開放銀行讓助理讀取你已連結的英國銀行與信用卡帳戶、餘額和交易。

可以做什麼
  • 列出已連結銀行及其授權到期時間與需重新連結狀態
  • 列出帳戶與信用卡,可依銀行暱稱篩選
  • 讀取餘額,可查全部銀行或單一帳戶
  • 依日期區間分頁列出交易,由舊到新
  • 列出尚未結算的待處理交易
適用情境
當你希望助理回答關於自己英國銀行與信用卡資料的問題——餘額、帳戶清單、近期或待處理交易——又不想讓它具備轉帳能力時使用。
執行需求
本機需 Python 3.11+ 及 uv 或 pip,提供 bank-mcp 與 bank-mcp-link 指令。需要免費的 TrueLayer Console 應用程式,啟用 Data API 相關權限並設定回呼網址 TRUELAYER_CLIENT_ID 與 TRUELAYER_CLIENT_SECRET;TRUELAYER_ENV 選擇 live(預設)或 sandbox。每家銀行需先透過瀏覽器登入完成一次連結。
安裝前請注意
伺服器環境需要你的 TrueLayer 用戶端密鑰(TRUELAYER_CLIENT_SECRET),切勿提交到版本庫。銀行存取權杖存放於 ~/.bank-mcp/tokens.json,需妥善保護。授權約 90 天到期,需重新連結。伺服器為唯讀且僅申請讀取權限,但屬非官方專案,與 TrueLayer 及任何銀行無關;連結真實帳戶前請先閱讀 SECURITY.md。帳戶資料會傳送給 TrueLayer 及助理。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 bank-mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

bank-mcp

Unofficial, read-only MCP server for your own UK bank and card data, via TrueLayer Open Banking. It can read accounts, cards, balances and transactions. It cannot move money: only read scopes are ever requested.

Not affiliated with TrueLayer or any bank. See SECURITY.md before linking real accounts.

Setup

Requires Python 3.11+ and uv (or pip).

bash
git clone https://github.com/pritch56/bank-mcp.gitcd bank-mcpuv syncuv run bank-mcp-link --help

Or install the package into any environment with pip install .; this provides the bank-mcp (server) and bank-mcp-link (bank linking) commands.

Get TrueLayer credentials

  1. Create a free account at the TrueLayer Console.
  2. Create an application and note its client ID and client secret. Start with the sandbox, then switch to live.
  3. In the application's settings, add this redirect URI: http://localhost:3000/callback (use the same port as --port if you change it).
  4. Make sure the Data API is enabled with these scopes: info accounts cards balance transactions offline_access.
  5. Export the credentials in the shell you run bank-mcp-link from:
bash
export TRUELAYER_CLIENT_ID=your-client-idexport TRUELAYER_CLIENT_SECRET=your-client-secretexport TRUELAYER_ENV=sandbox   # or "live" (the default)

Never commit these values. .env files are git-ignored.

Link a bank

bank-mcp-link opens your bank's sign-in page in the browser and stores the resulting tokens under a nickname of your choice. You can link several banks.

bash
# Sandbox (no real bank needed)uv run bank-mcp-link --provider mock --name test --sandbox
# A real bank: use its TrueLayer provider id, for example ob-nationwideuv run bank-mcp-link --provider ob-nationwide --name nationwide
uv run bank-mcp-link --list               # linked banks and consent expiryuv run bank-mcp-link --remove nationwide  # forget a bank

If the browser does not open, copy the URL printed in the terminal. Linking waits five minutes for the redirect.

UK Open Banking consent lasts 90 days. When it lapses, tools return Reconnect required for '<bank>'; run bank-mcp-link again for that bank.

Tokens are stored in ~/.bank-mcp/tokens.json, readable only by you.

Configure your MCP client

Replace /path/to/bank-mcp with your checkout. The server reads the same TRUELAYER_* credentials from its environment, and uses the provider id and environment recorded when each bank was linked.

Claude Desktop

Add to claude_desktop_config.json (Settings > Developer > Edit Config), then restart Claude Desktop:

json
{  "mcpServers": {    "bank": {      "command": "uv",      "args": ["run", "--directory", "/path/to/bank-mcp", "bank-mcp"],      "env": {        "TRUELAYER_CLIENT_ID": "your-client-id",        "TRUELAYER_CLIENT_SECRET": "your-client-secret",        "TRUELAYER_ENV": "live"      }    }  }}

Claude Code

bash
claude mcp add bank \  --env TRUELAYER_CLIENT_ID=your-client-id \  --env TRUELAYER_CLIENT_SECRET=your-client-secret \  --env TRUELAYER_ENV=live \  -- uv run --directory /path/to/bank-mcp bank-mcp

Host it on Cloudflare Workers

To run the server remotely instead of over stdio, see worker/README.md: a TypeScript Worker with Workers KV for tokens, protected by Cloudflare Access.

Tools

bank-mcp (stdio) exposes five read-only tools. Each except list_connections takes an optional bank nickname; leave it out to query every linked bank.

ToolReturns
list_connectionsLinked banks and consent expiry
list_accountsAccounts and cards
get_balanceBalances (optionally one account_id)
list_transactionssince/before dates, limit/offset paging, include_pending
list_pendingPending transactions

When all banks are queried, the working banks are still returned and the failing ones are listed under errors.

Configuration

VariableMeaning
TRUELAYER_CLIENT_ID / TRUELAYER_CLIENT_SECRETTrueLayer Console credentials (required)
TRUELAYER_ENVlive (default) or sandbox
TRUELAYER_PROVIDER_IDProvider id; set automatically per bank by bank-mcp-link
BANK_TOKEN_FILEToken file path (default ~/.bank-mcp/tokens.json)
BANK_MAX_RANGE_DAYSLongest date range a single transaction query may span
BANK_TRUELAYER_REFRESH_TOKENOptional refresh-token seed

Development

See CONTRIBUTING.md. Release history is in CHANGELOG.md.

Licence

MIT

來源:README.md,提交 f5a0f02

工具

5

list_connections

List linked banks with consent expiry. Banks needing re-linking say 'reconnect_required'.

無需輸入參數。

list_accounts

List accounts and cards. `bank` is a nickname; omit it to query all linked banks.

輸入參數bank

get_balance

Balances. `bank` is a nickname (omit for all banks); `account_id` narrows to one account.

輸入參數bankaccount_id

list_transactions

Transactions with since <= date < before (ISO dates; default the last 30 days), oldest first. Page with `limit` and `offset`; `next_offset` is null on the last page.

輸入參數banklimitsincebeforeoffsetaccount_idinclude_pending

list_pending

Pending (not yet settled) transactions. `bank` is a nickname; omit it for all banks.

輸入參數banklimitoffsetaccount_id

版本歷史

1
  1. v0.1.2最新Oct 29, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分