Market.ai MCP Server Setup

Market.ai provides a Model Context Protocol (MCP) server that lets AI agents and LLMs access real-time market intelligence through structured tool calls. This is the primary delivery channel for AI trading agents.

What is MCP?

The Model Context Protocol (MCP) is an open standard for connecting AI models to external data sources and tools. Instead of asking an AI to browse the web or parse API documentation, MCP lets AI agents call structured tools directly and receive typed responses.

Market.ai's MCP server delivers pre-digested, token-efficient market data (~300 tokens per symbol) that AI agents can use for trading decisions without wasting context window on raw exchange JSON.


Quick Start

  1. Get an API key at market-ai.dev
  2. Configure your MCP client (Claude Desktop, Cursor, or custom)
  3. Start asking about markets

Claude Desktop Setup

Add the following to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "market-ai": {
      "url": "https://mcp.market-ai.dev/mcp",
      "headers": {
        "Authorization": "Bearer mk_live_abc123..."
      }
    }
  }
}

After saving the configuration, restart Claude Desktop. You should see the Market.ai tools available in the tool picker.


Cursor IDE Setup

In Cursor, open Settings and navigate to MCP Servers. Add a new server:

Name: market-ai URL: https://mcp.market-ai.dev/mcp Headers:

{
  "Authorization": "Bearer mk_live_abc123..."
}

Alternatively, add to your project's .cursor/mcp.json:

{
  "mcpServers": {
    "market-ai": {
      "url": "https://mcp.market-ai.dev/mcp",
      "headers": {
        "Authorization": "Bearer mk_live_abc123..."
      }
    }
  }
}

Available Tools

get_market_context

Get a comprehensive ~300-token market context for a symbol. This is the primary tool for getting a quick snapshot of market conditions. Includes price, spread, OBI (orderbook imbalance), top exchanges by volume, walls, arb opportunities, and active signals.

Parameters:

ParameterTypeRequiredDescription
symbolstringYesTrading pair, e.g., BTC/USDT

Example response:

{
  "sym": "BTC/USDT",
  "px": "67450.25",
  "chg": "67448.10",
  "vol": "45200",
  "obi": 0.12,
  "sprd": 3.2,
  "xchg": [
    {"n": "binance", "px": "67450.15", "vol": "12500.5"},
    {"n": "bybit", "px": "67449.50", "vol": "8200.3"},
    {"n": "okx", "px": "67451.00", "vol": "6800.1"}
  ],
  "arb": {"bps": 12, "pair": "kraken-binance"},
  "sigs": [
    {"t": "whale_movement", "sev": "alert", "msg": "Whale buy on Binance: $2.5M"}
  ]
}

The response uses abbreviated keys to minimize token usage: px (price), chg (change/VWAP), vol (volume), obi (orderbook imbalance), sprd (spread bps), xchg (exchanges), sigs (signals), narr (narrative).


get_signals

Get active market signals, optionally filtered.

Parameters:

ParameterTypeRequiredDescription
symbolstringNoFilter by trading pair
severitystringNoFilter: info, warning, alert, critical
typestringNoFilter by signal type
limitnumberNoMax results (default 20, max 100)

Signal types: whale_movement, liquidation_cascade, funding_spike, orderbook_imbalance, spread_anomaly, volume_spike, cross_exchange_divergence, wall_appearance, wall_removal, price_level_break


get_orderbook

Get the analyzed orderbook for a specific exchange and symbol, including walls, OBI, depth analysis, and spread.

Parameters:

ParameterTypeRequiredDescription
exchangestringYesExchange name (e.g., binance)
symbolstringYesTrading pair (e.g., BTC/USDT)

Valid exchanges: binance, coinbase, bybit, okx, kraken, kucoin, bitfinex, gateio, mexc, htx, dydx, hyperliquid, alpaca


get_funding_rates

Get perpetual funding rates across all exchanges for a given symbol.

Parameters:

ParameterTypeRequiredDescription
symbolstringYesTrading pair (e.g., BTC/USDT)

get_cross_exchange_arb

Get cross-exchange arbitrage opportunities, sorted by spread (highest first).

Parameters:

ParameterTypeRequiredDescription
min_bpsnumberNoMinimum spread in basis points (default 0)

get_liquidations

Get recent liquidation events, optionally filtered.

Parameters:

ParameterTypeRequiredDescription
symbolstringNoFilter by trading pair
min_usdnumberNoMinimum notional USD value (default 0)
hoursnumberNoLookback window in hours (default 24)

get_polymarket

Get current Polymarket crypto Up/Down prediction market prices. Shows the probability-implied odds on whether BTC, ETH, SOL, or XRP will go up or down across 5-minute, 15-minute, hourly, and daily timeframes.

