Skip to main content
Glama
Trading 212 MCP Server

Trading 212 MCP Server

Trading 212 MCP 서버

MCP를 통한 Claude용 안전한 Trading 212 공개 API 액세스

빌드 도구:

프로젝트 개요

이 프로젝트는 Trading 212 공개 API 기능을 MCP 도구로 노출하여 Claude Desktop이 계정, 시장, 주문, 기록 및 파이(Pie) 데이터를 안전하게 쿼리할 수 있도록 합니다. 사용자 지정 UI를 구축하지 않고도 포트폴리오 워크플로우에 자연어로 액세스하려는 사용자를 대상으로 합니다. 주요 가치는 구조화된 오류, 엄격한 환경 처리 및 도구 우선 MCP 통합을 갖춘 모듈식 기능 기반 TypeScript 아키텍처입니다.

Related MCP server: Trading 212 MCP Server

주요 기능

  • Claude 지원 MCP 도구 - MCP를 통해 Claude Desktop에서 직접 Trading 212 작업을 사용하세요.

  • 공개 API 호환 인증 - API 키 + API 비밀을 사용하는 Trading 212 기본 인증을 지원합니다.

  • 전체 파이(Pie) 커버리지 - 파이 목록 조회, ID별 가져오기, 생성, 업데이트, 복제 및 삭제 작업을 포함합니다.

  • 주문 워크플로우 포함 - 보류 중인 주문, 주문 세부 정보, 지정가, 시장가, 스톱 및 스톱-지정가 주문 배치/취소.

  • 기록 + 내보내기 작업 - 커서 기반 기록 주문, 배당금, 거래 및 CSV 내보내기 요청/목록 엔드포인트.

  • 타입 지정 오류 모델 - 일관된 인증, 유효성 검사, 속도 제한, 찾을 수 없음 및 API 오류 처리.

빠른 시작 데모

로컬에서 실행한 다음 MCP Inspector를 사용하여 도구를 검사하세요:

npx @modelcontextprotocol/inspector

stdio 모드의 경우, Inspector 명령을 다음과 같이 구성하세요:

bun run src/server.ts

기술 스택

  • 언어: TypeScript (strict 모드)

  • 런타임: Bun 1.x (Node.js 18+ 호환)

  • MCP: @modelcontextprotocol/sdk

  • 유효성 검사/스키마: zod

  • 구성: dotenv

  • 테스트: Bun 테스트 러너 (bun test src)

설치 및 설정

사전 요구 사항

  • Bun 1.0+

  • Node.js 18+

  • Trading 212 공개 API 자격 증명 (TRADING212_API_KEY, TRADING212_API_SECRET)

  • Claude Desktop (MCP 통합용)

설정

  1. 저장소 복제

    git clone https://github.com/razeevascx/212mcp.git
  2. 프로젝트로 이동

    cd 212mcp
  3. 종속성 설치

    bun install
  4. 환경 구성

    cp .env.example .env
  5. .env에 자격 증명 설정

    TRADING212_API_KEY=your_api_key_here
    TRADING212_API_SECRET=your_api_secret_here
    ENVIRONMENT=live
    TRANSPORT=stdio
    LOG_LEVEL=info
    DEBUG=false
  6. 프로젝트 빌드

    bun run build
  7. 서버 시작

    bun run start

확인

  • 터미널 출력에서 Trading 212 MCP Server running이 표시되어야 합니다.

  • Claude Desktop에서 MCP 도구를 열고 Trading 212 도구가 나열되어 있는지 확인하세요.

Claude Desktop 구성

다음 MCP 서버 구성을 사용하세요:

{
  "mcpServers": {
    "trading212": {
      "command": "/absolute/path/to/212mcp/start.sh"
    }
  }
}

start.sh를 생성하고 실행 가능하게 만드세요:

#!/bin/bash
set -euo pipefail
set -a
source /absolute/path/to/212mcp/.env
set +a
exec bun run /absolute/path/to/212mcp/src/server.ts

MCP 도구

계정

  • fetch_account_cash

  • fetch_account_metadata

상품

  • search_exchange

  • search_instrument

