t212-mcp
t212-mcp
Trading212 アカウント(サマリー、ポートフォリオ、現金、注文履歴、配当)をツールとして公開する MCP サーバーで、claude.ai にカスタムリモートコネクタとして直接接続することを想定しています。
claude.ai はパブリックインターネット経由でこのサーバーに到達し、T212 アカウントは live であるため、サーバーはツール呼び出しを提供する前に OAuth ログイン(設定した単一のパスワード)を要求します — auth.py を参照してください。
0. VPS にコードを取得し、前提条件をインストールする
git clone <this-repo-url> t212-mcp && cd t212-mcpVPS には git、rsync、uv がシステム全体にインストールされている必要があります(アプリは後で専用のシステムユーザーとしてホームディレクトリなしで実行されるため、自分の $HOME の下だけでは不十分です):
curl -LsSf https://astral.sh/uv/install.sh | sh
sudo cp "$HOME/.local/bin/uv" /usr/local/bin/uvRelated MCP server: Trading212 MCP Server
1. 設定
python3 setup_wizard.py対話形式で設定を進めます:T212 API キー/シークレット、ドメイン(独自ドメインがない場合は無料の <ip>.sslip.io を提供)、ログインパスワード — その後、chmod 600 で .env を書き込みます。再実行すると .env を最初から再生成します(上書き前に確認を求められます)。
手動で編集したい場合は? cp .env.example .env を実行して、以下を記入してください:
T212_API_KEY/T212_API_SECRET— Trading212 → 設定 → API(キー/シークレットのペア、Basic 認証)から取得。T212_ENV—liveまたはdemo。MCP_PUBLIC_URL— このサーバーが到達可能になる HTTPS URL(例:https://mcp.example.com、末尾スラッシュなし)。DNS とリバースプロキシ設定と一致する必要があります。MCP_DOMAIN— 上記と同じホスト(スキームなし。Caddy が TLS 証明書を要求するために使用)。MCP_AUTH_PASSWORD— あなただけが知っているパスワード。Claude を接続するときにブラウザで一度入力します。
2. DNS を VPS に向ける
MCP_DOMAIN のドメインに対して、VPS の IP を指す A/AAAA レコードを作成します。ポート 80 と 443 はインターネットから到達可能である必要があります。
以下の TLS リバースプロキシをインストールする前に、このマシンで 80/443 に既に何かがバインドされているか(他のサイトを提供する既存の nginx/Caddy)を確認してください:
sudo ss -tlnp | grep -E ':80|:443'3. 実行する
sudo useradd --system --no-create-home --shell /usr/sbin/nologin t212mcp
sudo mkdir -p /opt/t212-mcp
sudo rsync -a --exclude .venv --exclude __pycache__ --exclude .git ./ /opt/t212-mcp/
sudo chown -R t212mcp:t212mcp /opt/t212-mcp
cd /opt/t212-mcp
# t212mcp has no home dir, so point uv's cache somewhere it can write:
sudo -u t212mcp env HOME=/opt/t212-mcp UV_CACHE_DIR=/opt/t212-mcp/.cache/uv \
uv sync --frozen --no-dev
sudo cp deploy/t212-mcp.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now t212-mcp次に、上記の ss -tlnp の結果に応じて、ポート 8000 の前に TLS を配置します:
80/443 で何も実行されていない — Caddy(単一の静的バイナリ、アイドル時 RAM 約 10〜20MB)をインストールし、deploy/Caddyfile を指すように設定します:
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list sudo apt update && sudo apt install -y caddy set -a; source .env; set +a sudo bash -c "sed 's/{\$MCP_DOMAIN}/'\"$MCP_DOMAIN\"'/' deploy/Caddyfile > /etc/caddy/Caddyfile" sudo systemctl reload caddy他のサイト用に nginx が既に実行されている — deploy/nginx.conf.example を
/etc/nginx/sites-available/t212-mcpにコピーし、その中のmcp.example.comを実際の$MCP_DOMAINに置き換え、sites-enabledにシンボリックリンクを作成し、nginx -t && systemctl reload nginxを実行してから、sudo certbot --nginx -d $MCP_DOMAINを実行します(既存のサーバーブロックには影響しません)。
起動を確認します:
curl https://$MCP_DOMAIN/.well-known/oauth-authorization-server4. Claude に接続する
claude.ai で:設定 → コネクタ → カスタムコネクタを追加 を選択し、URL として https://<MCP_DOMAIN>/mcp を貼り付けます。Claude はこのサーバーのログインページへのブラウザタブを開きます — MCP_AUTH_PASSWORD を入力 — するとリダイレクトで戻り、接続されます。
ローカル開発
uv run python server.py は、同じ streamable-HTTP + OAuth サーバーをローカルの HOST:PORT(デフォルト 0.0.0.0:8000)で実行します — OAuth プロバイダーが無条件に組み込まれているため、ローカル実行でも MCP_PUBLIC_URL と MCP_AUTH_PASSWORD の環境変数が必要です。ローカルのみのテスト(TLS なし、Claude コネクタなし、ツールコードと OAuth フローを curl で試すだけ)には、MCP_PUBLIC_URL を http://127.0.0.1:8000 に向けてください。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Brazilian Open Finance MCP — 30+ banks (Itaú, Nubank, etc.) to Claude/Cursor. Read-only.
Real SEC, 13F, insider, congress & macro data your AI agent can cite. Hosted MCP, 24 tools.
MCP server exposing the Backtest360 engine API as tools for AI agents.
SmartMoney77 MCP v0.6.0 — 14 public tools that turn financial questions into exact numbers and citable links. New: historical_investment_return and compare_investments, which compute "what if I had invested" results from real yearly price data. Also compound interest, FIRE number, credit-card payoff, emergency fund, inflation, latte factor, investment fees, cost of waiting, plus discovery/deep-link/share-pack tools for a catalog of calculators in 6 languages (he/en/ar/es/pt/in). Public, no login. Endpoint: https://smartmoney77.com/mcp
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides secure access to Trading 212 Public API through MCP, enabling Claude Desktop users to manage portfolios, execute trades, and analyze market data using natural language commands.
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to manage Trading212 brokerage accounts, including portfolio analysis, order placement (demo mode), and investment pie management.5MIT
- FlicenseAqualityDmaintenanceAn MCP server that wraps the Trading 212 Public API, enabling AI agents to interact with your Trading 212 brokerage account through natural language.16
- AlicenseNot gradedqualityBmaintenanceExposes Trading 212 trading account, instruments, orders, history, and pies as MCP tools. Allows placing and canceling real orders (defaults to demo/paper environment).Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/joshua-repo/t212-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server