mcp-market-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-market-serverFetch the last 100 hourly candles for BTCUSDT and summarize the trend."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-market-server
MCP (Model Context Protocol) server exposing live crypto market data and a paper-trading engine as standardized tool calls — so any agent (Claude Code, custom multi-agent systems) can query Bybit and execute simulated trades.
Built for the Tower Research Capital AI/ML intern application: demonstrates MCP integration, agent tool-calling, risk controls, and production-style Python.
Architecture
┌─────────────┐ 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
Tools Exposed
Tool | Description |
| OHLCV candles for any symbol/timeframe |
| L2 order book snapshot |
| Latest price / 24h stats |
| Market/limit order into paper engine (risk-guarded) |
| Cancel an open paper order |
| Open positions + unrealized P&L |
| Open/filled order history |
| Flatten a position at market |
| Cash balance, equity, realized/unrealized P&L |
Risk Guards (paper engine)
Max notional per order (
risk.max_order_notional_usd)Max open positions (
risk.max_open_positions)Daily loss halt — trading disabled once daily drawdown exceeds cap
Every order + decision is written to an audit log table
Setup
cd mcp-market-server
python -m venv .venv && .venv\Scripts\activate # Windows
pip install -e ".[dev]"
cp .env.example .env # optional overrides
pytest # run testsRegister with Claude Code
{
"mcpServers": {
"market": {
"command": "python",
"args": ["-m", "mcp_market_server.server"],
"cwd": "/absolute/path/to/mcp-market-server"
}
}
}Or with the CLI:
claude mcp add market -- python -m mcp_market_server.serverDemo Prompts (after registering)
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.Design Notes
Public endpoints only — no API keys, no real money. Paper engine fills market orders against live ticker price, limit orders when price touches.
SQLite for orders/positions/trades/audit — zero-dependency persistence, mirrors how quant desks log every decision.
Risk layer sits between tools and engine — same pattern as a real desk: strategy proposes, risk disposes.
This server cannot be deployed
Maintenance
Related MCP Connectors
Trade across 22+ exchanges and brokers from any MCP-capable AI agent, no install required.
Trade 16 crypto exchanges + MetaTrader 5 from your AI assistant via one MCP connection.
Agent-native crypto market-data over MCP+REST: order flow, whales, liquidations, calibrated scores
Crypto trading intelligence MCP — 34+ endpoints, x402 pay-per-use, AI agent strategy & execution
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables MCP-compatible AI clients to access live crypto market data and AI-driven quantitative analysis, with structured outputs and full observability.-
- FlicenseNot gradedqualityBmaintenanceEnables 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.-
- AlicenseBqualityDmaintenanceEnables AI agents to trade crypto with paper money, access market data, view leaderboards, and manage trading bots via an MCP-compatible interface.16MIT
- AlicenseAqualityAmaintenanceProvides 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.11571MIT