포트폴리오 / 포지션

  • fetch_open_positions (선택적 ticker 필터)

주문

  • fetch_all_orders

  • fetch_order

  • place_limit_order

  • place_market_order

  • place_stop_order

  • place_stop_limit_order

  • cancel_order

기록

  • fetch_historical_order_data

  • fetch_paid_out_dividends

  • fetch_transaction_list

  • fetch_exports_list

  • request_export_csv

파이(Pies)

  • fetch_pies

  • fetch_pie

  • create_pie

  • update_pie

  • duplicate_pie

  • delete_pie

서버 유틸리티

  • get_server_health

API 사용 참고 사항

  • 인증: Trading 212 공개 API는 BaseClient에서 처리하는 기본 인증(API_KEY:API_SECRET)을 사용합니다.

  • 환경 라우팅: ENVIRONMENT=demo|live는 Trading 212 데모/라이브 기본 URL에 매핑됩니다.

  • 페이지 매기기: 기록 엔드포인트는 limit + cursor를 사용하며 nextPagePath를 반환합니다.

  • 속도 제한: API에는 속도 제한이 있으며, 429는 RATE_LIMIT_EXCEEDED로 표시됩니다.

개발

스크립트

  • bun run build — TypeScript 컴파일

  • bun run start — MCP 서버 시작

  • bun run dev — 감시 모드

  • bun test src — src에서 테스트 실행

문제 해결

  • 자격 증명 누락: TRADING212_API_KEY 및 TRADING212_API_SECRET을 설정하세요.

  • 인증 오류: API 자격 증명을 재생성하고 서버를 다시 시작하세요.

  • Claude 연결 불가: Bun 설치, 명령 경로 및 Claude MCP 구성을 확인하세요.

시작 시 서버는 인증 구성을 확인하고 자격 증명이 불완전하면 즉시 실패합니다.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    • Connect Claude, ChatGPT, Codex, Claude Code or another MCP client to your real multi-broker investment portfolio. Fortunest tracks stocks, ETFs and crypto across brokers and exchanges; its MCP server lets your agent read holdings, returns, allocation, risk, trades and tax lots, calculated by Fortunest rather than guessed by the model. Reads run on their own; every change waits for your approval in the Fortunest app, and no tool places an order or moves money. Sign-in is OAuth 2.1 and needs Fortunest Pro (14-day trial, no card). A free demo that needs no account is listed as Fortunest demo.

      https://app.fortunest.ai/mcp
    • Connect brokerage accounts to AI assistants: holdings, orders, asset lookup, and approved trading.

      https://mcp.tradeit.app/mcp
    • Build and backtest investing strategies from your AI assistant. Remote MCP with OAuth sign-in.

      https://tactfolio.com/mcp
    • OpenFinance gives any AI agent easy trading across every major market through one hosted MCP server. Trade crypto spot and perpetuals on Hyperliquid with market, limit and TWAP orders, leverage and margin control. Trade stocks, indices, commodities, forex and pre-IPO names as Hyperliquid HIP-3 perps. Trade Polymarket prediction markets with odds, order books, positions, PnL and trader leaderboards. Swap and bridge across 40+ EVM chains and Solana with Relay and Jupiter, find memecoins across 200+ chains, launch tokens on Robinhood Chain and Solana, and buy crypto with card, bank or UPI. Write actions are designed to ask for your confirmation first. Connect with OAuth (sign in to OpenFinance and approve) or an API key. Works with Claude, ChatGPT, Cursor, VS Code, Codex and any MCP client. No install. Home: https://openfinance.tech/agents · Docs: https://docs.openfinance.tech · GitHub: https://github.com/openfinance-tech/mcp

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to interact with Trading 212 investment accounts for portfolio tracking, account management, and real-time order execution. It supports managing investment pies, analyzing historical data, and monitoring market performance across multiple instrument types.
      23
      2
      MIT
    • 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
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to read a Trading 212 portfolio (balances, positions, orders, history) and place trades via the public API, supporting both demo and live environments.
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Exposes Trading212 account data (summary, portfolio, cash, order history, dividends) as MCP tools, intended for direct connection to Claude.ai.
      -