trading212-mcp-server
Trading 212 MCP Server
Connect your AI assistant to your Trading 212 brokerage account. Ask questions about your portfolio, place trades, manage pies, and analyze dividends - all through natural language.
Works with Claude Desktop, Claude Code, ChatGPT, Gemini, Cursor, Windsurf, and any client that supports the Model Context Protocol (MCP).
Why this server?
32 tools covering the full Trading 212 API, plus 4 analytics tools that combine multiple API calls into actionable insights
Smart rate limiting - reads T212's rate limit headers, auto-waits, and retries on 429 (up to 3 times). No rate limit errors leak to your AI
Zero config - install from PyPI, add your API key, done. No Docker, no database, no Redis
Typed responses - every tool returns structured Pydantic models, not raw JSON
Paper trading - set
ENVIRONMENT=demoto test with virtual money first
Related MCP server: trading-mcp
What can it do?
Category | Tools | Examples |
Analytics | Portfolio summary, performance, dividends, activity | "Show me my portfolio P&L" |
Trading | Market, limit, stop, stop-limit orders | "Buy 5 shares of AAPL" |
Portfolio | Positions, cash balance, account info | "What's my cash balance?" |
Pies | Create, update, duplicate, delete pies | "Show my pie allocations" |
Market Data | Instrument search, exchange schedules | "Search for Tesla" |
History | Past orders, dividends, transactions, CSV exports | "Show my dividend history" |
Analytics tools
These combine multiple API calls into single high-level responses:
fetch_portfolio_summary- Complete snapshot: total value, P&L, cash, top holdings, allocationfetch_portfolio_performance- Per-position returns with dividends, best/worst performersfetch_dividend_summary- Income analysis grouped by ticker and monthfetch_recent_activity- Combined timeline of trades and transactions
Quick start
Install
uvx trading212-mcp-serverOr via pip:
pip install trading212-mcp-serverGet your API credentials
From the Trading 212 app: Settings > API (Beta). You need both the API Key and Secret - the server uses Basic Auth.
Connect to Claude Desktop
Add to claude_desktop_config.json (Windows: %APPDATA%\Claude\, Mac: ~/Library/Application Support/Claude/):
{
"mcpServers": {
"trading212": {
"command": "uvx",
"args": ["trading212-mcp-server"],
"env": {
"TRADING212_API_KEY": "<your-api-key>",
"TRADING212_API_SECRET": "<your-api-secret>",
"ENVIRONMENT": "live"
}
}
}
}Connect to Claude Code
claude mcp add trading212 -- uvx trading212-mcp-serverThen set the environment variables in your shell or .env file.
Other clients (Cursor, Windsurf, ChatGPT, etc.)
Same command and env vars - configure per your client's MCP docs. Set ENVIRONMENT to demo for paper trading.
From source
git clone https://github.com/KyuRish/trading212-mcp-server.git
cd trading212-mcp-server
cp .env.example .env # fill in your API keys
uv sync
uv run -m trading212_mcp_server.server{
"mcpServers": {
"trading212": {
"command": "uv",
"args": ["run", "--directory", "<path-to-repo>", "-m", "trading212_mcp_server.server"],
"env": {
"TRADING212_API_KEY": "<your-api-key>",
"TRADING212_API_SECRET": "<your-api-secret>",
"ENVIRONMENT": "live"
}
}
}
}All 32 tools
Analytics (composite)
Tool | Description |
| Complete portfolio snapshot with P&L and allocations |
| Per-position returns, dividends, best/worst performers |
| Dividend income by ticker and month |
| Combined timeline of trades and transactions |
Account
Tool | Description |
| Account metadata (currency, ID) |
| Cash balance, invested value, P&L |
| All portfolio positions with live prices |
| Single position lookup by ticker |
Trading
Tool | Description |
| Buy/sell at current market price |
| Buy/sell at specified price or better |
| Trigger order at stop price |
| Stop trigger with limit execution |
| List all pending orders |
| Get specific order by ID |
| Cancel a pending order |
Pies
Tool | Description |
| List all investment pies |
| Pie details with instrument allocations |
| Create a new pie with target weights |
| Update pie settings and allocations |
| Clone an existing pie |
| Remove a pie |
Market Data
Tool | Description |
| Search tradeable instruments by ticker or name |
| Search available exchanges |
History
Tool | Description |
| Past orders with pagination |
| Dividend payment history |
| Deposits and withdrawals |
| List CSV export reports |
| Request a new CSV export |
Compatibility
Tested with these MCP clients:
Client | Status |
Claude Desktop | Supported |
Claude Code | Supported |
Cursor | Supported |
Windsurf | Supported |
Any MCP-compatible client | Supported |
Author
Built by Rishabh Dogra.
Support
If this server saves you time, a coffee would mean a lot.
License
MIT
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
- Alicense-qualityDmaintenanceProvides a comprehensive suite of 20 tools for cryptocurrency trading and technical analysis across 100+ exchanges like Binance and MEXC via CCXT. It enables users to execute orders, track positions, and scan for market opportunities through Claude Desktop using natural language.Last updated28MIT
- Flicense-qualityDmaintenanceProvides foundational trading utilities by fetching market data through Akshare and computing technical indicators like RSI and MACD using TA-Lib. It enables users to retrieve candlestick data and technical analysis series via a standardized MCP interface.Last updated9
- AlicenseAqualityAmaintenanceRenders 45+ interactive chart types, dashboards, and KPI widgets directly inside AI conversations. Supports drill-down, live API polling, 20 themes, and one-click export to PNG, PowerPoint, and A4 documents.Last updated4011343Functional Source , Version 1.1, MIT Future

Purple Flea Tradingofficial
Alicense-qualityDmaintenancePerpetual futures trading API for AI agents. Access 275+ markets (crypto, stocks, commodities, forex) via Hyperliquid. Copy trading, leaderboard, up to 50x leverage. No KYC. 20% referral commissions.Last updated51MIT
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
Open-source MCP server for Zerodha Kite Connect. Portfolio, market data, backtesting, alerts.
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
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/KyuRish/trading212-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server