Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trading 212 MCP Server

An MCP server that exposes the complete Trading 212 Public API (v0) as tools for Claude Code (and any other MCP client). Every REST endpoint in the official OpenAPI specification (see docs/api.json) is covered: account summary, instruments, orders, positions, historical events and pies.

⚠️ The Trading 212 API works only for Invest and Stocks ISA accounts. Orders execute only in the primary account currency. To sell, pass a negative quantity (e.g. -10.5).

Requirements

Installation in Claude Code

The server is published on npm as @abaddon83/trading212-mcp, so no clone or install is needed — register it once (starts against the demo environment — safe default):

claude mcp add --scope user trading212 \
  -e TRADING212_API_KEY=your_api_key \
  -e TRADING212_API_SECRET=your_api_secret \
  -e TRADING212_ENVIRONMENT=demo \
  -- npx -y @abaddon83/trading212-mcp

Switch TRADING212_ENVIRONMENT to live for real-money trading once you have tested against the paper-trading environment.

Alternatively, add it to a project's .mcp.json:

{
  "mcpServers": {
    "trading212": {
      "command": "npx",
      "args": ["-y", "@abaddon83/trading212-mcp"],
      "env": {
        "TRADING212_API_KEY": "your_api_key",
        "TRADING212_API_SECRET": "your_api_secret",
        "TRADING212_ENVIRONMENT": "demo"
      }
    }
  }
}

Verify with claude mcp list or by asking Claude: "What's my Trading 212 account summary?"

Configuration

Variable Required Description
TRADING212_API_KEY yes Your API key
TRADING212_API_SECRET yes Your API secret
TRADING212_ENVIRONMENT no demo (default, paper trading) or live (real money)

Authentication uses HTTP Basic auth (API_KEY:API_SECRET, Base64-encoded) on every request, as required by the API.

Tools

Accounts

Tool Endpoint Rate limit
get_account_summary GET /api/v0/equity/account/summary 1 / 5s

Instruments

Tool Endpoint Rate limit
get_exchanges GET /api/v0/equity/metadata/exchanges 1 / 30s
get_instruments GET /api/v0/equity/metadata/instruments 1 / 50s

get_instruments accepts an optional search parameter, applied client-side, because the full instrument list contains thousands of entries.

Orders

Tool Endpoint Rate limit
get_pending_orders GET /api/v0/equity/orders 1 / 5s
get_order_by_id GET /api/v0/equity/orders/{id} 1 / 1s
place_limit_order POST /api/v0/equity/orders/limit 1 / 2s
place_market_order POST /api/v0/equity/orders/market 50 / 1m
place_stop_order POST /api/v0/equity/orders/stop 1 / 2s
place_stop_limit_order POST /api/v0/equity/orders/stop_limit 1 / 2s
cancel_order DELETE /api/v0/equity/orders/{id} 50 / 1m

Positions

Tool Endpoint Rate limit
get_positions GET /api/v0/equity/positions 1 / 1s

Historical events

Tool Endpoint Rate limit
get_order_history GET /api/v0/equity/history/orders 6 / 1m
get_dividends GET /api/v0/equity/history/dividends 6 / 1m
get_transactions GET /api/v0/equity/history/transactions 6 / 1m
get_report_exports GET /api/v0/equity/history/exports 1 / 1m
request_report_export POST /api/v0/equity/history/exports 1 / 30s

List endpoints use cursor-based pagination: pass cursor and limit (default 20, max 50) and follow the nextPagePath field in the response until it is null.

Pies (deprecated upstream, still operational)

Tool Endpoint Rate limit
get_pies GET /api/v0/equity/pies 1 / 30s
get_pie GET /api/v0/equity/pies/{id} 1 / 5s
create_pie POST /api/v0/equity/pies 1 / 5s
update_pie POST /api/v0/equity/pies/{id} 1 / 5s
duplicate_pie POST /api/v0/equity/pies/{id}/duplicate 1 / 5s
delete_pie DELETE /api/v0/equity/pies/{id} 1 / 5s

Rate limiting

Limits are enforced per account by Trading 212. On HTTP 429 the tools return an error that includes the reset time from the x-ratelimit-reset header.

About

trading212 MCP

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages