Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Exposes Trading 212 trading account, instruments, orders, history, and pies as MCP tools. Allows placing and canceling real orders (defaults to demo/paper environment).

README.md

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=true once you understand the risk.

Environments

Trading 212 runs two fully separate environments, each with its own credentials:

| TRADING212_LIVE | Base URL | Money | |---|---|---| | _unset / false_ (default) | https://demo.trading212.com/api/v0 | Paper | | true | https://live.trading212.com/api/v0 | Real |

Authentication

The Public API uses HTTP Basic authBase64("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 | |---|---|---| | TRADING212_API_KEY | yes | API key from the Trading 212 app | | TRADING212_API_SECRET | yes | API secret (shown once at generation) | | TRADING212_LIVE | no | true for the live/real-money environment; default uses demo/paper | | SERVER_HOST | no | Bind host (default 0.0.0.0) | | SERVER_PORT | no | Bind port (default 8000) |

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 --build

docker

docker build -t trading212-mcp .
docker run -p 8000:8000 \
  -e TRADING212_API_KEY=... \
  -e TRADING212_API_SECRET=... \
  -e TRADING212_LIVE=false \
  trading212-mcp

The 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

  1. Build & push the image (the included GitHub Actions workflow publishes

ghcr.io/nigelvanhattum/trading212-mcp:latest on push to main).

  1. The Obot catalog entry lives in the obot-mcp-repository repo as trading212.yaml.
  2. In Obot, add the server and set TRADING212_API_KEY, TRADING212_API_SECRET, and

optionally TRADING212_LIVE.

Tools

| Module | Tools | |---|---| | account | get_account_summary, get_positions | | instruments | list_instruments, list_exchanges | | orders | list_orders, get_order, cancel_order, place_market_order, place_limit_order, place_stop_order, place_stop_limit_order | | history | get_historical_orders, get_dividends, get_transactions, list_exports, request_export |

Order convention: a positive quantity buys, a negative quantity sells (e.g. -10.5). Orders execute only in the account's main currency.

Development

pip install -e ".[dev]"
pytest

The Docker build runs the test suite as a build stage — a failing test fails the image build.

API reference

  • Key concepts: https://docs.trading212.com/api/section/general-information/key-concepts
  • Environments: https://docs.trading212.com/api/section/general-information/api-environments
  • Full API: https://docs.trading212.com/api

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Finance & Payments servers.