Skip to main content
MCP server CX Codex

trading212-mcp-server — Claude Code MCP server: setup

Connects Trading 212 to an AI agent for portfolio data, dividends, orders, pies, and analytics through natural-language requests.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env TRADING212_API_KEY=<TRADING212_API_KEY> --env TRADING212_API_SECRET=<TRADING212_API_SECRET> --env ENVIRONMENT=<ENVIRONMENT> --transport stdio trading212-mcp-server -- uvx trading212-mcp-server
Open on GitHub

What trading212-mcp-server does

This server connects a Trading 212 brokerage account to an MCP client. The agent can inspect cash, positions, account details, pending and historical orders, dividends, transactions, pies, tradable instruments, and exchanges. It can also place or cancel orders through the available Trading 212 API tools.

Four analytics tools combine several API calls into portfolio summaries, position performance, dividend income, and recent activity views. Responses use typed Pydantic models, while rate-limit headers are handled with automatic waits and retries after 429 responses, up to 3 times. The server needs both TRADING212_API_KEY and TRADING212_API_SECRET before it can access the account.

Install it with uvx or pip. Set ENVIRONMENT=demo to use paper trading with virtual money, or live for the live environment. Supported clients include Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, and Gemini CLI.

What it helps with

  • inspect portfolio value and P&L
  • look up a position by ticker
  • place or cancel a trading order
  • break down dividend income by ticker and month
  • create and update investment pies

Example prompts for the agent

  • Show my portfolio summary with P&L and asset allocation.
  • Find my AAPL position and report its current value.
  • Use ENVIRONMENT=demo and create a pie with these target weights.

How to install trading212-mcp-server

Platform CLI

claude mcp add --env TRADING212_API_KEY=<TRADING212_API_KEY> --env TRADING212_API_SECRET=<TRADING212_API_SECRET> --env ENVIRONMENT=<ENVIRONMENT> --transport stdio trading212-mcp-server -- uvx trading212-mcp-server

Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from trading212-mcp-server <command>

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about trading212-mcp-server

How do I install trading212-mcp-server in Claude Code?

Run `claude mcp add trading212-mcp-server -e TRADING212_API_KEY=<TRADING212_API_KEY> -e TRADING212_API_SECRET=<TRADING212_API_SECRET> -- uvx trading212-mcp-server`.

What does trading212-mcp-server do?

It gives an MCP client access to Trading 212 portfolio data, orders, pies, dividends, market data, transaction history, and combined analytics.

What credentials does trading212-mcp-server require?

You need both the API Key and Secret from Settings > API (Beta) in the Trading 212 app. Set ENVIRONMENT=demo when you want to test with virtual money.

Similar MCP servers

All MCP servers for Finance and business →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor