okx
This repository provides an example implementation of an SSE (Server-Sent Events)-based MCP server built entirely on top of the @okx-dex/okx-dex-sdk library. It enables seamless DEX trading on Solana and cross-chain bridge operations.
claude mcp add --transport stdio 0xobedient-okx-mcp node src/main.ts \ --env PORT="3000" \ --env OKX_API_KEY="Your OKX API key" \ --env OKX_API_SECRET="Your OKX API secret" \ --env OKX_PASSPHRASE="Your OKX API passphrase" \ --env OKX_PROJECT_ID="Your OKX project ID (if required)" \ --env RPC_ENDPOINT_URI="RPC endpoint URI for Solana or target blockchain" \ --env WALLET_PRIVATE_KEY="Private key for the wallet used in trades"
How to use
This MCP server is an SSE (Server-Sent Events) implementation that exposes the OKX DEX and cross-chain bridge capabilities via a single server. Built on the @okx-dex/okx-dex-sdk, it enables clients to subscribe to real-time market data, execute swap trades, generate swap instructions, fetch price quotes, and access bridge-related endpoints for cross-chain transfers. The DEX API focuses on Solana-based trading workflows, including fetching token lists and liquidity pool data, while the Bridge API exposes supported bridgeable tokens, supported chains, and price quotes, along with the ability to initiate cross-chain transfers. To use, start the server and connect clients to the SSE endpoints to receive live updates and to submit trading or bridging requests through the provided REST-like routes exposed by the server.
How to install
Prerequisites:
- Node.js (12.x or newer) installed on your system
- pnpm installed globally (npm i -g pnpm) or use an equivalent package manager
Installation steps:
-
Clone the repository git clone https://github.com/0xobedient/okx-mcp cd okx-mcp
-
Install dependencies pnpm install
-
Configure environment Copy .env.example to .env and fill in the required values: OKX_API_KEY, OKX_API_SECRET, OKX_PASSPHRASE, OKX_PROJECT_ID (optional), RPC_ENDPOINT_URI, WALLET_PRIVATE_KEY, PORT
-
Run the MCP server pnpm run dev
-
Verify the server is running Access the configured port (default 3000) and test SSE endpoints or REST-like API routes exposed by the server.
Additional notes
Notes and tips:
- Ensure your RPC_ENDPOINT_URI points to a valid Solana (or target blockchain) RPC endpoint for accurate DEX operations.
- The environment variables OKX_API_KEY/SECRET/PASSPHRASE must be kept secure and not committed to version control.
- The server is designed as an SSE provider; clients should establish EventSource connections to the appropriate endpoints to receive live updates.
- If you modify the code, run a fresh build or restart the server to pick up changes.
- The OKX SDK is the core dependency; verify compatibility with your Node.js version and keep the sdk up to date to access new DEX/Bridge features.
Related MCP Servers
context7
Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
MiniMax -JS
Official MiniMax Model Context Protocol (MCP) JavaScript implementation that provides seamless integration with MiniMax's powerful AI capabilities including image generation, video generation, text-to-speech, and voice cloning APIs.
marinade-finance
Marinade Finance MCP Server is an MCP server specifically designed for the Marinade Finance.
solana-dev
Solana Model Context Protocol (MCP) Demo
mcp-bundler
Is the MCP configuration too complicated? You can easily share your own simplified setup!
akyn-sdk
Turn any data source into an MCP server in 5 minutes. Build AI-agents-ready knowledge bases.