OKX▌

by mbarinov
Track your crypto portfolio with OKX. Access portfolio performance, trading positions & order history using this leading
Integrates with OKX cryptocurrency exchange to provide read-only access to account portfolios, trading positions, order history, and account summaries for portfolio management and trading analytics.
best for
- / Crypto traders tracking portfolio performance
- / Portfolio managers analyzing positions
- / Users wanting AI insights on their trading data
capabilities
- / View portfolio balances and asset allocation
- / Check open trading positions
- / Access order history and trade records
- / Generate account summaries
- / Analyze trading performance
what it does
Provides read-only access to your OKX cryptocurrency exchange account data including portfolios, positions, and order history for AI-powered trading analytics.
about
OKX is a community-built MCP server published by mbarinov that provides AI assistants with tools and capabilities via the Model Context Protocol. Track your crypto portfolio with OKX. Access portfolio performance, trading positions & order history using this leading It is categorized under finance, analytics data.
how to install
You can install OKX in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
license
MIT
OKX is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
readme
OKX MCP Server
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

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
-
Access Your OKX Account:
-
Open API Management:
- Navigate directly to: https://www.okx.com/account/my-api
-
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)
-
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)
-
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" -
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
- Visit https://nodejs.org
- Download the LTS (Long Term Support) version for your operating system
- Run the installer and follow the setup wizard
Step 3: Configure Claude Desktop
-
Open Claude Desktop Settings:
- Launch Claude Desktop application
- Click on Settings (gear icon in the bottom-left corner)
-
Access Developer Section:
- Scroll down to the bottom of the settings panel
- Click on "Developer" section
-
Edit Configuration:
- Click on "Edit Config" button
- This will open the
claude_desktop_config.jsonfile in your default text editor
-
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" } } } } -
Update Your Credentials:
- Replace
your_api_key_herewith your actual API Key from Step 1 - Replace
your_secret_key_herewith your actual Secret Key from Step 1 - Replace
your_passphrase_herewith your actual Passphrase from Step 1 - Save the file and close the text editor
- Replace
-
Restart Claude Desktop:
- Close Claude Desktop completely
- Reopen the application to load the new configuration
-
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 timestampend(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
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
MIT
Support
If you encounter any issues or have questions:
- Check the GitHub Issues
- Create a new issue with detailed information about your problem
- Include your environment details and error messages (without sensitive data)
Related Projects
FAQ
- What is the OKX MCP server?
- OKX is a Model Context Protocol (MCP) server profile on explainx.ai. MCP lets AI hosts (e.g. Claude Desktop, Cursor) call tools and resources through a standard interface; this page summarizes categories, install hints, and community ratings.
- How do MCP servers relate to agent skills?
- Skills are reusable instruction packages (often SKILL.md); MCP servers expose live capabilities. Teams frequently combine both—skills for workflows, MCP for APIs and data. See explainx.ai/skills and explainx.ai/mcp-servers for parallel directories.
- How are reviews shown for OKX?
- This profile displays 10 aggregated ratings (sample rows for discoverability plus signed-in user reviews). Average score is about 4.5 out of 5—verify behavior in your own environment before production use.
Ratings
4.5★★★★★10 reviews- ★★★★★Shikha Mishra· Oct 10, 2024
OKX is among the better-indexed MCP projects we tried; the explainx.ai summary tracks the official description.
- ★★★★★Piyush G· Sep 9, 2024
We evaluated OKX against two servers with overlapping tools; this profile had the clearer scope statement.
- ★★★★★Chaitanya Patil· Aug 8, 2024
Useful MCP listing: OKX is the kind of server we cite when onboarding engineers to host + tool permissions.
- ★★★★★Sakshi Patil· Jul 7, 2024
OKX reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
- ★★★★★Ganesh Mohane· Jun 6, 2024
I recommend OKX for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
- ★★★★★Oshnikdeep· May 5, 2024
Strong directory entry: OKX surfaces stars and publisher context so we could sanity-check maintenance before adopting.
- ★★★★★Dhruvi Jain· Apr 4, 2024
OKX has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
- ★★★★★Rahul Santra· Mar 3, 2024
According to our notes, OKX benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.
- ★★★★★Pratham Ware· Feb 2, 2024
We wired OKX into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
- ★★★★★Yash Thakker· Jan 1, 2024
OKX is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.