Guides

MCP Server#

MCP (Model Context Protocol) connects AI tools with developer resources. After adding the OKX DEX MCP Server, the Agent can query live token prices, retrieve candlestick charts, search for tokens, inspect holder distributions, and check wallet balances all through standardized, directly callable tool interfaces, within a single conversation or editor session, without any additional integration code. For Claude Desktop, Cursor, and other MCP-compatible clients, add the following configuration:

One MCP server covers both Market and Trade capabilities. Restart your client after updating the config.

What the MCP Server exposes#

  • Price Tools: dex-okx-index-current-price, dex-okx-index-historical-price, dex-okx-market-price, dex-okx-market-price-chains — real-time and historical index/DEX prices across 20+ chains.
  • Candlestick Tools: dex-okx-market-candlesticks, dex-okx-market-candlesticks-history — OHLCV data from 1-minute to daily intervals, with support for extended lookback windows.
  • Token Intelligence Tools: dex-okx-market-token-search, dex-okx-market-token-price-info, dex-okx-market-token-ranking, dex-okx-market-token-holder — token discovery, metadata, real-time metrics, and holder concentration analysis.
  • Trade Data Tool: dex-okx-market-trades — latest on-chain trade records for any token.
  • Balance Tools: dex-okx-balance-chains, dex-okx-balance-total-token-balances, dex-okx-balance-specific-token-balance, dex-okx-balance-total-value — multi-chain wallet balances and USD portfolio valuation.

Quickstart#

for General Claude code#

Shell
claude mcp add onchainos-mcp https://web3.okx.com/api/v1/onchainos-mcp -t http -H"OK-ACCESS-KEY: d573a84c-8e79-4a35-b0c6-427e9ad2478d"

for Claude Desktop Installation#

  1. Go to the Settings page and locate the Connector menu.
  2. Scroll to the bottom, find Add custom connector, and enter the URL: https://web3.okx.com/api/v1/onchainos-mcp

You can also try a local installation. For detailed instructions, please consult your Claude client.

for Claude code MCP settings#

Shell
claude mcp add-json onchainos-mcp '{
"type": "http",
"url": "https://web3.okx.com/api/v1/onchainos-mcp",
"headers": {
"OK-ACCESS-KEY": "d573a84c-8e79-4a35-b0c6-427e9ad2478d"
}
}'

Example interactions#

Once the MCP Server is active, an Agent can respond to natural-language queries like:

Shell
What is the current price of OKB?

# Call index-current-price
Shell
Show me OKB’s 4-hour candlesticks for the past week.

# Call market-candlesticks
Shell
What is the hottest token on the X-layer chain right now?

# Call market-token-ranking
Shell
Which address holds the most USDT on X-layer?

# Call market-token-holder
Shell
What is the total asset value of wallet 0xd8dA...?

# Call balance-total-value