{
  "markdown": "# Trading 212 MCP Server\n\n[![PyPI](https://img.shields.io/pypi/v/trading212-mcp-server)](https://pypi.org/project/trading212-mcp-server/)\n![Downloads](https://img.shields.io/pypi/dm/trading212-mcp-server?color=8B4513)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Glama](https://glama.ai/mcp/servers/KyuRish/trading212-mcp-server/badges/score.svg)](https://glama.ai/mcp/servers/@KyuRish/trading212-mcp-server)\n![Python](https://img.shields.io/badge/Python-3.11+-blue?logo=python)\n![MCP](https://img.shields.io/badge/MCP-compatible-purple)\n![Tools](https://img.shields.io/badge/Tools-32-orange)\n\n<!-- mcp-name: io.github.KyuRish/trading212-mcp-server -->\n\nConnect your AI assistant to your Trading 212 brokerage account. Ask questions about your portfolio, place trades, manage pies, and analyze dividends - all through natural language.\n\nWorks with **Claude Desktop, Claude Code, ChatGPT, Gemini, Cursor, Windsurf**, and any client that supports the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/).\n\n## Why this server?\n\n- **32 tools** covering the full Trading 212 API, plus 4 analytics tools that combine multiple API calls into actionable insights\n- **Smart rate limiting** - reads T212's rate limit headers, auto-waits, and retries on 429 (up to 3 times). No rate limit errors leak to your AI\n- **Zero config** - install from PyPI, add your API key, done. No Docker, no database, no Redis\n- **Typed responses** - every tool returns structured Pydantic models, not raw JSON\n- **Paper trading** - set `ENVIRONMENT=demo` to test with virtual money first\n\n## What can it do?\n\n| Category | Tools | Examples |\n|----------|-------|---------|\n| **Analytics** | Portfolio summary, performance, dividends, activity | \"Show me my portfolio P&L\" |\n| **Trading** | Market, limit, stop, stop-limit orders | \"Buy 5 shares of AAPL\" |\n| **Portfolio** | Positions, cash balance, account info | \"What's my cash balance?\" |\n| **Pies** | Create, update, duplicate, delete pies | \"Show my pie allocations\" |\n| **Market Data** | Instrument search, exchange schedules | \"Search for Tesla\" |\n| **History** | Past orders, dividends, transactions, CSV exports | \"Show my dividend history\" |\n\n### Analytics tools\n\nThese combine multiple API calls into single high-level responses:\n\n- **`fetch_portfolio_summary`** - Complete snapshot: total value, P&L, cash, top holdings, allocation\n- **`fetch_portfolio_performance`** - Per-position returns with dividends, best/worst performers\n- **`fetch_dividend_summary`** - Income analysis grouped by ticker and month\n- **`fetch_recent_activity`** - Combined timeline of trades and transactions\n\n## Quick start\n\n### Install\n\n```bash\nuvx trading212-mcp-server\n```\n\nOr via pip:\n\n```bash\npip install trading212-mcp-server\n```\n\n### Get your API credentials\n\nFrom the Trading 212 app: **Settings > API (Beta)**. You need both the API Key and Secret - the server uses Basic Auth.\n\n### Connect to Claude Desktop\n\nAdd to `claude_desktop_config.json` (Windows: `%APPDATA%\\Claude\\`, Mac: `~/Library/Application Support/Claude/`):\n\n```json\n{\n  \"mcpServers\": {\n    \"trading212\": {\n      \"command\": \"uvx\",\n      \"args\": [\"trading212-mcp-server\"],\n      \"env\": {\n        \"TRADING212_API_KEY\": \"<your-api-key>\",\n        \"TRADING212_API_SECRET\": \"<your-api-secret>\",\n        \"ENVIRONMENT\": \"live\"\n      }\n    }\n  }\n}\n```\n\n### Connect to Claude Code\n\n```bash\nclaude mcp add trading212 -- uvx trading212-mcp-server\n```\n\nThen set the environment variables in your shell or `.env` file.\n\n### Other clients (Cursor, Windsurf, ChatGPT, etc.)\n\nSame command and env vars - configure per your client's MCP docs. Set `ENVIRONMENT` to `demo` for paper trading.\n\n### From source\n\n```bash\ngit clone https://github.com/KyuRish/trading212-mcp-server.git\ncd trading212-mcp-server\ncp .env.example .env  # fill in your API keys\nuv sync\nuv run -m trading212_mcp_server.server\n```\n\n<details>\n<summary><code>claude_desktop_config.json</code> for source installs</summary>\n\n```json\n{\n  \"mcpServers\": {\n    \"trading212\": {\n      \"command\": \"uv\",\n      \"args\": [\"run\", \"--directory\", \"<path-to-repo>\", \"-m\", \"trading212_mcp_server.server\"],\n      \"env\": {\n        \"TRADING212_API_KEY\": \"<your-api-key>\",\n        \"TRADING212_API_SECRET\": \"<your-api-secret>\",\n        \"ENVIRONMENT\": \"live\"\n      }\n    }\n  }\n}\n```\n\n</details>\n\n## All 32 tools\n\n### Analytics (composite)\n| Tool | Description |\n|------|-------------|\n| `fetch_portfolio_summary` | Complete portfolio snapshot with P&L and allocations |\n| `fetch_portfolio_performance` | Per-position returns, dividends, best/worst performers |\n| `fetch_dividend_summary` | Dividend income by ticker and month |\n| `fetch_recent_activity` | Combined timeline of trades and transactions |\n\n### Account\n| Tool | Description |\n|------|-------------|\n| `fetch_account_info` | Account metadata (currency, ID) |\n| `fetch_account_cash` | Cash balance, invested value, P&L |\n| `fetch_all_open_positions` | All portfolio positions with live prices |\n| `search_specific_position_by_ticker` | Single position lookup by ticker |\n\n### Trading\n| Tool | Description |\n|------|-------------|\n| `place_market_order` | Buy/sell at current market price |\n| `place_limit_order` | Buy/sell at specified price or better |\n| `place_stop_order` | Trigger order at stop price |\n| `place_stop_limit_order` | Stop trigger with limit execution |\n| `fetch_all_orders` | List all pending orders |\n| `fetch_order` | Get specific order by ID |\n| `cancel_order` | Cancel a pending order |\n\n### Pies\n| Tool | Description |\n|------|-------------|\n| `fetch_pies` | List all investment pies |\n| `fetch_a_pie` | Pie details with instrument allocations |\n| `create_pie` | Create a new pie with target weights |\n| `update_pie` | Update pie settings and allocations |\n| `duplicate_pie` | Clone an existing pie |\n| `delete_pie` | Remove a pie |\n\n### Market Data\n| Tool | Description |\n|------|-------------|\n| `search_instrument` | Search tradeable instruments by ticker or name |\n| `search_exchange` | Search available exchanges |\n\n### History\n| Tool | Description |\n|------|-------------|\n| `fetch_historical_order_data` | Past orders with pagination |\n| `fetch_paid_out_dividends` | Dividend payment history |\n| `fetch_transaction_list` | Deposits and withdrawals |\n| `fetch_exports_list` | List CSV export reports |\n| `request_csv_export` | Request a new CSV export |\n\n## Compatibility\n\nTested with these MCP clients:\n\n| Client | Status |\n|--------|--------|\n| Claude Desktop | Supported |\n| Claude Code | Supported |\n| Cursor | Supported |\n| Windsurf | Supported |\n| Any MCP-compatible client | Supported |\n\n## Author\n\nBuilt by [Rishabh Dogra](https://github.com/KyuRish).\n\n## Support\n\nIf this server saves you time, a coffee would mean a lot.\n\n[![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=flat&logo=buy-me-a-coffee&logoColor=black)](https://buymeacoffee.com/kyuish)\n\n## License\n\nMIT\n",
  "bytes": 6988,
  "sha": "7c3c02d60b894d5fa3120d084cc42426276a0f412bec3341c9685cb49242abc7",
  "repo_slug": "kyurish/trading212-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_kyurish_trading212_mcp_server_70c13251/readme"
}