npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

t212-mcp-server

v2.0.0

Published

A Model Context Protocol (MCP) server for interacting with Trading212's API

Readme

T212 MCP Server

npm version License: MIT

A Model Context Protocol (MCP) server for interacting with the Trading 212 API. Gives AI assistants read-only access to your Trading 212 account — positions, account summary, instruments, order history, dividends, and more.

Features

  • 📊 Portfolio positions with P/L and wallet impact
  • 💰 Account summary (cash, investments, realized/unrealized P/L)
  • 🔍 Instrument search (16,000+ stocks, ETFs, and more)
  • 🏛️ Exchange schedules and working hours
  • 📜 Order history, dividend history, and transaction history
  • 📁 CSV export reports
  • 🔒 Read-only — no trading operations
  • 🧪 Demo mode for paper trading
  • 🤖 Compatible with Claude, and other MCP clients

Quick Start

Prerequisites

  • Node.js v18 or higher
  • A Trading 212 API key and secret (get yours here)
  • Claude Desktop or another MCP-compatible client

Configuration for Claude Desktop

Add this to your Claude Desktop configuration file:

Option 1: No installation required (recommended)

{
  "mcpServers": {
    "t212-mcp": {
      "command": "npx",
      "args": ["t212-mcp-server"],
      "env": {
        "T212_API_KEY": "your-api-key-id",
        "T212_API_SECRET": "your-api-secret"
      }
    }
  }
}

Option 2: Global installation

npm install -g t212-mcp-server
{
  "mcpServers": {
    "t212-mcp": {
      "command": "t212-mcp-server",
      "env": {
        "T212_API_KEY": "your-api-key-id",
        "T212_API_SECRET": "your-api-secret"
      }
    }
  }
}

Demo Mode

To use paper trading instead of your live account, add T212_ENVIRONMENT:

{
  "env": {
    "T212_API_KEY": "your-demo-api-key-id",
    "T212_API_SECRET": "your-demo-api-secret",
    "T212_ENVIRONMENT": "demo"
  }
}

How to access the Claude Desktop config file

  1. Open Claude Desktop Settings
  2. Go to the Developer tab
  3. Click "Edit Config"
  4. Add your configuration and save
  5. Restart Claude Desktop

For detailed configuration instructions, see the official MCP documentation.

Getting your Trading 212 API Credentials

  1. Log into your Trading 212 account
  2. Navigate to Settings → API
  3. Generate a new API key
  4. Copy both the API Key ID and the Secret Key (the secret is only shown at creation time)
  5. Use both values in your configuration as T212_API_KEY and T212_API_SECRET

For more details, see the Trading 212 Help Centre.

Available Tools

| Tool | Description | |------|-------------| | fetch-open-positions | All open positions with current price, P/L, and wallet impact | | fetch-position | A specific position by ticker | | fetch-account-summary | Account cash balance, investment value, and P/L | | search-instruments | Search 16,000+ instruments by name, ticker, or ISIN | | fetch-exchanges | All exchanges with next open/close times | | fetch-order-history | Historical filled orders (paginated) | | fetch-dividend-history | Dividend payments (paginated) | | fetch-transaction-history | Deposits and withdrawals (paginated) | | fetch-exports | CSV export reports with download links | | fetch-all-pies | Investment pies (deprecated by Trading 212) |

Environment Variables

| Variable | Required | Description | |----------|----------|-------------| | T212_API_KEY | Yes | Your Trading 212 API Key ID | | T212_API_SECRET | Yes | Your Trading 212 API Secret | | T212_ENVIRONMENT | No | live (default) or demo for paper trading |

Security Notes

  • ⚠️ Never commit your API credentials to version control
  • 🔒 Keep your MCP configuration file secure
  • 🔄 Regularly rotate your API keys
  • 📝 This server provides read-only access only

License

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

Support

If you encounter any issues or have questions:

  1. Check the issues page
  2. Create a new issue if your problem isn't already reported
  3. Provide as much detail as possible, including error messages and your configuration