Parameters:

ParameterTypeRequiredDescription
coinstringNoCoin: BTC, ETH, SOL, XRP. Omit for all.
timeframestringNoTimeframe: 5m, 15m, 1h, daily. Omit for all.

Example response:

{
  "total": 1,
  "items": [
    {
      "coin": "BTC",
      "timeframe": "1h",
      "upPrice": "0.545",
      "downPrice": "0.455",
      "volume": "25000.50",
      "liquidity": "12000.00",
      "active": true,
      "resolved": false,
      "timeRemainingSeconds": 3300
    }
  ]
}

Prices range from 0.00 to 1.00 and represent the implied probability. An upPrice of 0.545 means the market estimates a 54.5% chance BTC will be higher at the end of the interval.


subscribe_feed

Subscribe to real-time market data streaming. This tool redirects to the WebSocket Push API, which is the proper channel for continuous data delivery.

Parameters:

ParameterTypeRequiredDescription
symbolsstring[]YesTrading pairs to subscribe to
channelsstring[]YesData channels to subscribe to

search_historical

Semantic search over historical market signals and narratives using vector similarity. Find patterns similar to past events (e.g., "find patterns similar to last BTC liquidation cascade").

Parameters:

ParameterTypeRequiredDescription
querystringYesNatural language search query
symbolstringNoFilter by trading pair
severitystringNoFilter by severity level
typestringNoFilter by signal type
fromnumberNoStart timestamp (Unix ms)
tonumberNoEnd timestamp (Unix ms)
limitnumberNoMax results (default 10)

Available Prompts

market_analyst

System prompt that configures the AI as a professional market analyst. Instructs it to:

  • Start with get_market_context for current state
  • Check get_signals for anomalies
  • Use get_orderbook for order flow analysis
  • Cross-reference funding rates for sentiment
  • Check Polymarket odds for probability consensus
  • Present structured, data-driven findings

trade_advisor

System prompt that configures the AI as a trading advisor. Instructs it to:

  • Gather data before making recommendations
  • Consider multiple timeframes and sources
  • Identify key support/resistance from orderbook walls
  • Factor in funding rates for position bias
  • Monitor liquidation cascade risks
  • Provide specific entry/exit levels with risk management
  • Note confidence level with reasoning

Available Resources

Resources provide static context that AI agents can read.

market://exchanges

List of all 13 supported exchanges with their current connection status.

market://symbols

List of all currently tracked trading pair symbols.

market://status

System health status including Redis connectivity, number of connected exchanges, and count of tracked symbols.


Example Conversations

Market Analysis

User: What's happening with BTC right now?

AI (calls get_market_context with symbol "BTC/USDT"):

BTC/USDT is trading at $67,450 with a bullish consensus across exchanges:

  • Price: $67,450.25 (VWAP: $67,448.10)
  • Spread: 1.93 bps on Binance, 3.2 bps max arb between Kraken and Binance
  • Order Flow: Positive OBI (0.12) indicating buy-side pressure
  • Volume Leaders: Binance ($12.5K BTC), Bybit ($8.2K), OKX ($6.8K)
  • Notable: Significant bid wall at $67,000 (45.2 BTC, 8.5x median size)

No critical signals active. One alert-level whale buy of $2.5M on Binance detected.

Checking Signals

User: Are there any critical signals I should know about?

AI (calls get_signals with severity "critical"):

Currently 2 critical signals active:

  1. Liquidation Cascade on ETH/USDT -- $8.2M in long liquidations across Binance and Bybit in the last 5 minutes
  2. Cross-Exchange Divergence on SOL/USDT -- 65 bps spread between Coinbase and Bybit

Prediction Markets

User: What do prediction markets say about BTC in the next hour?

AI (calls get_polymarket with coin "BTC", timeframe "1h"):

The Polymarket hourly Up/Down market for BTC shows:

  • Up probability: 54.5% (price: $0.545)
  • Down probability: 45.5% (price: $0.455)
  • Time remaining: 55 minutes
  • Volume: $25,000 traded on this interval

The market is slightly bullish, consistent with the positive OBI readings from exchange orderbooks.

User: Has anything like the current ETH liquidation cascade happened before?

AI (calls search_historical with query "ETH liquidation cascade critical"):

Found 3 similar events in the past 30 days:

  1. Feb 12 (score: 0.92) -- $12M ETH long cascade, price dropped 4.2% in 10 minutes
  2. Feb 3 (score: 0.87) -- $6.5M ETH long cascade during US CPI release
  3. Jan 28 (score: 0.81) -- $9M cascade triggered by FOMC hawkish surprise

Pattern: Previous cascades of this magnitude led to 3-5% drawdowns followed by recovery within 2-4 hours.