Skip to main content
Glama
AADHITYA369

mcp-market-server

by AADHITYA369

mcp-market-server

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: Data Puller MCP Server

提供的工具

工具

说明

get_klines

任何交易对/时间框架的 OHLCV K 线

get_orderbook

L2 订单簿快照

get_ticker

最新价格 / 24 小时统计

place_paper_order

模拟市价/限价订单(受风控保护)

cancel_order

取消一笔未成交的模拟订单

get_positions

未平仓仓位 + 未实现盈亏

get_orders

未成交/已成交订单历史

close_position

按市价平掉仓位

get_account

现金余额、权益、已实现/未实现盈亏

风险控制(模拟交易引擎)

  • 每笔订单的最大名义金额(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 用于存储订单/仓位/成交/审计记录——零依赖持久化,就像量化交易台记录每一项决策一样。

  • 风险层位于工具和引擎之间——与真实交易台的模式相同:策略提出,风险决定。

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

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.
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables fetching live crypto market data from Binance, Bybit, and Hyperliquid via MCP tools, including klines, orderbook, funding rates, technical indicators, and market breadth for real-time analysis by LLMs.
  • A
    license
    A
    quality
    A
    maintenance
    Enables AI agents to operate a local financial terminal, including market data, backtesting, paper portfolio management, and news digest, through safe, gated tools over MCP.
    6
    MIT
  • 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

View all related MCP servers

Related MCP Connectors

  • Agent-native crypto market-data over MCP+REST: order flow, whales, liquidations, calibrated scores

  • Crypto transaction firewall and risk tools for MCP agents.

  • MCP server exposing the Backtest360 engine API as tools for AI agents.

View all MCP Connectors

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/AADHITYA369/mcp-market-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server