Sponsored by Deepsite.site

Trading212 Community Server

Created By
Rohan Pandit7 months ago
The Trading212 MCP server is a Model Context Protocol server implementation that provides seamless data connectivity to the Trading212 trading platform enabling advanced interaction capabilities via the public API.
Content

Trading212 MCP Server

License Version

Overview

The Trading212 MCP server is a Model Context Protocol server implementation that provides seamless data connectivity to the Trading212 trading platform enabling advanced interaction capabilities.

Core Features

Trading212 API Integration

  • Comprehensive account management:
    • Account metadata retrieval
    • Cash balance monitoring
    • Portfolio management with positions tracking
  • Advanced order handling:
    • Market orders
    • Limit orders
    • Stop-limit orders
    • Order history and management
  • Portfolio management:
    • Pies (portfolio buckets) management
    • Position tracking and search
    • Historical order data with pagination

Market Data Access

  • Tradeable instruments information
  • Exchange data with working schedules
  • Historical trading data access
  • Real-time market connectivity

Financial Analysis Tools

  • Professional financial analysis capabilities
  • Currency-aware data processing
  • Comprehensive trading data analysis
  • Risk management tools

MCP Protocol Support

  • Full MCP protocol implementation
  • Resource-based API endpoints
  • Tool-based functionality
  • Prompt-based analysis capabilities

Technical Requirements

  • Python >= 3.11 (as specified in .python-version)
  • Pydantic >= 2.11.4
  • Hishel

Tools

Instruments Metadata

  • search_exchange: Fetch exchanges, optionally filtered by name or ID
  • search_instrument: Fetch instruments, optionally filtered by ticker or name

Pies

  • fetch_pies: Fetch all pies
  • duplicate_pie: Duplicate a pie
  • create_pie: Create a new pie
  • update_pie: Update a specific pie by ID
  • delete_pie: Delete a pie

Equity Orders

  • fetch_all_orders: Fetch all equity orders
  • place_limit_order: Place a limit order
  • place_market_order: Place a market order
  • place_stop_order: Place a stop order
  • place_stop_limit_order: Place a stop-limit order
  • cancel_order: Cancel an existing order by ID
  • fetch_order: Fetch a specific order by ID

Account Data

  • fetch_account_cash: Fetch account cash balance
  • fetch_account_metadata: Fetch account id and currency

Personal Portfolio

  • fetch_open_positions: Fetch all open positions
  • search_specific_position_by_ticker: Search for a position by ticker using POST endpoint
  • fetch_open_position_by_ticker: Fetch a position by ticker (deprecated)

Historical items

  • fetch_historical_order_data: Fetch historical order data with pagination
  • fetch_paid_out_dividends: Fetch historical dividend data with pagination
  • fetch_exports_list: Lists detailed information about all csv account exports
  • request_export_csv: Request a CSV export of the account's orders, dividends and transactions history
  • fetch_transaction_list: Fetch superficial information about movements to and from your account

Resources

Account Resources

  • trading212://account/metadata
  • trading212://account/cash
  • trading212://account/portfolio
  • trading212://account/portfolio/{ticker}

Order Resources

  • trading212://orders
  • trading212://orders/{order_id}

Portfolio Resources

  • trading212://pies
  • trading212://pies/{pie_id}

Market Resources

  • trading212://instruments
  • trading212://exchanges

Reports Resources

  • trading212://history/exports

Prompts

Data Analysis

  • analyse_trading212_data: Analyse trading212 data with currency context

The prompt includes:

  • Professional financial expertise
  • Currency-aware analysis
  • Cautious financial advice
  • Dynamic currency information from account data

Installation

Clone repository

git clone https://github.com/RohanAnandPandit/trading212-mcp-server.git

Environment Configuration

Copy .env.example to .env and configure:

cp .env.example .env
# Edit .env with your configuration

Using Claude Desktop

Installing via Docker

  • Clone the repository and build a local image to be utilized by your Claude desktop client
cd trading212-mcp-server
docker build -t mcp/trading212-mcp-server .
  • Change your claude_desktop_config.json to match the following, replacing REPLACE_API_KEY with your actual key:

claude_desktop_config.json path

  • On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
  • On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "trading212": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "-e",
        "TRADING212_API_KEY",
        "mcp/trading212"
      ],
      "env": {
        "TRADING212_API_KEY": "REPLACE_API_KEY"
      }
    }
  }
}

Using uv

{
 "mcpServers": {
  "trading212": {
    "command": "uv",
    "args": [
        "run",
        "--directory",
        "<insert path to repo>",
        "src/server.py"
    ],
    "env": {
        "TRADING212_API_KEY": "<insert api key>"
    }
  }
 }
}

Generating API key

  • You can generate the API key from your account settings
  • Visit the Trading212 help centre for more information
  • If you are using the API key for the "Practice" account in Trading212 then set the ENVIRONMENT to demo in .env
  • Set ENVIRONMENT to live if you are using the API key for real money

Install packages

uv install

or

pip install -r requirements.txt

Running

After connecting Claude client with the MCP tool via json file and installing the packages, Claude should see the server's mcp tools:

You can run the server yourself via: In trading212-mcp-server repo:

uv run src/server.py

Using Python

{
 "mcpServers": {
  "trading212": {
    "command": "<insert path to python>",
    "args": [
        "<insert path to repo>/src/server.py"
    ]
  }
 }
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support, please:

  • Open an issue in the GitHub repository

Documentation

For the Trading212 API documentation, view the Public API docs.

This is an unofficial implementation of the Trading212 MCP protocol. Always consult official Trading212 documentation and terms of service before using this software.

Credits

Contributing

  • Please read our CONTRIBUTING.md for more information on how to contribute to this project.

Server Config

{
  "mcpServers": {
    "trading212": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "-e",
        "TRADING212_API_KEY",
        "mcp/trading212"
      ],
      "env": {
        "TRADING212_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Amap Maps高德地图官方 MCP Server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
ChatWiseThe second fastest AI chatbot™
Playwright McpPlaywright MCP server
Serper MCP ServerA Serper MCP Server
CursorThe AI Code Editor
DeepChatYour AI Partner on Desktop
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
WindsurfThe new purpose-built IDE to harness magic
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Tavily Mcp
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.