mcp -trading212
A Model Context Protocol (MCP) connector tool for interfacing agentic AI with the Trading212 broker
claude mcp add --transport stdio lukeplausin-mcp-server-trading212 uv --directory parent_of_servers_repo/servers/src/mcp_server_trading212 run --api-key <KEEP_THIS_A_SECRET> --environment demo mcp-server-trading212 \ --env TRADING212_API_KEY="your-trading212-api-key" \ --env TRADING212_ENVIRONMENT="demo"
How to use
This MCP server exposes a Trading212 integration that lets an AI-driven agent analyse your portfolio, receive stock suggestions, and perform ordering actions through Trading212. The server provides dynamic resources for accessing your portfolio, account info, cash balance, and instrument metadata, plus tools for placing orders and creating or updating investment pies (where available). The included tools are designed to be invoked by MCP-enabled clients (such as Claude Desktop or Gemini CLI) to fetch market data, place orders, and manage your Trading212 account in demo mode before connecting to a live account. The server is configured to cache API results in memory with a default TTL to respect Trading212 rate limits; you can supply a Redis instance to replace the cache if desired.
How to install
Prerequisites:
- Python 3.11+ installed on your system
- Access to the MCP server repository (cloned or downloaded)
- Optional: Redis server running on localhost if you want to replace in-memory caching
Option A: Run via uv (recommended for Python users)
- Install Python and pip if not already installed.
- Install uv if not present (via pipx or pip): pip install uv # or via pipx install uvx
- Navigate to the MCP Trading212 server directory: cd path/to/your/repo/servers/src/mcp_server_trading212
- Run the server in demo environment using your API key: uv --directory path/to/your/repo/servers/src/mcp_server_trading212 run --api-key <KEEP_THIS_A_SECRET> --environment demo mcp-server-trading212
Option B: Run via Docker (if a docker image exists)
- Ensure Docker is installed and running.
- Run the container (example, replace image-name with the actual image): docker run -it image-name
Option C: NPM/Node.js path (not the primary path for this server)
- This MCP server is described as Python/uv-based; Node.js is not the intended runtime here. If you have a node-based wrapper, use the provided npm package name in place of the uv command accordingly.
Prerequisites recap:
- Access credentials for Trading212 (demo environment for testing)
- Knowledge of the correct directory and module name for your setup
- Optional Redis for caching if you want persistent caching across restarts
Additional notes
Tips and caveats:
- Always test in Trading212 demo mode before enabling live trading.
- Do not store your Trading212 API key in plaintext in your environment files or code; consider a secret manager where possible.
- If using SSE mode, you can expose the MCP server over HTTP and keep your API key on the tool server side; ensure HTTPS and mutual TLS if exposing publicly.
- When using the Claude Desktop or Gemini CLI integrations, ensure the mcpServers entry matches the actual runtime (uv for Python, uvx for SSE proxy) and pass the correct environment variable names and endpoints.
- The server currently supports: get_portfolio, get_account_info, get_account_cash, get_all_instruments, get_instrument_list, get_instrument, search_instruments, place_order, and update_pie (coming soon). Some actions (like create_pie or cancel_order) may be in development and not always available in a given build.
- For performance in noisy environments, consider pointing the server to a Redis cache on port 6379 to reduce repeated API calls.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP