Skip to main content
Glama
Trading 212 MCP Server

Trading 212 MCP Server

by senjoyee

Trading 212 MCP Server

An MCP (Model Context Protocol) server that wraps the Trading 212 Public API v0, enabling AI agents to interact with your Trading 212 brokerage account through natural language.

Features

16 tools across 5 categories:

Category

Tools

Description

Accounts

get_account_summary

Cash breakdown, investment metrics, total value

Instruments

get_instruments, get_exchanges

Tradable instruments and exchange schedules

Positions

get_open_positions

All open positions with P&L and wallet impact

Orders

get_pending_orders, get_order_by_id, place_market_order, place_limit_order, place_stop_order, place_stop_limit_order, cancel_order

Full order lifecycle management

History

get_historical_orders, get_dividends, get_transactions, request_csv_report, get_reports

Historical data with pagination and CSV export

Related MCP server: eToro MCP Server

Prerequisites

  1. A Trading 212 Invest or Stocks ISA account

  2. API key + secret generated from the Trading 212 app (Settings → API)

  3. Node.js ≥ 18

Setup

# Clone and install
cd trading212-mcp
npm install

# Build
npm run build

Configuration

Set these environment variables before running:

Variable

Required

Description

T212_API_KEY

✅

Your Trading 212 API key

T212_API_SECRET

✅

Your Trading 212 API secret

T212_ENV

❌

demo (default) or live

Usage with Claude Desktop / Gemini CLI

Add to your MCP config (e.g. claude_desktop_config.json):

{
  "mcpServers": {
    "trading212": {
      "command": "node",
      "args": ["c:/GenAI/trading212-mcp/dist/index.js"],
      "env": {
        "T212_API_KEY": "your_api_key",
        "T212_API_SECRET": "your_api_secret",
        "T212_ENV": "demo"
      }
    }
  }
}

Usage with VS Code / Copilot

Add to .vscode/mcp.json:

{
  "servers": {
    "trading212": {
      "command": "node",
      "args": ["c:/GenAI/trading212-mcp/dist/index.js"],
      "env": {
        "T212_API_KEY": "your_api_key",
        "T212_API_SECRET": "your_api_secret",
        "T212_ENV": "demo"
      }
    }
  }
}

Development

# Run in development mode (no build step)
npm run dev

⚠️ Important Notes

  • Default environment is demo (paper trading) — no real money at risk

  • Order tools are NOT idempotent — duplicate calls create duplicate orders

  • Sell convention: use a negative quantity (e.g. -10.5 sells 10.5 shares)

  • All rate limits are enforced per-account by Trading 212's servers

  • API is currently in beta — see Trading 212 API docs

License

MIT

Available Tools

16 tools
cancel_orderCancel Pending OrderA
DestructiveIdempotent

Cancel an active, unfilled order by its unique ID. Cancellation is not guaranteed if the order is already being filled. A successful response means the cancellation request was accepted. Rate limit: 50 req / 1m.

Inputs: orderId (required).

get_account_summaryGet Account SummaryA
Read-onlyIdempotent

Retrieve a full breakdown of the Trading 212 account: account ID, primary currency, cash metrics (available to trade, in pies, reserved for orders), investment metrics (current value, total cost, realised and unrealised P&L), and total account value. Rate limit: 1 req / 5s.

Inputs: no named parameters.

get_dividendsGet Dividend HistoryA
Read-onlyIdempotent

Retrieve paginated history of paid-out dividends. Each entry includes: amount (in account currency), gross amount per share, instrument details, payment date, quantity, and dividend type. Optionally filter by ticker. Rate limit: 6 req / 1m.

Inputs: limit, cursor, ticker.

get_exchangesGet Exchange MetadataA
Read-onlyIdempotent

Retrieve all accessible exchanges and their working schedules (open/close times, pre-market, after-hours, breaks). Each exchange has an ID that maps to the workingScheduleId on instruments. Data refreshes every 10 minutes. Rate limit: 1 req / 30s.

Inputs: no named parameters.

get_historical_ordersGet Historical OrdersA
Read-onlyIdempotent

Retrieve paginated history of all past orders (filled, cancelled, expired) with fill details, taxes, realised P&L. Optionally filter by ticker. Uses cursor-based pagination. Rate limit: 6 req / 1m.

Inputs: limit, cursor, ticker.

get_instrumentsGet All Tradable InstrumentsA
Read-onlyIdempotent

Retrieve the complete list of instruments available for trading on Trading 212. Each instrument includes: ticker (unique ID, e.g. AAPL_US_EQ), name, ISIN, currency, type (STOCK, ETF, etc.), max open quantity, extended-hours support, and working schedule ID. Data refreshes every 10 minutes. Rate limit: 1 req / 50s.

Inputs: no named parameters.

get_open_positionsGet Open PositionsA
Read-onlyIdempotent

Retrieve all open positions in the Trading 212 account. Each position includes: instrument details (ticker, name, ISIN, currency), quantity held, average price paid, current price, shares in pies, shares available for trading, and wallet impact (current value, total cost, unrealised P&L, FX impact). Optionally filter by a specific ticker. Rate limit: 1 req / 1s.

