MCP Hub
Back to servers

coinglass-mcp

Provides access to CoinGlass cryptocurrency derivatives data, including funding rates, open interest, and liquidation metrics. It enables LLMs to analyze real-time and historical market structure context through a standardized toolset.

glama
Updated
Mar 26, 2026

coinglass-mcp

coinglass-mcp is an MCP server for CoinGlass derivatives data. It exposes funding rates, open interest, long/short ratios, liquidation metrics, and the BTC Bubble Index for LLM workflows that need market structure context.

What It Covers

  • Current funding rates across major exchanges
  • Funding rate history for one exchange and symbol
  • Open interest snapshots and aggregated OI history
  • Global long/short account ratio history
  • Liquidation summaries and liquidation chart history
  • Bitcoin Bubble Index

Why This Server Exists

CoinGlass is useful for derivatives structure, but its API is not ergonomic for agent tool use. This project wraps the API in MCP tools with:

  • cleaner tool descriptions
  • interval validation
  • normalized symbols
  • HTTP and stdio transport support
  • safer defaults for local deployment

Requirements

  • Python 3.11+
  • A CoinGlass API key

Get a key from: https://www.coinglass.com/pricing

Quick Start

  1. Create your local env file:
cp secrets/coinglass.env.example secrets/coinglass.env
  1. Fill in COINGLASS_API_KEY in secrets/coinglass.env.

  2. Run locally:

pip install -e .
python -m coinglass_mcp

Docker

docker build -t coinglass-mcp .
docker run --rm -p 38090:38090 --env-file secrets/coinglass.env coinglass-mcp

Claude / Codex MCP Registration

claude mcp add coinglass --transport http http://127.0.0.1:38090/mcp

Tools

ToolPurpose
get_funding_ratesCurrent perpetual funding rates across exchanges
get_funding_rate_historyHistorical funding rates for a symbol on one exchange
get_open_interestCurrent open interest by exchange
get_open_interest_historyAggregated open interest history
get_long_short_ratioGlobal long/short account ratio history
get_liquidation_info1h / 4h / 12h / 24h liquidation summary
get_liquidation_historyHistorical liquidation chart
get_btc_bubble_indexBTC Bubble Index for cycle analysis

Interpreting the Data

SignalTypical Interpretation
Funding rate > 0.1%Longs crowded, higher squeeze risk
Funding rate < -0.05%Shorts crowded, rebound or squeeze setup
OI rising + price risingTrend confirmation
OI rising + price fallingShort pressure building
OI fallingPosition unwinding
Long/short ratio > 1.5Retail long crowding
Large long liquidationsForced selling, can mark local panic
Large short liquidationsShort squeeze / forced upside

Configuration

VariableDefaultDescription
COINGLASS_API_KEYrequiredCoinGlass API key
COINGLASS_BASE_URLhttps://open-api.coinglass.comAPI base URL
MCP_TRANSPORThttphttp, streamable-http, sse, or stdio
MCP_HOST0.0.0.0Bind host
PORT38090HTTP listen port
MCP_PATH/mcpMCP endpoint path
MCP_ALLOWED_HOSTSemptyExtra allowed hosts, comma-separated
MCP_ALLOWED_ORIGINSemptyExtra allowed origins, comma-separated

Development

Install test dependencies and run tests:

pip install -e ".[test]"
pytest

Security Notes

  • Do not commit secrets/coinglass.env
  • Prefer using a restricted API key when possible
  • Expose the HTTP transport behind your own auth layer if you open it beyond localhost

Reviews

No reviews yet

Sign in to write a review