An experimental project connecting TrueLayer APIs and an AI assistant, like Claude AI.
This project provides a Truelayer Model Context Protocol (MCP) server that enables an AI assistant, like Claude AI, to interact with TrueLayer's financial APIs. It allows the AI assistant to perform various banking and payment operations through TrueLayer's services.
⚠️ DISCLAIMER⚠️
This project is for demonstration purposes only. It is not officially supported or maintained by TrueLayer, does not form a part of the services we contractually provide you with and we are not responsible for the outcome of your use. Use at your own risk. This integration may break with API changes.
By using this MCP server with an external LLM you are trusting an external third party with the handling of the data retrieved from the TrueLayer API.
The integration allows an AI assistant to execute some of the TrueLayer actions directly from the assistant chat.
These functions allow you to perform common payment operations like retrieving account information, creating payment links for customers, sending payouts to beneficiaries, and reviewing transaction history.
Given that AI assistants may not always produce deterministic behaviors, and for safe and isolated testing, we recommend testing the MCP server in the TrueLayer Sandbox environment.
The server covers part of the TrueLayer API. 🟡 means some operations are available and others aren't; ❌ means the product isn't covered at all. The "Not covered" column lists the main gaps and isn't exhaustive; see the TrueLayer API reference for everything each product offers.
| Product | Status | Tools | Not covered |
|---|---|---|---|
| Payments | 🟡 | truelayer-get-payment |
Creating a payment directly (outside a payment link), choosing the bank for the user, the authorization flow, cancelling, refunds, listing payments |
| Payment links | 🟡 | truelayer-create-payment-link, truelayer-get-payment-link |
Links other than single payments, listing a link's payments, disabling a link |
| Payouts | 🟡 | truelayer-create-payout, truelayer-get-payout |
Payouts to anything other than an external account (back to a payment source, to a business account), cancelling, listing payouts |
| Merchant accounts | 🟡 | truelayer-get-merchant-account, truelayer-list-merchant-accounts, truelayer-list-transactions |
Payment sources, sweeping |
| Mandates and variable recurring payments (VRP) | ❌ | Creating, getting, listing and revoking mandates, funds checks, constraints, payments under a mandate | |
| Data API (account information) | ❌ | Accounts, balances, transactions, cards and standing orders, and the user consent flow they require | |
| Verification | ❌ | Account holder name verification | |
| Signup+ | ❌ | Identity data for onboarding | |
| Providers | ❌ | Searching for and looking up banks | |
| Webhooks | ❌ | Status change notifications; the tools poll instead, as a local stdio server can't receive webhooks |
The payout tools need the paydirect token scope, which is only available if Payouts is enabled on your client (see TRUELAYER_TOKEN_SCOPE below).
- Node.js (v22 or later)
- npm or yarn
- A TrueLayer account with API credentials
- Clone this repository:
git clone <repository-url>
cd truelayer_mcp- Install dependencies:
npm install- Configure your TrueLayer credentials. The server reads them from environment variables, or from a
.envfile in the project root (next topackage.json):
cp .env.example .envFill in .env:
| Variable | Required | Description |
|---|---|---|
TRUELAYER_ENV |
no | sandbox (default) or production |
TRUELAYER_CLIENT_ID |
yes | Client ID from the Console |
TRUELAYER_CLIENT_SECRET or TRUELAYER_CLIENT_SECRET_FILE |
yes | Client secret, inline or as a path to a file containing it |
TRUELAYER_KID |
yes | Key ID of the signing public key uploaded to the Console |
TRUELAYER_PRIVATE_KEY_FILE or TRUELAYER_PRIVATE_KEY |
yes | EC P-521 signing private key, as a path or inline PEM (\n for line breaks) |
TRUELAYER_MERCHANT_ACCOUNT_ID |
yes | Default merchant account for the tools |
TRUELAYER_TOKEN_SCOPE |
no | Token scopes, default paydirect payments. Use payments if Payouts isn't enabled on your client (the token request otherwise fails with invalid_scope). |
TRUELAYER_ENV_FILE |
no | Load the .env file from another path |
Variables already set in the environment take precedence over .env. The server checks the configuration at startup and exits listing anything missing. .env is gitignored; prefer the _FILE variants so secrets stay in files only you can read (chmod 600).
- Build the project:
npm run buildThe project uses Biome for linting and formatting:
npm run lint # check lint and formatting
npm run fix # apply safe fixes and formatTo use this MCP server with Claude Desktop:
-
Locate your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add the TrueLayer MCP server to your configuration:
{
"mcpServers": {
"truelayer": {
"command": "node",
"args": ["/path/to/truelayer_mcp/build/index.js"]
}
}
}Replace /path/to/truelayer_mcp with the actual path to this project on your system. The server picks up .env from the project root wherever the client starts it; alternatively, pass the variables in the server's "env" block, which overrides .env.
Once configured, you can ask Claude to perform TrueLayer operations. Here are some example prompts:
- "Create a payout of £100 to account number 12345678 with sort code 01-02-03."
- "Generate a payment link for £50."
- "List all transactions between 2023-01-01 and 2023-01-31."
When you ask Claude about these operations, it will use the MCP server to execute them through the TrueLayer API.
The MCP server exposes these tools:
truelayer-get-merchant-account: Retrieve merchant account detailstruelayer-get-payment: Get details of a specific paymenttruelayer-get-payment-link: Get details of a specific payment linktruelayer-get-payout: Get details of a specific payouttruelayer-create-payout: Create a new payout to an external accounttruelayer-create-payment-link: Create a payment link for bank transferstruelayer-list-transactions: Get a list of transactions for a merchant account (defaults to the last 30 days if no dates provided)
MIT. See LICENSE.