OKX MCP Server

OKX MCP Server

okx•bymbarinov

A Model Context Protocol server that gives AI assistants read-only access to OKX portfolio, positions, and order data.

License: MIT•Runtime: Awaiting documentation review•Category: finance crypto

WHAT IT DOES

  • •Exposes account summary, portfolio, positions, open orders, and order history tools to AI assistants.
  • •Operates with read-only API permissions and cannot place trades or withdraw funds.
  • •Processes account data locally without persisting it to disk.

BEST FOR

  • •Reviewing portfolio balance and asset allocation through natural language questions.
  • •Analyzing open positions and pending orders.
  • •Reviewing historical trade performance for specific instruments.

ABOUT OKX

OKX MCP Server is cataloged as an MCP server attributed to mbarinov. A Model Context Protocol server that gives AI assistants read-only access to OKX portfolio, positions, and order data. It is categorized under finance crypto. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for OKX MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Can this server place trades or withdraw funds?

No, it only requires read permissions and cannot place trades or withdraw funds.

Is my trading data stored or sent to third parties?

Data is processed locally on your machine and is not stored or transmitted to third parties.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 6d33ccebbb27 · 采集于 2026-11-13 08:54:20 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

OKX MCP Server

npm version Downloads License Node.js Version TypeScript

A Model Context Protocol (MCP) server that provides access to OKX trading and portfolio management functionality. This package allows AI assistants to interact with your OKX account to retrieve portfolio information, trading positions, order history, and more.

This MCP server is designed with security as a top priority. Here's what makes it safe to use:

🔒 Built-in Security Features

  • Read-Only Access: The server only requires read permissions - it cannot place trades or withdraw funds
  • Local Processing: All data is processed locally on your machine and never stored or transmitted to third parties
  • No Data Persistence: Your trading data is never saved to disk or cached permanently
  • Direct API Communication: Connects directly to OKX APIs without intermediary servers

What You Can Do

📱 See It In Action

Claude Desktop with OKX MCP Server

Example: Ask Claude "give me account summary" and instantly get your portfolio breakdown, asset allocation, and trading insights—all from your OKX account data.

Transform your trading experience with AI-powered portfolio insights. Once configured, you can ask Claude natural language questions about your OKX account:

💰 Portfolio Management

  • "What's my current portfolio balance?"
  • "Show me my asset allocation"
  • "Which coins do I own and how much are they worth?"
  • "What's my biggest position by value?"

📊 Trading Analysis

  • "Show me my open positions with P&L"
  • "What orders do I have pending?"
  • "Analyze my BTC trading history from last month"
  • "How did my ETH trades perform this week?"

🎯 Smart Insights

  • "What's my total unrealized profit/loss?"
  • "Which assets have gained the most value?"
  • "Give me a summary of my trading activity"
  • "How is my portfolio performing today?"

🔍 Detailed Reporting

  • "Create a detailed report of my portfolio"
  • "Show me all my completed trades for BTC-USDT"
  • "What's my trading volume for this month?"
  • "Break down my portfolio by percentage"

The AI can provide instant analysis, generate insights, and help you make informed trading decisions—all through simple conversation.

Quick Start

