Skip to main content
Glama
mcp-market-server

mcp-market-server

by AADHITYA369

mcp-market-server

실시간 암호화폐 마켓 데이터와 모의 거래 엔진을 표준화된 도구 호출(tool call)로 노출하는 MCP(Model Context Protocol) 서버 — 모든 에이전트(Claude Code, 커스텀 멀티 에이전트 시스템)는 Bybit을 조회하고 시뮬레이션 거래를 실행할 수 있습니다.

Tower Research Capital AI/ML 인턴 지원용으로 제작되었습니다: MCP 통합, 에이전트 도구 호출, 위험 통제, 프로덕션 스타일의 Python을 보여 줍니다.

아키텍처

┌─────────────┐     MCP stdio      ┌──────────────────┐    REST     ┌─────────┐
│ Claude Code │ ◄───────────────► │  FastMCP Server  │ ─────────►  │  Bybit  │
│   / Agent   │                    │  (tools.py)      │  public API │   v5    │
└─────────────┘                    └────────┬─────────┘             └─────────┘
                                            │
                                   ┌────────▼─────────┐
                                   │  Paper Engine    │
                                   │  SQLite + Risk   │
                                   └──────────────────┘

Related MCP server: KirpyV3 MCP Server

노출된 도구

도구

설명

get_klines

모든 심볼/타임프레임의 OHLCV 캔들

get_orderbook

L2 오더북 스냅샷

get_ticker

최신 가격 / 24시간 통계

place_paper_order

모의 거래 엔진에 시장가/지정가 주문 (위험 방어 적용)

cancel_order

미체결 모의 주문 취소

get_positions

보유 포지션 + 미실현 손익

get_orders

미체결/체결 주문 내역

close_position

시장가로 포지션 청산

get_account

현금 잔액, 평가금액(equity), 실현/미실현 손익

위험 방어 장치 (모의 거래 엔진)

  • 주문당 최대 명목 금액 (risk.max_order_notional_usd)

  • 최대 보유 포지션 수 (risk.max_open_positions)

  • 일일 손실 정지 — 일일 손실폭이 상한을 넘으면 거래 비활성화

  • 모든 주문과 의사결정은 감사 로그 테이블에 기록됩니다

설치

cd mcp-market-server
python -m venv .venv && .venv\Scripts\activate     # Windows
pip install -e ".[dev]"
cp .env.example .env                                # optional overrides
pytest                                              # run tests

Claude Code에 등록

{
  "mcpServers": {
    "market": {
      "command": "python",
      "args": ["-m", "mcp_market_server.server"],
      "cwd": "/absolute/path/to/mcp-market-server"
    }
  }
}

또는 CLI로:

claude mcp add market -- python -m mcp_market_server.server

데모 프롬프트 (등록 후)

Fetch the last 100 hourly candles for BTCUSDT and summarize the trend.

Place a paper long of 0.01 BTCUSDT with a 2% stop loss and take profit at 3%.

Show my account, then flatten everything if unrealized PnL is worse than -$50.

설계 노트

  • 공개 엔드포인트만 사용 — API 키가 필요 없고 실제 돈도 사용되지 않습니다. 모의 거래 엔진은 시장가 주문을 실시간 티커 가격 기준으로 체결하고, 지정가 주문은 가격이 닿으면 체결합니다.

  • SQLite — 주문/포지션/체결/감사 기록용. 의존성 없는 영속성을 제공하며, 퀀트 데스크가 모든 의사결정을 기록하는 방식과 동일합니다.

  • 위험 관리 레이어는 도구와 엔진 사이에 위치 — 실제 매매 데스크와 동일한 패턴: 전략은 제안하고, 위험 관리가 최종 판단합니다.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables MCP-compatible AI clients to access live crypto market data and AI-driven quantitative analysis, with structured outputs and full observability.
    -
  • A
    license
    B
    quality
    D
    maintenance
    Enables AI agents to trade crypto with paper money, access market data, view leaderboards, and manage trading bots via an MCP-compatible interface.
    16
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Provides live financial data for any LLM agent, including stock quotes, crypto prices, SEC filings, XBRL financials, FX rates, and macro indicators, through ten MCP tools.
    11
    109 npm
    1
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to retrieve real-time cryptocurrency quotes, portfolio state, risk scores (0-100), and timestamped market context through MCP tools, replacing hallucinated prices with verifiable market data.
    MIT