t212-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@t212-mcp How is my portfolio doing, and which holding is furthest from its pie target?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
t212-mcp
A Model Context Protocol server that gives an AI assistant read-only access to a Trading 212 investing account: balances, positions, order and dividend history, pies, and the instrument catalogue.
It cannot trade. No tool places, amends or cancels an order, or changes a pie. The HTTP client has no code path that issues anything but a
GET. See Security.
You: How is my portfolio doing, and which holding is furthest from its pie target?
→ t212_get_account_info reporting currency
→ t212_get_account_cash balance and unrealised P/L
→ t212_list_positions holdings, ranked by value
→ t212_list_pies pie valuations
→ t212_get_pie allocation driftRequirements
Node.js 20.11 or newer
A Trading 212 API key — in the app: Settings → API
Trading 212 issues separate credentials for practice and real-money accounts, and a key from one is rejected by the other. Start with the practice account.
Related MCP server: Trading 212 MCP Server
Quick start
npx t212-mcpIt speaks MCP over stdio, so run it from a client rather than directly.
Claude Desktop
claude_desktop_config.json:
{
"mcpServers": {
"trading212": {
"command": "npx",
"args": ["-y", "t212-mcp"],
"env": {
"T212_API_KEY": "your-key",
"T212_ENVIRONMENT": "demo"
}
}
}
}Claude Code
claude mcp add trading212 \
--env T212_API_KEY=your-key \
--env T212_ENVIRONMENT=demo \
-- npx -y t212-mcpAny MCP client
Run npx -y t212-mcp with the environment below and connect over stdio.
Configuration
Variable | Default | Description |
| — | Required. API key from the Trading 212 app. |
| — | Secret, if your key was issued as a key/secret pair. Selects HTTP Basic auth. |
|
|
|
|
|
|
|
| Per-request timeout. |
|
| Retries rate limits, network faults and 5xx. Never 4xx or a schema mismatch. |
|
| Base cache lifetime, scaled per endpoint — see caching. |
|
| Exposes the CSV export tools. See Security. |
| — | Overrides the API host. For testing against a stub. |
The environment defaults to demo deliberately: the failure mode of that
default is reading play money by accident, which is the only acceptable
direction for the mistake to go.
See .env.example.
Tools
Tool | Returns |
| Free cash, total value, invested amount, unrealised P/L, blocked cash |
| Account id, reporting currency, which environment is connected |
| All open positions with market value; sort by value, profit or ticker |
| One position by exact ticker |
| Ranked instrument search by name, symbol or ISIN → exact tickers |
| Exchanges and, on request, their trading schedules |
| Orders placed but not yet executed |
| Executed orders, paginated, filterable by ticker |
| Dividends received, paginated |
| Deposits, withdrawals, fees and interest, paginated |
| Pies with invested value, current value and result |
| One pie's holdings, ranked by drift from target allocation |
| CSV export jobs and links — only if |
Also exposed: a t212://connection resource describing the connection (no
credentials, no network call), and a portfolio_review prompt.
Every tool is annotated readOnlyHint: true and destructiveHint: false.
Ticker format
Trading 212 tickers carry a market suffix: AAPL_US_EQ, not AAPL. Ask the
assistant for a company by name — t212_search_instruments resolves it.
Rate limits and caching
Trading 212's limits are strict and per-endpoint; the instrument catalogue allows roughly one call per minute. The server shapes requests with a token bucket per endpoint group and waits for budget rather than being rejected and retrying blind.
Cache lifetimes are assigned by what the data is, not uniformly:
Data | Lifetime |
Instruments, exchanges | 12× base TTL |
History, dividends | 1× base TTL |
Pies | 0.2× base TTL |
Cash, positions | 0.1× base TTL |
Pending orders, exports | Never cached |
Stale reference data is cosmetic; a stale balance quoted as current is a wrong answer. Concurrent identical requests share one call.
Security
Read SECURITY.md for the full threat model. In short:
Read-only by construction. The HTTP client exposes only
getand has no path that can issue another method. Order placement, cancellation and pie mutation exist in the Trading 212 API and are deliberately absent here, so a prompt injection reaching a tool call cannot move money.Credentials stay in the process. Read from the environment, sent only to the configured Trading 212 host over TLS, never written to disk, never in a tool result, and scrubbed from logs and error messages by key name and by literal value.
Your data goes to your model provider. Anything a tool returns — balances, positions, transaction history — is sent to whichever model your client talks to. That is how MCP works, but decide knowingly before pointing this at a live account.
CSV exports are opt-in. Export download links grant access to a full account statement without further authentication, so the tools are hidden entirely unless
T212_ALLOW_EXPORTSis set.
Create your API key with the narrowest scopes you need. This server never uses order-placement scopes.
Development
npm ci
npm run check # format, lint, typecheck, test — what CI runs
npm run dev # run from source with reloadSee CONTRIBUTING.md.
Docker
docker build -t t212-mcp .
docker run --rm -i -e T212_API_KEY=your-key t212-mcp-i is required: the server talks over stdin and stdout.
Disclaimer
Not affiliated with or endorsed by Trading 212. The Trading 212 API is in beta and may change. This software is provided as-is under the MIT licence; nothing it returns is financial advice, and you are responsible for verifying any figure before acting on it.
Licence
Available Tools
12 toolst212_get_account_cashAccount cash and balanceARead-onlyIdempotent
Returns the account's cash breakdown: free cash available to invest, total account value, amount currently invested, unrealised profit or loss, cash held inside pies, and cash blocked by pending orders. Use this for any question about how much money is in the account or how it is performing overall. Figures are in the account's own currency — call t212_get_account_info if you need to know which currency that is.
Inputs: no named parameters.
t212_get_account_infoAccount identity and currencyARead-onlyIdempotent
Returns the account identifier and the currency every monetary figure from this server is reported in. Call this once when you need to label amounts correctly; the other tools return bare numbers in this currency.
Inputs: no named parameters.
t212_get_piePie holdingsARead-onlyIdempotent
Returns one pie's contents: every instrument in it with its current share of the pie, its target share, the quantity owned, and its result. Use this to explain how a pie is allocated or which of its holdings are drifting from target. Get the pie's id from t212_list_pies first.
Inputs: id (required).
t212_get_positionSingle position by tickerARead-onlyIdempotent
Returns one open position by its exact Trading 212 ticker (for example AAPL_US_EQ, not AAPL). Only use this when you already know the exact ticker — otherwise call t212_list_positions, which returns everything in a single request, or t212_search_instruments to resolve a name to a ticker. Fails if the account holds no such position.
Inputs: ticker (required).
t212_list_dividendsDividend paymentsARead-onlyIdempotent
Returns dividends paid into the account, newest first, with the instrument, amount, and amount per share. Use this for dividend income questions. Results are paginated — pass the returned nextCursor to continue. Note this reports what was actually paid, not forecast yield.
Inputs: limit, cursor, ticker.
t212_list_exchangesExchanges and trading hoursARead-onlyIdempotent
Returns the exchanges Trading 212 supports and their working schedules, including the time events that mark when each session opens and closes. Use this to answer whether a market is open, or to explain why an instrument cannot be traded right now. Schedules are verbose, so they are omitted unless explicitly requested.
Inputs: includeSchedules.
t212_list_order_historyExecuted order historyARead-onlyIdempotent
Returns past, already-executed orders newest first: what was bought or sold, at what price, and any taxes charged. Use this for questions about trading activity or realised results. Results are paginated — pass the returned nextCursor to continue. Optionally filter to a single ticker.
Inputs: limit, cursor, ticker.
t212_list_pending_ordersPending ordersARead-onlyIdempotent
Returns orders that are placed but not yet executed, with their type, limit or stop price, and how much has filled so far. Use this for 'what orders do I have open'. This server is read-only: it can show pending orders but cannot place, amend or cancel them.
Inputs: no named parameters.
t212_list_piesInvestment piesARead-onlyIdempotent
Returns the account's pies — Trading 212's named baskets of instruments with target allocations — including each pie's invested value, current value, result, and progress towards its goal. Use t212_get_pie for the instruments inside a specific pie. This server is read-only and cannot create or change a pie.
Inputs: no named parameters.
t212_list_positionsOpen positionsARead-onlyIdempotent
Returns every open position in the account: ticker, quantity, average buy price, current price, and unrealised profit or loss (including the portion caused by currency movement). This is the tool for 'what do I hold', 'how is my portfolio doing', or any question about a specific holding when you do not already know its exact Trading 212 ticker. Returns the whole portfolio in one call, so prefer it over repeated single-position lookups.
Inputs: limit, sortBy.
t212_list_transactionsCash transactionsARead-onlyIdempotent
Returns cash movements — deposits, withdrawals, fees and interest — newest first. Use this for 'how much have I deposited' or to explain a change in cash that positions do not account for. Results are paginated; pass the returned nextCursor to continue.
Inputs: limit, cursor.
t212_search_instrumentsSearch tradeable instrumentsARead-onlyIdempotent
Finds instruments in the Trading 212 catalogue by company name, symbol or ISIN, returning the exact tickers other tools need (for example AAPL_US_EQ). Use this first whenever you have a company name but not a ticker. Results are ranked, with exact symbol and ISIN matches first. Note this searches everything Trading 212 offers, not the account's holdings — use t212_list_positions for what is actually owned.
Inputs: query (required), type, limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Each tool targets a distinct resource and action: cash, account info, positions (all vs single), instrument search, exchanges, pending orders, order history, dividends, transactions, pies (list vs get). The only similar pair (list_positions vs get_position) is clearly differentiated by scope and purpose.
All tools follow the t212_<verb>_<resource> pattern, with 'list' for collections, 'get' for single resources, and 'search' for the catalog. This is perfectly consistent and predictable.
12 tools is well-scoped for a read-only brokerage account server. Each tool covers a distinct aspect of account data (cash, positions, orders, history, dividends, transactions, pies, exchanges, instruments) without redundancy or bloat.
For its stated purpose (read-only access to account and market data), the tool set is comprehensive. It covers all major read operations: account identification, cash, positions, pending and historical orders, dividends, transactions, pies with detail, exchange schedules, and instrument search. The read-only restriction is consistent with no create/update/delete tools, and there are no obvious dead ends.
Related MCP Connectors
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
Read-only finance MCP server. Connects your banks, cards, payment apps, books and payroll into one ledger for your AI. Can't move money. Open source (AGPL-3.0), free during beta.
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Read-only MetaTrader 5 for AI agents: balances, positions, history and prices. Sign in with OAuth.
Related MCP Servers
- AlicenseAqualityDmaintenanceA read-only MCP server that provides access to Charles Schwab account data and market information, including portfolio positions, real-time quotes, options chains, price history, and account balances through AI assistants.9MIT
- AlicenseAqualityDmaintenanceAn MCP server that wraps the Trading 212 Public API, enabling AI agents to interact with your Trading 212 brokerage account through natural language.16MIT
- AlicenseAqualityCmaintenanceMCP server for the Trading 212 public API, enabling account, portfolio, order, pie, and history access with read tools always available and trading tools opt-in.131MIT
- FlicenseNot gradedqualityDmaintenanceRead-only MCP server that connects a Broker trading account to AI clients, providing account data, positions, orders, and market data via 21 tools, with a mock sandbox mode for evaluation.-