Skip to main content

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.

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

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.

Tool Returns
list_connections Linked banks and consent expiry
list_accounts Accounts and cards
get_balance Balances (optionally one account_id)
list_transactions since/before dates, limit/offset paging, include_pending
list_pending Pending transactions

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

Configuration

Variable Meaning
TRUELAYER_CLIENT_ID / TRUELAYER_CLIENT_SECRET TrueLayer Console credentials (required)
TRUELAYER_ENV live (default) or sandbox
TRUELAYER_PROVIDER_ID Provider id; set automatically per bank by bank-mcp-link
BANK_TOKEN_FILE Token file path (default ~/.bank-mcp/tokens.json)
BANK_MAX_RANGE_DAYS Longest date range a single transaction query may span
BANK_TRUELAYER_REFRESH_TOKEN Optional refresh-token seed

Development

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

Licence

MIT

Metadata

Release files for bank-mcp 0.1.1

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

Source distribution (sdist)

Source distribution for bank-mcp 0.1.1
File Size Uploaded Provenance
bank_mcp-0.1.1.tar.gz 111.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bank-mcp 0.1.1
File Interpreter ABI Platform
bank_mcp-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 145.1 kB

Release files / bank_mcp-0.1.1.tar.gz

Download URL bank_mcp-0.1.1.tar.gz
Size 111.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0d2544698f0b0a0a6394c3a283d5b70426781a329ee157b1bdf90554d8825879
BLAKE2b-256 checksum
How to use checksums
966d462fc7bf826e6fa7d0864e99849790877d487a8c02cc232b83f4cc703cd4
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 Oct 27, 2026.

Transparency log

Release files / bank_mcp-0.1.1-py3-none-any.whl

Download URL bank_mcp-0.1.1-py3-none-any.whl
Size 34.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
216b7643cb9de691eb71ce985e069b1dfaedb641be083a3dbd19061b787167ba
BLAKE2b-256 checksum
How to use checksums
ade8e79046ad46d8345d24b07b4dc07bbb38d00f88c1255931fae07b576e25a8
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 Oct 27, 2026.

Transparency log

Security for bank-mcp 0.1.1

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bank_mcp-0.1.1.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 Oct 27, 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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