Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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 APIbroadcast_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 txhashTransaction 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.
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
Checklist
Additional context
N/A