Skip to main content
Glama
trading-212-mcp

trading-212-mcp

by joe-yeomans

trading-212-mcp

A small, read-only Model Context Protocol server for the Trading 212 Public API. It lets an AI agent (Claude, Cursor, etc.) look at your Trading 212 account: balances, positions, orders, dividends and transactions.

It cannot place, change or cancel orders.

Unofficial project, not affiliated with Trading 212. The Trading 212 API is in beta and only supports Invest and Stocks ISA accounts.

Tools

Tool

Description

get_account_summary

Cash, invested capital, P&L and total account value

get_positions

Open positions (optional ticker filter)

search_instruments

Find instruments by ticker, name or ISIN (cached for 10 min)

get_exchanges

Exchanges and their opening hours

get_pending_orders

Active orders that are not yet filled

get_pending_order

A single pending order by ID

get_order_history

Past orders, paginated (ticker, limit, cursor)

get_dividend_history

Dividends received, paginated (ticker, limit, cursor)

get_transaction_history

Deposits and withdrawals, paginated (time, limit, cursor)

Paginated tools return { items, nextCursor }. To get the next page, pass nextCursor back as cursor.

Related MCP server: Trading212 MCP Server

Setup

1. Get API credentials

In the Trading 212 app, go to Settings → API (Beta) and generate an API key. You get a key and a secret. This server only reads data, so give the key read permissions only.

Keys are tied to either your demo (practice) or live account. Set T212_ENV=demo if you are using a practice-account key.

2. Add to your MCP client

The server runs over stdio and can be launched with npx straight from GitHub. npx builds it on first install, so you don't need to clone anything.

Grok (Connectors → Add a custom connector)

Field

Value

Type

Command

Command

npx

Arguments

-y

github:joe-yeomans/trading-212-mcp

Environment

T212_API_KEY, T212_API_SECRET

Claude Code

claude mcp add trading-212 \
  -e T212_API_KEY=your-key \
  -e T212_API_SECRET=your-secret \
  -e T212_ENV=live \
  -- npx -y github:joe-yeomans/trading-212-mcp

Claude Desktop / Cursor / other clients (mcpServers JSON config)

{
  "mcpServers": {
    "trading-212": {
      "command": "npx",
      "args": ["-y", "github:joe-yeomans/trading-212-mcp"],
      "env": {
        "T212_API_KEY": "your-key",
        "T212_API_SECRET": "your-secret",
        "T212_ENV": "live"
      }
    }
  }
}

If your client has no environment variable field, keep the credentials in a .env-style file (see .env.example) and add the arguments --config /absolute/path/to/.env.

Configuration

Variable

Required

Default

Description

T212_API_KEY

yes

API key

T212_API_SECRET

yes

API secret

T212_ENV

no

live

live or demo

Priority, highest first: flags (--api-key, --api-secret, --env), then the --config file, then environment variables.

Multiple accounts

Because a --config file overrides environment variables, you can run one connector per account (for example Invest and Stocks ISA), each with its own config file:

# ~/.config/trading-212-mcp/invest.env
T212_API_KEY=...
T212_API_SECRET=...

# ~/.config/trading-212-mcp/isa.env
T212_API_KEY=...
T212_API_SECRET=...
{
  "mcpServers": {
    "t212-invest": {
      "command": "npx",
      "args": ["-y", "github:joe-yeomans/trading-212-mcp", "--config", "/Users/you/.config/trading-212-mcp/invest.env"]
    },
    "t212-isa": {
      "command": "npx",
      "args": ["-y", "github:joe-yeomans/trading-212-mcp", "--config", "/Users/you/.config/trading-212-mcp/isa.env"]
    }
  }
}

Rate limits

Trading 212 sets rate limits per account, for example 1 request every 5s for the account summary and 1 request every 50s for the instrument list. If you hit a limit, the tool returns an error that says when the limit resets.

Development

git clone https://github.com/joe-yeomans/trading-212-mcp.git
cd trading-212-mcp
npm install        # also builds dist/
npm run dev        # tsc --watch

To run your local build, point your client at node /absolute/path/to/trading-212-mcp/dist/index.js.

License

MIT

Available Tools

9 tools
get_account_summaryAccount summaryB
Read-only

Cash, invested capital, unrealised P&L and total value of the Trading 212 account.

Inputs: no named parameters.

get_dividend_historyDividend historyB
Read-only

Dividends paid out to the account, newest first. Paginated via nextCursor.

Inputs: limit, cursor, ticker.

get_exchangesExchangesB
Read-only

Exchanges available on Trading 212 and their working schedules (opening hours).

Inputs: no named parameters.

get_order_historyOrder historyA
Read-only

Historical (filled, cancelled, rejected) orders, newest first. Paginated via nextCursor.

Inputs: limit, cursor, ticker.

get_pending_orderPending orderC
Read-only

A single pending order by its ID.

Inputs: id (required).

get_pending_ordersPending ordersB
Read-only

Orders that are currently active (not yet filled, cancelled or expired).

Inputs: no named parameters.

get_positionsOpen positionsA
Read-only

All open positions with quantity, average price, current price and P&L. Optionally filter by ticker.

Inputs: ticker.

get_transaction_historyTransaction historyA
Read-only

Deposits, withdrawals and other cash movements, newest first. Paginated via nextCursor.

Inputs: time, limit, cursor.

search_instrumentsSearch instrumentsA
Read-only

Search tradable instruments by ticker, name or ISIN. Use this to find the Trading 212 ticker (e.g. AAPL_US_EQ) for a company.

Inputs: query (required), limit.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 9 tools

    Disambiguation4/5

    Most tools target clearly distinct resources and actions, but the singular get_pending_order and plural get_pending_orders are easy to confuse at a glance. Descriptions do clarify the distinction, so misselection risk is moderate rather than severe.

    Naming Consistency5/5

    All tools use a consistent snake_case verb_noun convention (get_*, search_*), with predictable resource names. The singular/plural pair follows the same pattern and remains readable.

    Tool Count5/5

    Nine tools is well-scoped for a read-only Trading 212 account monitoring surface. Each tool covers a distinct piece of account data and no obvious redundancy inflates the set.

    Completeness3/5

    The read side of the domain is well covered, including account, positions, orders, dividends, and transactions. However, a server named trading-212-mcp lacks any order placement or cancellation tools, and there is no dedicated instrument-detail lookup beyond search, leaving notable gaps.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to interact with Trading 212 investment accounts for portfolio tracking, account management, and real-time order execution. It supports managing investment pies, analyzing historical data, and monitoring market performance across multiple instrument types.
      23
      2
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to manage Trading212 brokerage accounts, including portfolio analysis, order placement (demo mode), and investment pie management.
      5
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides read-only access to Trading 212 accounts, enabling AI assistants to retrieve portfolio positions, account summaries, instrument data, and transaction history.
      29 npm
      5
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to read PPI brokerage accounts, balances, positions, movements, market data and order history through the Portfolio Personal Inversiones REST API. Trading tools for placing, cancelling and transferring funds are disabled unless explicitly enabled.
      MIT