Inputs: ticker.

get_order_by_idGet Pending Order by IDA
Read-onlyIdempotent

Retrieve a single pending order by its unique numerical ID. Useful for checking the status of a previously placed order. Rate limit: 1 req / 1s.

Inputs: orderId (required).

get_pending_ordersGet All Pending OrdersA
Read-onlyIdempotent

Retrieve all currently active (pending) orders — those not yet filled, cancelled, or expired. Each order includes: type (LIMIT, STOP, MARKET, STOP_LIMIT), side (BUY/SELL), ticker, quantity, limit/stop prices, status, time-in-force, and creation date. Rate limit: 1 req / 5s.

Inputs: no named parameters.

get_reportsList Generated ReportsA
Read-onlyIdempotent

Retrieve a list of all requested CSV reports and their current status (Queued, Processing, Running, Finished, Failed, Canceled). When status is 'Finished', the downloadLink field contains a URL to download the CSV file. Rate limit: 1 req / 1m.

Inputs: no named parameters.

get_transactionsGet Transaction HistoryA
Read-onlyIdempotent

Retrieve paginated history of account transactions (deposits, withdrawals, fees, transfers). Each entry includes: amount, currency, timestamp, reference ID, and type. Rate limit: 6 req / 1m.

Inputs: time, limit, cursor.

place_limit_orderPlace Limit OrderA

Place a LIMIT order that executes at a specified price or better. Use a POSITIVE quantity to BUY (fills at limitPrice or lower) and a NEGATIVE quantity to SELL (fills at limitPrice or higher). NOT idempotent — duplicate calls create duplicate orders. Rate limit: 1 req / 2s.

Inputs: ticker (required), quantity (required), limitPrice (required), timeValidity.

place_market_orderPlace Market OrderA

Place a MARKET order for immediate execution at the next available price. Use a POSITIVE quantity to BUY and a NEGATIVE quantity to SELL (e.g. -10.5 sells 10.5 shares). WARNING: Market orders may experience price slippage. This endpoint is NOT idempotent — duplicate calls create duplicate orders. Rate limit: 50 req / 1m.

Inputs: ticker (required), quantity (required), extendedHours.

place_stop_limit_orderPlace Stop-Limit OrderA

Place a STOP-LIMIT order: when the Last Traded Price reaches stopPrice a limit order is placed at limitPrice. Protects against slippage. Use POSITIVE quantity to BUY, NEGATIVE to SELL. NOT idempotent. Rate limit: 1 req / 2s.

Inputs: ticker (required), quantity (required), stopPrice (required), limitPrice (required), +1 more.

place_stop_orderPlace Stop OrderA

Place a STOP order that triggers a market order once the stop price is reached (triggered by Last Traded Price). Use a POSITIVE quantity to BUY and a NEGATIVE quantity to SELL (stop-loss). NOT idempotent. Rate limit: 1 req / 2s.

Inputs: ticker (required), quantity (required), stopPrice (required), timeValidity.

request_csv_reportRequest CSV ReportA

Initiate async generation of a CSV report for a date range. Choose which data to include: orders, dividends, transactions, interest. Returns a reportId — use get_reports to poll status and get the download link when finished. Rate limit: 1 req / 30s.

Inputs: timeTo (required), timeFrom (required), includeOrders, includeInterest, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 16 tools

    Disambiguation5/5

    Each tool targets a distinct resource and action. Place order tools are clearly differentiated by order type, and get tools are separated by resource (account, instruments, positions, orders, dividends, transactions, reports). No two tools appear to perform the same function.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern (get_, place_, cancel_, request_) using lowercase snake_case. The naming is predictable and uniform across the entire set.

    Tool Count4/5

    16 tools is slightly above the ideal 3-15 range but justified by the scope of a trading API covering account info, instruments, orders, history, dividends, transactions, and reports. Each tool serves a distinct purpose and none feel redundant.

    Completeness4/5

    The tool set covers the core lifecycle of trading: viewing account and instruments, managing orders (place/cancel), retrieving positions and historical data, plus reporting. Minor gap: no tool for modifying an existing order, but this can be worked around by cancelling and re-placing.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      MCP server for the Trading 212 API. Provides 28 tools for portfolio management, trading, pies, dividends, market data, and analytics.
      28
      125 PyPI
      10
      MIT
    • F
      license
      A
      quality
      D
      maintenance
      A security-hardened MCP server that wraps the eToro public API, enabling AI assistants to trade, access market data, manage portfolios, and interact with social feeds via 34 tools.
      6
      -
    • A
      license
      A
      quality
      B
      maintenance
      This MCP server connects AI assistants to a Public.com brokerage account, enabling natural language trading of stocks, options, and crypto, along with portfolio management, quotes, and orders.
      46
      363 PyPI
      67
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      MCP server for the Trading 212 public API, enabling account, portfolio, order, pie, and history access with read tools always available and trading tools opt-in.
      13
      1
      MIT