Step 1: Create OKX API Credentials

  1. Access Your OKX Account:

    • Existing users: Go to OKX.com and log in
    • New users: Sign up at OKX.com and complete account verification
  2. Open API Management:

  3. Create Your API Key:

    • Click "Create API Key"
    • Enter a descriptive name (e.g., "MCP Server")
    • Create and save a secure passphrase (you'll need this later)
  4. Set Read-Only Permissions:

    • Read: ✅ Enable (required for portfolio access)
    • Trade: ❌ Disable (not needed for this MCP server)
    • Withdraw: ❌ Disable (not needed for this MCP server)
  5. Generate and Copy Credentials:

    • Click "Submit All" to create the API key
    • Click "Show info" to reveal your credentials
    • Click "Copy API key info" to copy all details

    Your credentials will look like this:

    apikey = "12345678-abcd-1234-efgh-123456789abc"
    secretkey = "ABCD1234EFGH5678IJKL9012MNOP3456"
    IP = ""
    API key name = "MCP Server"
    Permissions = "Read"
    
  6. Secure Your Credentials:

    • Save the API Key, Secret Key, and Passphrase in a secure location
    • ⚠️ Critical: The Secret Key is only shown once - save it immediately!
    • These credentials will be used to configure Claude Desktop in the next step

Step 2: Install Prerequisites

Before configuring Claude Desktop, you need to install Node.js.

Install Node.js

Option 1: Download from Official Website

  1. Visit https://nodejs.org
  2. Download the LTS (Long Term Support) version for your operating system
  3. Run the installer and follow the setup wizard

Step 3: Configure Claude Desktop

  1. Open Claude Desktop Settings:

    • Launch Claude Desktop application
    • Click on Settings (gear icon in the bottom-left corner)
  2. Access Developer Section:

    • Scroll down to the bottom of the settings panel
    • Click on "Developer" section
  3. Edit Configuration:

    • Click on "Edit Config" button
    • This will open the claude_desktop_config.json file in your default text editor
  4. Add OKX MCP Server Configuration:

    • Replace the entire file content with this configuration:
    {
      "mcpServers": {
        "okx-mcp": {
          "command": "okx-mcp",
          "env": {
            "OKX_API_KEY": "your_api_key_here",
            "OKX_API_SECRET": "your_secret_key_here",
            "OKX_API_PASSPHRASE": "your_passphrase_here"
          }
        }
      }
    }
    
  5. Update Your Credentials:

    • Replace your_api_key_here with your actual API Key from Step 1
    • Replace your_secret_key_here with your actual Secret Key from Step 1
    • Replace your_passphrase_here with your actual Passphrase from Step 1
    • Save the file and close the text editor
  6. Restart Claude Desktop:

    • Close Claude Desktop completely
    • Reopen the application to load the new configuration
  7. Test the Connection:

    • Start a new conversation in Claude Desktop
    • Try asking: "Show my portfolio" or "Get my account summary"
    • If successful, Claude will retrieve and display your OKX account data

Available Tools

This MCP server provides the following tools for AI assistants:

1. Get Account Summary

  • Tool: get_account_summary
  • Description: Get aggregated portfolio metrics including total value and asset allocation
  • Parameters: None

2. Get Portfolio

  • Tool: get_portfolio
  • Description: Get detailed information about all assets in your account
  • Parameters: None
  • Returns: List of currencies with balances, available amounts, and USDT values

3. Get Positions

  • Tool: get_positions
  • Description: Get all open derivative trading positions
  • Parameters: None
  • Returns: Position details including size, entry price, and unrealized P&L

4. Get Open Orders

  • Tool: get_open_orders
  • Description: Get all currently open trading orders
  • Parameters: None
  • Returns: Order details including symbol, type, price, and status

5. Get Order History

  • Tool: get_order_history
  • Description: Get historical filled orders for analysis
  • Parameters:
    • instId (required): Instrument ID (e.g., "BTC-USDT")
    • begin (optional): Start timestamp
    • end (optional): End timestamp
  • Returns: Historical order data with execution details

Development

Local Development

# Clone the repository
git clone https://github.com/maxbarinov/okx-mcp.git
cd okx-mcp

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Edit .env with your OKX API credentials

# Run in development mode
npm run dev

Building

npm run build

Project Structure

src/
├── services/
│   └── okxApiClient.ts    # OKX API client wrapper
└── tools/                # MCP tool implementations
    ├── get_account_summary.ts
    ├── get_portfolio.ts
    ├── get_positions.ts
    ├── get_open_orders.ts
    └── get_order_history.ts

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT

Support

If you encounter any issues or have questions:

  1. Check the GitHub Issues
  2. Create a new issue with detailed information about your problem
  3. Include your environment details and error messages (without sensitive data)

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for OKX MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/okx)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related finance crypto MCP Servers

Alternative and complementary servers in the same category

View all in finance crypto →
USA Spending MCP Server
usaspending-mcp-server•thsmale

A stateless streamable HTTP MCP server for interacting with the official source of government spending data.

Repository stats unavailable
Finance & Analytics
Fortnox MCP server — More AI
more-ai-chatgpt-claude-mcp-fortnox•amor3

A hosted, remote MCP server for Fortnox that lets AI assistants answer questions from a company's bookkeeping and propose changes for approval before writing them.

0
Finance & Analytics

OptimistFi is a read-only remote MCP server that provides perpetual futures market data, perps prop firm rules and pricing, and US equity investment research.

Repository stats unavailable
Finance & Analytics