- Explore MCP Servers
- okx-mcp
Okx Mcp
What is Okx Mcp
okx-mcp is an example implementation of a Server-Sent Events (SSE)-based MCP server that utilizes the @okx-dex/okx-dex-sdk library. It facilitates decentralized exchange (DEX) trading on the Solana blockchain and supports cross-chain bridge operations.
Use cases
Use cases for okx-mcp include enabling users to perform token swaps on the Solana blockchain, facilitating cross-chain transactions between different blockchain networks, and providing real-time price quotes for various tokens.
How to use
To use okx-mcp, clone the repository from GitHub, navigate to the project directory, and run the installation commands using pnpm: git clone https://github.com/0xobedient/okx-mcp, cd okx-mcp, pnpm install, and pnpm run dev.
Key features
Key features of okx-mcp include a DEX API for executing swap trades, generating swap instructions, fetching price quotes, and retrieving supported tokens and liquidity pool data. Additionally, it has a Bridge API that allows for cross-chain transactions and fetching bridgeable tokens and chains.
Where to use
okx-mcp can be used in the blockchain and cryptocurrency sectors, particularly for applications involving decentralized finance (DeFi), trading platforms, and cross-chain interoperability solutions.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Okx Mcp
okx-mcp is an example implementation of a Server-Sent Events (SSE)-based MCP server that utilizes the @okx-dex/okx-dex-sdk library. It facilitates decentralized exchange (DEX) trading on the Solana blockchain and supports cross-chain bridge operations.
Use cases
Use cases for okx-mcp include enabling users to perform token swaps on the Solana blockchain, facilitating cross-chain transactions between different blockchain networks, and providing real-time price quotes for various tokens.
How to use
To use okx-mcp, clone the repository from GitHub, navigate to the project directory, and run the installation commands using pnpm: git clone https://github.com/0xobedient/okx-mcp, cd okx-mcp, pnpm install, and pnpm run dev.
Key features
Key features of okx-mcp include a DEX API for executing swap trades, generating swap instructions, fetching price quotes, and retrieving supported tokens and liquidity pool data. Additionally, it has a Bridge API that allows for cross-chain transactions and fetching bridgeable tokens and chains.
Where to use
okx-mcp can be used in the blockchain and cryptocurrency sectors, particularly for applications involving decentralized finance (DeFi), trading platforms, and cross-chain interoperability solutions.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
OKX-DEX-SDK MCP SSE SERVER EXAMPLE
This is an example implementation of an SSE (Server-Sent Events) MCP server that leverages @okx-dex/okx-dex-sdk to support DEX trading and cross-chain bridge operations.
🚀 Features
DEX API
Built for the Solana blockchain, the DEX API supports:
- Executing swap trades
- Generating swap instructions
- Fetching price quotes
- Retrieving supported tokens and liquidity pool (LP) data
Bridge API
Enables cross-chain functionality, including:
- Fetching supported bridgeable tokens and chains
- Performing cross-chain bridge transactions
- Retrieving cross-chain price quotes
📦 Installation
git clone https://github.com/0xobedient/okx-mcp
cd okx-mcp
pnpm install
pnpm run dev
📁 Project Structure
. ├── build/ # Compiled output ├── node_modules/ # Node.js dependencies ├── src/ │ ├── bridge/ │ │ ├── hooks/ # Bridge-specific hooks │ │ ├── tools/ # Utility functions for bridge │ │ └── server.ts # SSE server for bridge API │ ├── dex/ │ │ ├── hooks/ # DEX-specific hooks │ │ ├── tools/ # Utility functions for DEX │ │ └── server.ts # SSE server for DEX API │ └── shared/ │ ├── common/ │ │ ├── okxClient.ts # OKX SDK client wrapper │ │ └── wallet.ts # Wallet handling logic │ ├── constants/ │ │ └── index.ts # Constant values used across the app │ ├── env/ │ │ └── index.ts # Environment variable loader │ ├── types/ │ │ ├── tool.d.ts # Type definitions for tools │ │ └── wallet.d.ts # Type definitions for wallet │ └── main.ts # Application entry point ├── .env.example # Sample environment file ├── .gitignore # Git ignore rules ├── package.json # NPM package metadata ├── pnpm-lock.yaml # Lockfile for pnpm └── tsconfig.json # TypeScript configuration
🔐 Environment Variables
Create a .env file at the root of the project using .env.example as a template:
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 (if required) RPC_ENDPOINT_URI= # RPC endpoint URI for Solana or target blockchain WALLET_PRIVATE_KEY= # Private key for the wallet used in trades PORT=3000 # Port number for the SSE server
📦 Dependency
This MCP server is entirely built upon the official OKX SDK:
@okx-dex/okx-dex-sdk – the core SDK providing access to OKX DEX trading and bridge functionalities.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










