🔗 MCP API

Getting Started

Connect your MCP client to the CoinAPI Market Data MCP server and run your first metadata, quote, trade, and OHLCV queries.

Getting Started with Market Data MCP

This guide shows how to connect an MCP client to the hosted CoinAPI Market Data MCP server and verify the connection with live requests.

Endpoint and authentication

  • MCP endpoint: https://mcp.md.coinapi.io/mcp
  • Header: X-CoinAPI-Key: YOUR_API_KEY
  • Transport: HTTP streaming MCP
  • Supported path: only /mcp

Cursor example

Add the Market Data server to your MCP client configuration:

{
  "mcpServers": {
    "CoinAPI-Market-Data": {
      "url": "https://mcp.md.coinapi.io/mcp",
      "headers": {
        "X-CoinAPI-Key": "YOUR_API_KEY_HERE"
      }
    }
  }
}

Replace YOUR_API_KEY_HERE with your actual API key and restart the client if required.

First requests to try

1. Confirm asset identifiers

Call assets_list with:

{
  "filter_asset_id": "BTC;USD;ETH"
}

Example response excerpt:

[
  {
    "asset_id": "USD",
    "name": "US Dollar",
    "type_is_crypto": 0
  },
  {
    "asset_id": "BTC",
    "name": "Bitcoin",
    "type_is_crypto": 1,
    "price_usd": 67898.8476082248
  },
  {
    "asset_id": "ETH",
    "name": "Ethereum",
    "type_is_crypto": 1,
    "price_usd": 2065.31984899449
  }
]

2. Discover a valid trading symbol

Call symbols_list with:

{
  "filter_exchange_id": "BITSTAMP",
  "filter_asset_id": "BTC"
}

Example response excerpt:

[
  {
    "symbol_id": "BITSTAMP_SPOT_BTC_USD",
    "exchange_id": "BITSTAMP",
    "symbol_type": "SPOT",
    "asset_id_base": "BTC",
    "asset_id_quote": "USD",
    "price": 67880.5
  },
  {
    "symbol_id": "BITSTAMP_SPOT_BTC_EUR",
    "exchange_id": "BITSTAMP",
    "symbol_type": "SPOT",
    "asset_id_base": "BTC",
    "asset_id_quote": "EUR",
    "price": 58732
  }
]

3. Fetch a current quote snapshot

Call quotes_get_current_by_symbol with:

{
  "symbol_id": "BITSTAMP_SPOT_BTC_USD"
}

Example response:

{
  "symbol_id": "BITSTAMP_SPOT_BTC_USD",
  "time_exchange": "2026-04-07T14:08:02.248Z",
  "ask_price": 67895,
  "ask_size": 0.55619746,
  "bid_price": 67894,
  "bid_size": 0.03517375,
  "last_trade": {
    "price": 67881,
    "size": 0.00316877,
    "taker_side": "BUY"
  }
}

4. Fetch recent candles

Call ohlcv_get_history with:

{
  "symbol_id": "BITSTAMP_SPOT_BTC_USD",
  "period_id": "1HRS",
  "time_start": "2026-04-07T00:00:00Z",
  "limit": 3
}

Example response excerpt:

[
  {
    "time_period_start": "2026-04-07T00:00:00Z",
    "price_open": 68856.5,
    "price_high": 69403.5,
    "price_low": 67026.5,
    "price_close": 68771,
    "volume_traded": 31.86559015,
    "trades_count": 835
  }
]

5. Fetch recent trades

Call trades_get_latest_by_symbol with:

{
  "symbol_id": "BITSTAMP_SPOT_BTC_USD",
  "limit": 2
}

Example response excerpt:

[
  {
    "symbol_id": "BITSTAMP_SPOT_BTC_USD",
    "price": 67881,
    "size": 0.00316877,
    "taker_side": "BUY"
  }
]

6. Fetch an asset-level exchange rate

Call exchangerate_get_rate with:

{
  "asset_id_base": "BTC",
  "asset_id_quote": "USD"
}

Example response:

{
  "time": "2026-04-07T14:08:02",
  "asset_id_base": "BTC",
  "asset_id_quote": "USD",
  "rate": 67892.8660433744
}

Realtime symbol workflow

  1. Call symbols_list or symbols_get_by_exchange.
  2. Choose a symbol_id.
  3. Use quotes_get_current_by_symbol, trades_get_latest_by_symbol, and orderbooks_get_current together.

Historical analytics workflow

  1. Call ohlcv_list_periods.
  2. Request candles with ohlcv_get_history.
  3. Add quotes_get_history or trades_get_history when you need event-level detail.

Metadata-first workflow

  1. Validate inputs with assets_list, exchanges_list, or chains_list.
  2. Resolve exact symbols through symbols_list.
  3. Cache metadata locally because it changes much less often than market data.

Troubleshooting

No tools appear in the client

  • Verify the endpoint is exactly https://mcp.md.coinapi.io/mcp.
  • Confirm the request includes the X-CoinAPI-Key header.
  • Restart the MCP client after editing its configuration.

A symbol-based request fails

  • Use symbols_list to confirm the exact symbol_id.
  • Prefer uppercase IDs such as BITSTAMP_SPOT_BTC_USD.
  • Narrow by exchange first if many similar symbols exist.

Responses are too large

  • Use filters such as filter_asset_id, filter_exchange_id, or filter_symbol_id.
  • Set limit or limit_levels where available.
  • Cache metadata and icon payloads client-side.
Service StatusGitHub SDK