mcpField
B
bank-mcp

bank-mcp

Local
github.com/pritch56Finance1Updated 6d ago

About bank-mcp

bank-mcp is an unofficial MCP server for reading UK bank and card data through TrueLayer Open Banking. It is for users who want to query their own accounts from an MCP client; it requests read-only scopes and cannot move money.

Key features

  1. 01List linked banks and consent expiry
  2. 02Retrieve accounts and cards
  3. 03Read account balances
  4. 04Query transactions by date and page
  5. 05List pending transactions

Use cases

  1. 01Check bank and card balances in a client
  2. 02Filter account transactions by date
  3. 03Review pending transactions and consent expiry

MCP support

The MCP server provides five read-only tools for connections, accounts, balances, transactions, and pending transactions. It can connect to MCP clients over stdio or, as described in the README, run as a Cloudflare Access-protected remote Worker.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"pritch56-bank": {
"command": "uvx",
"args": [
"bank-mcp"
],
"env": {
"TRUELAYER_CLIENT_ID": "<TRUELAYER_CLIENT_ID>",
"TRUELAYER_CLIENT_SECRET": "<TRUELAYER_CLIENT_SECRET>",
"TRUELAYER_ENV": "<TRUELAYER_ENV>"
}
}
}
}
Run commanduvx bank-mcp
Environment variables to set
TRUELAYER_CLIENT_IDTrueLayer Console client id
TRUELAYER_CLIENT_SECRETSecretTrueLayer Console client secret
TRUELAYER_ENVlive (default) or sandbox

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
pypibank-mcp0.1.2

Tools

5

Saved tool list · updated 2w ago

This tool takes no parameters.

Details

From the project 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).

git clone https://github.com/pritch56/bank-mcp.git
cd bank-mcp
uv sync
uv 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:
export TRUELAYER_CLIENT_ID=your-client-id
export TRUELAYER_CLIENT_SECRET=your-client-secret
export 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.

# 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-nationwide
uv run bank-mcp-link --provider ob-nationwide --name nationwide

uv run bank-mcp-link --list               # linked banks and consent expiry
uv 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:

{
  "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
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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.