Skip to content

Conversation

@0xobedient
Copy link

@0xobedient 0xobedient commented Jul 16, 2025

Description

OKX MCP Playground, built by the Homo Memetus team—winners of the OKX <> Solana Hackathon—offers a comprehensive suite of tools for accessing market data, balances, trades, and transactions via the OKX Market and Trade APIs. It enables users to fully leverage the capabilities of the OKX API.

Server Details

  • Server: OKX MCP Server

Motivation and Context

OKX is one of the world's largest cryptocurrency exchanges, providing accurate and high-quality data across various aspects of the crypto space, including blockchain data queries, cryptocurrency price data, and blockchain instruction generation.

As such, we have implemented an MCP server integrated with the OKX API, and we plan to share this through the repository to provide executable example code and best practices for the OKX MCP Server to a broader audience.

Features

Balance Operations

  • get_supported_chain: Retrieve information on chains supported by the DEX Balance endpoint.
  • get_specific_token_balance: Retrieve the list of token balances for an address across multiple chains or specified chains.
  • get_total_token_balances: Retrieve the list of token balances for an address across multiple chains or specified chains.
  • get_total_value: Retrieve the total balance of all tokens and DeFi assets under an account.

Gateway Operations

  • get_supported_chain: Retrieve information on chains supported by Onchain gateway API
  • broadcast_transactions: Broadcast transactions to the specified blockchain.
  • get_gas_limit: Retrieve estimated Gas Limit consumption through pre-execution of transaction information.
  • get_gas_price: Dynamically obtain estimated gas prices for various chains.
  • get_transaction_orders: Get the list of orders sent from transaction broadcasting API. This supports querying transactions sorted in descending order by time.
  • simulate_transactions: Simulate a blockchain transaction before executing it to see the expected outcomes and potential risks.

Index Price Operation

  • get_supported_chain: Get the list of supported chains for the index.
  • get_historical_index_price: Query historical prices for a specific token.
  • get_token_index_price: The index price refers to a currency price calculated from the prices of multiple third-party data sources.

Market Price Operation

  • get_supported_chain: Get the list of supported chains for the market.
  • get_trades: Retrieve the recent transactions of a token.
  • get_batch_token_price: Retrieve the latest price for multiple tokens.
  • get_candlesticks_history: Retrieve historical candlestick charts.
  • get_candlesticks: Retrieve the candlestick charts.
  • get_price: Retrieve the latest price of a token.

Trade Operation

  • get_supported_chains: Retrieve information on chains supported for single-chain exchanges. The request returns supported target chains for cross-chain transactions.
  • approve_transactions: According to the ERC-20 standard, we need to make sure that the OKX router has permission to spend funds with the user's wallet before making a transaction. This API will generate the relevant data for calling the contract.
  • execute_swap: Generate the data to call the OKX DEX router to execute a swap.
  • get_liquidity_sources: Get a list of liquidity that are available for swap in the OKX aggregation protocol.
  • get_quotes: Get the best quote for a swap through OKX DEX.
  • get_swap_instructions: Obtain transaction instruction data for redemption or custom assembly in Solana.
  • get_tokens: It fetches a list of tokens. This interface returns a list of tokens that belong to major platforms or are deemed significant enough by OKX. However, you can still quote and swap other tokens outside of this list on OKX DEX.
  • get_transaction_status: Get the final transaction status of a single-chain swap using txhash

Transaction Operation

  • get_supported_chain:Retrieve information on chains supported by Transaction history API.
  • get_history_by_address: Query the transaction history under the address dimension, sorted in descending chronological order.
  • get_specific_transaction: Retrieve details of a transaction based on txHash.

How Has This Been Tested?

"Retrieve current gas price in solana blockchain which chainIndex is 501"

Breaking Changes

User should import environment variable when run this server in locally.

OKX_API_KEY=""
OKX_API_SECRET=""
OKX_PASSPHRASE=""
OKX_PROJECT_ID=""

Server configuration for running in Claude Desktop

{
  "mcpServers": {
    "okx-mcp-playground": {
      "command": "node",
      "args": ["your project path/dist/index.js"],
      "env": {
        "OKX_API_KEY": "your-okx-api-key",
        "OKX_API_SECRET": "your-okx-api-secret",
        "OKX_PASSPHRASE": "your-okx-api-passphrase",
        "OKX_PROJECT_ID": "your-okx-project-id"
      }
    }
  }
}

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Protocol Documentation
  • My changes follows MCP security best practices
  • I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

Additional context

N/A

@olaservo
Copy link
Member

Thanks for your contribution to the servers list. This has been merged in this combined PR: #2370

This is a new process we're trying out, so if you see any issues feel free to re-open the PR and tag me.

@olaservo olaservo closed this Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants