home / mcp / 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.
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.
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.
Prerequisites you need installed on your machine before starting: Node.js 18 or newer, a Trading 212 account, and a Trading 212 API key.
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.
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.
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.
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.
Retrieve account metadata including currency code and account ID.
Get detailed cash balance information such as free cash, invested amount, and blocked funds.
Fetch a comprehensive overview of all balances and profit or loss.
List all open positions with current values and profit/loss.
Get detailed information about a specific position by ticker.
Retrieve all active orders currently placed.
Get detailed information about a specific order by its ID.
Cancel an active order by its ID.
Place a market order to buy or sell immediately at the current market price.
Place a limit order to execute at a specified price or better.
Place a stop order that becomes a market order when triggered.
Place a stop-limit order that becomes a limit order when triggered.
List tradeable instruments with optional search filtering.
Get information about exchanges and trading schedules.
List all investment pies with their configurations.
Get detailed information about a specific investment pie.
Create a new investment pie with allocations and dividend reinvestment settings.
Update an existing pie configuration.
Delete a specified investment pie.
Get historical orders with pagination support.
Get dividend payment history.
Get complete transaction history.
Request a CSV export of account data for a defined period.