t212-mcp
Click on "Install 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-mcpHow 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: robinhood-mcp
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
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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.Last updated9MIT
- AlicenseAqualityCmaintenanceA read-only MCP server for Robinhood portfolio research. Wraps robin_stocks to give AI assistants access to your portfolio data for analysis.Last updated13MIT
- Alicense-qualityAmaintenanceA read-only MCP server that connects Claude to your eToro account, enabling queries about your portfolio, P\&L, balances, watchlists, live prices, and price history.Last updatedMIT
- Flicense-qualityDmaintenanceAn MCP server that wraps the Trading 212 Public API, enabling AI agents to interact with your Trading 212 brokerage account through natural language.Last updated
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/guilyx/t212-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server