# TrueLayer MCP

> TrueLayer manages open banking payments, payouts, and mandated billing cycles directly through your AI client. Your agent can check account balances (`get_data_account_balance`), list bank transactions, create instant bank transfers (`create_payment`), process refunds, or set up recurring mandates—all from a conversation.

## Overview
- **Category:** finance-accounting
- **Price:** Free
- **Tags:** open-banking, payments, payouts, fintech, bank-data

## Description

Your agent manages TrueLayer payments and payouts using open banking data. You can handle everything from setting up automated billing cycles to initiating instant transfers, all through conversation.

For managing connected bank accounts and real-time financial data, you've got a few tools at your disposal. You can first run `list_data_accounts` to get a list of all the user's connected banks—you gotta provide that consent token for this one. Once you know what’s available, you use `verify_account` to confirm ownership and check the details for any specific bank account. To see where the money is right now, run `get_data_account_balance` to retrieve the current balance on a data account. You can pull detailed transaction histories using `list_data_account_transactions`, which lists all records associated with that user's data account.

When it comes to TrueLayer-managed merchant accounts, you have another set of controls. To see what accounts are active under the platform, run `list_merchant_accounts` to get a list of every TrueLayer-managed account belonging to the user. You can then pull specific details and status information for any one account by calling `get_merchant_account`. If you need transaction history for those merchant accounts, use `list_merchant_account_transactions` to fetch all records there. You'll also find that your agent can look up available payment sources tied to a specific merchant account using `list_payment_sources`, and if you just wanna know what banks are supported everywhere, you run `list_providers` to get a list of those regions.

Handling money movement is the core of this server. You'll start by setting up automated billing cycles; running `create_mandate` establishes a Variable Recurring Payment (VRP) mandate for that purpose. For single transfers, you use `create_payment`, which needs an amount, currency, method, and beneficiary to make it work. If you need to send money out—whether it's internal or external—you call `create_payout` to handle the new payout creation. You can also issue a refund for previous transactions by running `create_refund`; this tool makes sure the refund amount never exceeds the original payment value.

These tools let you build out complex financial workflows entirely through natural language prompts.

## Tools

### create_mandate
Sets up a Variable Recurring Payment (VRP) mandate.

### create_payment
Creates a new single payment, requiring amount, currency, method, and beneficiary details.

### create_payout
Handles the creation of a new payout (either open or closed loop).

### create_refund
Processes a refund for an existing payment, ensuring it stays under the original amount.

### get_data_account_balance
Retrieves the current balance for a specific data account.

### get_merchant_account
Fetches detailed information and status for a specified merchant account.

### list_data_account_transactions
Lists all transaction records associated with a user's data account.

### list_data_accounts
Retrieves a list of the user's connected bank accounts (requires consent token).

### list_merchant_account_transactions
Lists all transaction records for a specific merchant account.

### list_merchant_accounts
Retrieves a list of all TrueLayer-managed merchant accounts belonging to the user.

### list_payment_sources
Lists available payment sources tied to a specific merchant account.

### list_providers
Retrieves a list of all supported banking providers in various regions.

### verify_account
Confirms ownership and details for a specified bank account.

## Prompt Examples

**Prompt:** 
```
List all my merchant accounts and their current status.
```

**Response:** 
```
I've retrieved your merchant accounts. You have 3 active accounts: 'Main GBP' (ID: acc_01), 'Euro Operations' (ID: acc_02), and 'Savings' (ID: acc_03). Would you like to see the balance for any of these?
```

**Prompt:** 
```
Create a payment of £25.50 for user 'John Doe'.
```

**Response:** 
```
I'm initiating a payment of 2550 minor units (GBP). I'll need the beneficiary details and payment method to complete the `create_payment` request. Should I use your default merchant account as the beneficiary?
```

**Prompt:** 
```
Show me the last 5 transactions for account acc_01.
```

**Response:** 
```
Fetching transaction history for acc_01... I found 5 recent transactions, including a payment of £100.00 from 'User A' and a payout of £50.00 to 'User B'. Would you like the full details of the most recent one?
```

## Capabilities

### Manage Mandates
Create and manage Variable Recurring Payment (VRP) mandates for automated billing cycles.

### Process Payments
Initiate single bank payments using required details like amount, currency, beneficiary, and payment method.

### Execute Payouts
Create new payouts, supporting both closed-loop (internal) or open-loop (external) transfers.

### Issue Refunds
Generate a refund for a previous payment, ensuring the amount does not exceed the original transaction value.

