Skip to main content
Glama

OKX-DEX-SDK MCP SSE Server

by 0xobedient

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.

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

An SSE (Server-Sent Events) server that leverages OKX DEX SDK to support DEX trading operations on Solana blockchain and cross-chain bridge transactions.

  1. šŸš€ Features
    1. DEX API
    2. Bridge API
  2. šŸ“¦ Installation
    1. šŸ“ Project Structure
      1. šŸ” Environment Variables
        1. šŸ“¦ Dependency

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            A server that enables interaction with the Solana blockchain, providing access to over 40 Solana RPC methods including getting balances, transaction details, block information, and sending transactions.
            Last updated -
            44
            3
            MIT License
            • Apple
          • A
            security
            F
            license
            A
            quality
            A server that provides simple RPC endpoints for common Solana blockchain operations, allowing users to check balances, get account information, and transfer SOL between accounts.
            Last updated -
            5
            1
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server enabling AI agents to interact with the Solana blockchain for DeFi operations like checking balances, transferring tokens, executing swaps, and fetching price data.
            Last updated -
            36
            22
            MIT License
          • -
            security
            F
            license
            -
            quality
            A server that enables interaction with the Solana blockchain using your own private key, supporting operations like getting wallet information, checking balances, and transferring SOL.
            Last updated -
            36
            10

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/0xobedient/okx-mcp'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server