home / mcp / trading 212 mcp server

Trading 212 MCP Server

Provides programmatic access to Trading 212 data and actions for account management, portfolios, orders, market data, and history via an MCP client.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "enderekici-trading212-mcp": {
      "command": "node",
      "args": [
        "/absolute/path/to/trading212-mcp/dist/index.js"
      ],
      "env": {
        "TRADING212_API_KEY": "your_api_key_here",
        "TRADING212_ENVIRONMENT": "demo"
      }
    }
  }
}

This MCP server enables you to securely connect your Trading 212 account to an AI assistant, allowing you to manage accounts, monitor portfolios, place orders, and analyze historical data through a standardized model context interface. It provides practical, scriptable access to Trading 212 data and actions, reducing manual steps and enabling automated decision support.

How to use

You will run the MCP server locally and connect your MCP client to it. The server exposes a set of endpoints that map to Trading 212 account management, portfolio access, order execution, market data, and historical data retrieval. You interact with these capabilities by sending requests through your MCP client, which then communicates with the server to perform actions and return results.

How to install

Prerequisites you need installed on your machine before starting: Node.js 18 or newer, a Trading 212 account, and a Trading 212 API key.

Additional sections

Configuration and security details follow. You will configure the server with your API key and environment, start the local MCP server, and then point your MCP client to it. You can run in a demo environment for testing and switch to live when you are ready.

Configuration

Environment variables your MCP server uses are defined in a configuration file at the project root. The required key is TRADING212_API_KEY and you may choose TRADING212_ENVIRONMENT to run in either demo or live mode.

Security and troubleshooting

Protect your API key by storing it in environment variables and avoiding exposure in version control. If you encounter authentication or rate limit errors, verify permissions and the selected environment, then retry after addressing the indicated limits.

Notes on usage

When you are ready to start, ensure the server is built and running, then connect your client to the local MCP server instance. Regularly monitor error messages and rate limit headers to maintain smooth operation.

Available tools

get_account_info

Retrieve account metadata including currency code and account ID.

get_account_cash

Get detailed cash balance information such as free cash, invested amount, and blocked funds.

get_account_summary

Fetch a comprehensive overview of all balances and profit or loss.

get_portfolio

List all open positions with current values and profit/loss.

get_position

Get detailed information about a specific position by ticker.

get_orders

Retrieve all active orders currently placed.

get_order

Get detailed information about a specific order by its ID.

cancel_order

Cancel an active order by its ID.

place_market_order

Place a market order to buy or sell immediately at the current market price.

place_limit_order

Place a limit order to execute at a specified price or better.

place_stop_order

Place a stop order that becomes a market order when triggered.

place_stop_limit_order

Place a stop-limit order that becomes a limit order when triggered.

get_instruments

List tradeable instruments with optional search filtering.

get_exchanges

Get information about exchanges and trading schedules.

get_pies

List all investment pies with their configurations.

get_pie

Get detailed information about a specific investment pie.

create_pie

Create a new investment pie with allocations and dividend reinvestment settings.

update_pie

Update an existing pie configuration.

delete_pie

Delete a specified investment pie.

get_order_history

Get historical orders with pagination support.

get_dividends

Get dividend payment history.

get_transactions

Get complete transaction history.

request_export

Request a CSV export of account data for a defined period.