Skip to main content
Glama
joshua-repo

t212-mcp

by joshua-repo

t212-mcp

Trading212 계정(요약, 포트폴리오, 현금, 주문 내역, 배당금)을 도구로 노출하는 MCP 서버로, claude.ai에 커스텀 원격 커넥터로 직접 연결하기 위한 것입니다.

claude.ai가 공개 인터넷을 통해 이 서버에 접근하고 T212 계정이 live 상태이므로, 서버는 도구 호출을 처리하기 전에 OAuth 로그인(사용자가 설정한 단일 비밀번호)을 요구합니다 — auth.py 참조.

0. VPS에 코드를 가져오고 사전 요구사항 설치

git clone <this-repo-url> t212-mcp && cd t212-mcp

VPS에 필요한 것: git, rsync, 그리고 uv시스템 전체에 설치해야 합니다(자신의 $HOME 아래에만 설치하는 것이 아니라, 앱이 나중에 홈 디렉터리가 없는 전용 시스템 사용자로 실행되기 때문입니다):

curl -LsSf https://astral.sh/uv/install.sh | sh
sudo cp "$HOME/.local/bin/uv" /usr/local/bin/uv

Related 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 → Settings → API에서 가져옵니다(Key/Secret 쌍, Basic auth).

  • T212_ENVlive 또는 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(단일 정적 바이너리, 유휴 시 ~10-20MB RAM)를 설치하고 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-server

4. Claude에 연결

claude.ai에서: Settings → Connectors → Add custom connector를 선택하고 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_URLMCP_AUTH_PASSWORD 환경 변수가 필요합니다. 로컬 전용 테스트(TLS 없음, Claude 커넥터 없음, curl로 도구 코드와 OAuth 흐름을 테스트하기 위한 용도)에서는 MCP_PUBLIC_URLhttp://127.0.0.1:8000으로 지정하세요.

Maintenance

ActivityMaintained
ResponsivenessSyncing

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

  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides 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.
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to manage Trading212 brokerage accounts, including portfolio analysis, order placement (demo mode), and investment pie management.
    5
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    An MCP server that wraps the Trading 212 Public API, enabling AI agents to interact with your Trading 212 brokerage account through natural language.
    16
  • A
    license
    Not graded
    quality
    B
    maintenance
    Exposes 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

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