Trading 212 MCP Server
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., "@Trading 212 MCP Servershow my account summary"
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.
Trading 212 MCP Server
An MCP (Model Context Protocol) server for the Trading 212 Public API, packaged as a Docker container with an SSE transport for hosting on Obot (or any MCP host that speaks SSE).
It exposes the account, instruments, orders, history and pies endpoints as MCP tools.
⚠️ This server can place and cancel real orders. It targets the demo / paper environment by default. Only set
TRADING212_LIVE=trueonce you understand the risk.
Environments
Trading 212 runs two fully separate environments, each with its own credentials:
| Base URL | Money |
unset / |
| Paper |
|
| Real |
Related MCP server: trading212-mcp-server
Authentication
The Public API uses HTTP Basic auth — Base64("API_KEY:API_SECRET").
Generate the key and secret in the Trading 212 app under Settings > API; the secret
is shown only once.
Configuration
Provide config one of two ways (env vars are the simplest):
Environment variables
Variable | Required | Description |
| yes | API key from the Trading 212 app |
| yes | API secret (shown once at generation) |
| no |
|
| no | Bind host (default |
| no | Bind port (default |
Config file (Docker volume)
Mount a JSON file at /config/config.json (takes priority over env vars):
{
"api_key": "your-api-key-here",
"api_secret": "your-api-secret-here",
"live": false
}Running
docker-compose
cp .env.example .env # then edit values
docker compose up --builddocker
docker build -t trading212-mcp .
docker run -p 8000:8000 \
-e TRADING212_API_KEY=... \
-e TRADING212_API_SECRET=... \
-e TRADING212_LIVE=false \
trading212-mcpThe server then exposes:
GET /sse— MCP SSE connection endpoint (point your MCP host here)POST /messages/— MCP message endpoint (used internally by the SSE transport)GET /health— liveness check (reports the active environment)
Deploying to Obot
Build & push the image (the included GitHub Actions workflow publishes
ghcr.io/nigelvanhattum/trading212-mcp:lateston push tomain).The Obot catalog entry lives in the
obot-mcp-repositoryrepo astrading212.yaml.In Obot, add the server and set
TRADING212_API_KEY,TRADING212_API_SECRET, and optionallyTRADING212_LIVE.
Tools
Module | Tools |
account |
|
instruments |
|
orders |
|
history |
|
Order convention: a positive quantity buys, a negative quantity sells (e.g. -10.5).
Orders execute only in the account's main currency.
Searching instruments
The upstream /metadata/instruments endpoint takes no parameters — it returns
the entire catalogue (~15k instruments, several MB), which is not something to
hand an agent. list_instruments fetches that list once, caches it for 10
minutes, and searches it locally:
Argument | Match |
| Trading 212 instrument ID, e.g. |
| Exact, case-insensitive |
| Case-insensitive substring |
| One of |
| Result cap (default 20, max 100) |
Filters combine with AND. Responses carry total (all matches), returned,
limit and truncated, so a search that is too broad reports how much it left
out instead of silently dropping it.
trading212Id is the API's ticker field — the value the order tools take as
their ticker argument. It is named separately here because it is a Trading 212
identifier (AAPL_US_EQ), not a market ticker (AAPL).
Rate limiting
Every Trading 212 endpoint has its own limit and they apply per account, so a
burst from this server counts against the same budget as anything else the
account is doing. ratelimit.py holds the published limit for each endpoint and
puts every outgoing call through a single queue: calls go out one at a time, in
the order they arrived, and each waits out its own endpoint's window first.
Consequences worth knowing:
A tool call can block for a while —
list_instrumentsis 1 req / 50s, so a second call to it waits nearly a minute. Nothing is dropped or rejected; it waits its turn.Because the queue is strictly in order, a slow call holds up the ones behind it. Fine at this server's traffic; it is the trade-off that makes the guarantee simple.
Waits happen on a worker thread, so the SSE transport and
/healthstay responsive throughout.A
429that slips through anyway (another client on the same account) holds that endpoint back for the interval inRetry-After/x-ratelimit-resetand is retried once.
Development
pip install -e ".[dev]"
pytestThe Docker build runs the test suite as a build stage — a failing test fails the image build.
API reference
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
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with Trading 212 investment accounts for portfolio tracking, account management, and real-time order execution. It supports managing investment pies, analyzing historical data, and monitoring market performance across multiple instrument types.Last updated231MIT
- AlicenseAqualityBmaintenanceMCP server for the Trading 212 API. Provides 28 tools for portfolio management, trading, pies, dividends, market data, and analytics.Last updated284MIT
- Flicense-qualityDmaintenanceProvides secure access to Trading 212 Public API through MCP, enabling Claude Desktop users to manage portfolios, execute trades, and analyze market data using natural language commands.Last updated
- Alicense-qualityDmaintenanceEnables AI agents to manage Trading212 brokerage accounts, including portfolio analysis, order placement (demo mode), and investment pie management.Last updated5MIT
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
Hosted MCP for stocks, options, Greeks, brokers, order previews, alerts, and workflows.
Real SEC, 13F, insider, congress & macro data your AI agent can cite. Hosted MCP, 24 tools.
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/NigelVanHattum/Trading212-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server