loading…
Search for a command to run...
loading…
Provides secure access to Trading 212 Public API through MCP, enabling Claude Desktop users to manage portfolios, execute trades, and analyze market data using
Provides 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.
Secure Trading 212 Public API access for Claude via MCP
Built with:
This project exposes Trading 212 Public API capabilities as MCP tools so Claude Desktop can securely query account, market, order, history, and pie data. It targets users who want natural-language access to their portfolio workflows without building a custom UI. The main value is a modular feature-based TypeScript architecture with structured errors, strict environment handling, and tool-first MCP integration.
Run locally, then inspect tools using MCP Inspector:
npx @modelcontextprotocol/inspector
For stdio mode, configure Inspector command as:
bun run src/server.ts
@modelcontextprotocol/sdkzoddotenvbun test src)TRADING212_API_KEY, TRADING212_API_SECRET)Clone the Repository
git clone https://github.com/razeevascx/212mcp.git
Navigate to Project
cd 212mcp
Install Dependencies
bun install
Configure Environment
cp .env.example .env
Set Credentials in .env
TRADING212_API_KEY=your_api_key_here
TRADING212_API_SECRET=your_api_secret_here
ENVIRONMENT=live
TRANSPORT=stdio
LOG_LEVEL=info
DEBUG=false
Build Project
bun run build
Start Server
bun run start
Trading 212 MCP Server running in terminal output.Use this MCP server config:
{
"mcpServers": {
"trading212": {
"command": "/absolute/path/to/212mcp/start.sh"
}
}
}
Create start.sh and make it executable:
#!/bin/bash
set -euo pipefail
set -a
source /absolute/path/to/212mcp/.env
set +a
exec bun run /absolute/path/to/212mcp/src/server.ts
fetch_account_cashfetch_account_metadatasearch_exchangesearch_instrumentfetch_open_positions (optional ticker filter)fetch_all_ordersfetch_orderplace_limit_orderplace_market_orderplace_stop_orderplace_stop_limit_ordercancel_orderfetch_historical_order_datafetch_paid_out_dividendsfetch_transaction_listfetch_exports_listrequest_export_csvfetch_piesfetch_piecreate_pieupdate_pieduplicate_piedelete_pieget_server_healthAPI_KEY:API_SECRET), handled by BaseClient.ENVIRONMENT=demo|live maps to Trading 212 demo/live base URLs.limit + cursor and return nextPagePath.429 is surfaced as RATE_LIMIT_EXCEEDED.bun run build — Compile TypeScriptbun run start — Start MCP serverbun run dev — Watch modebun test src — Run tests in srcTRADING212_API_KEY and TRADING212_API_SECRET.On startup, the server validates auth configuration and fails fast if credentials are incomplete.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"trading-212-mcp-server": {
"command": "npx",
"args": []
}
}
}