### Check Account Balances
Retrieve real-time balance details for specific data accounts linked to the user.

### List Transactions
Fetch detailed transaction histories for both merchant and data accounts.

## Use Cases

### The Quarterly Reconciliation Task
A finance analyst needs to verify payouts for 50 vendors. Instead of logging into the portal and running reports, they ask their agent: 'List all merchant accounts' (`list_merchant_accounts`), then ask for the transaction history on each one (`list_merchant_account_transactions`) to confirm recent disbursements. The agent gathers the data in seconds.

### Handling a Failed Subscription
A customer's recurring bill failed because their bank account details changed. An operations manager asks the agent to 'Verify this new bank account.' The agent runs `verify_account`, confirms ownership, and then uses `create_mandate` to set up the correct VRP mandate.

### Closing a Payment Loop
A merchant needs to give a client a refund. Instead of manually calculating amounts, they instruct the agent: 'Refund $75.00 for payment ID XYZ.' The tool runs `create_refund`, ensuring the amount is valid against the original transaction.

### Verifying Operational Status
A developer needs to know if a new payout batch will clear. They first check the overall merchant account status using `get_merchant_account` and then use `list_data_accounts` to confirm that the required data sources are connected.

## Benefits

- Process funds transfers instantly. Use `create_payment` or `create_payout` to execute bank transfers in one step, eliminating the need for multiple API calls for simple transactions.
- Audit accounts faster than ever. Running `list_merchant_account_transactions` gives you full visibility into a merchant's history without navigating web dashboards.
- Handle complex billing logic. Use `create_mandate` to set up Variable Recurring Payments (VRP) and automate subscriptions reliably, year after year.
- Maintain data integrity. Before initiating any payment, check the funds first with `get_data_account_balance`. This prevents failed transactions due to insufficient funds.
- Manage all accounts from one place. Listing both merchant accounts (`list_merchant_accounts`) and user bank accounts (`list_data_accounts`) gives a complete financial picture.

## How It Works

The bottom line is: You move from conversational intent directly into auditable, actionable financial requests without switching screens or writing code.

1. Subscribe to this server and enter your TrueLayer Access Token.
2. Your AI agent calls a specific tool, such as `get_data_account_balance`, passing required identifiers (like an account ID).
3. The tool executes the request against TrueLayer's API and returns structured data or confirmation status to your client.

## Frequently Asked Questions

**How do I list all my merchant accounts using TrueLayer MCP Server?**
You run `list_merchant_accounts`. This tool fetches a complete list of every account linked to your merchant profile, giving you the IDs needed for subsequent actions.

**Can I check bank balances with get_data_account_balance?**
Yes. `get_data_account_balance` retrieves real-time balance data from a user's connected account, allowing you to confirm funds before initiating transfers.

**What is the difference between create_payment and create_payout?**
Use `create_payment` for standard payments initiated within your immediate merchant flow. Use `create_payout` when sending money out to external parties or managing a broader dispersal of funds.

**How do I set up recurring billing with create_mandate?**
`create_mandate` establishes the Variable Recurring Payment (VRP) mandate. This is the formal step that allows you to automatically bill a customer later without sending repeated API calls.

**When should I use the `create_refund` tool to handle payments?**
You use `create_refund` when a customer needs their money back after a payment. The process requires linking it to an existing transaction, and you can't refund more than the original amount.

**How do I check historical activity using `list_data_account_transactions`?**
This tool pulls the full list of transactions from a user’s bank data account. Because this is sensitive data, you'll need to provide the required user consent token for it to work.

**What does `verify_account` do before I send any money?**
It confirms that you actually own the bank account you are trying to access. This verification step is a security measure; we won't process payments without confirming ownership first.

**How can I find out which banks TrueLayer supports using `list_providers`?**
Running `list_providers` gives you a complete list of all supported banking providers. Use this to confirm that the financial institutions in your target region are integrated.

**Can I issue a refund for a specific payment using this server?**
Yes! Use the `create_refund` tool by providing the `payment_id` and the `amount_in_minor` (e.g., 100 for £1.00). The agent will process the repayment against the original transaction.

**How do I check the current balance of my connected bank accounts?**
You can use the `get_data_account_balance` tool with a specific `account_id` to retrieve real-time balance information directly from the bank via TrueLayer's Data API.

**Does this integration support setting up recurring payments?**
Yes. The `create_mandate` tool allows you to set up Variable Recurring Payment (VRP) mandates, enabling automated and flexible recurring transfers from your users.