OKX MCP Skill
Use this skill to run OKX MCP operations through uxc.
Reuse the uxc skill for shared protocol discovery, output parsing, and generic auth/binding flows.
Prerequisites
- -
uxc is installed and available in PATH. - Network access to
https://web3.okx.com/api/v1/onchainos-mcp. - OKX Onchain API key is available for real calls.
Quick Trial Key
For quick read-only trial, OKX docs currently expose a shared demo key:
Example:
Use your own key for regular usage, stability, and production workflows.
Core Workflow
- 1. Confirm endpoint and protocol with help-first probing:
-
uxc https://web3.okx.com/api/v1/onchainos-mcp -h
- 2. Configure credential/binding for repeatable auth:
-
uxc auth credential set okx-mcp --auth-type api_key --api-key-header OK-ACCESS-KEY --secret-env OKX_ACCESS_KEY
-
uxc auth credential set okx-mcp --auth-type api_key --api-key-header OK-ACCESS-KEY --secret-op op://Engineering/okx/OK-ACCESS-KEY
-
uxc auth binding add --id okx-mcp --host web3.okx.com --path-prefix /api/v1/onchainos-mcp --scheme https --credential okx-mcp --priority 100
- 3. Use fixed link command by default:
-
command -v okx-mcp-cli
- If missing, create it:
uxc link okx-mcp-cli https://web3.okx.com/api/v1/onchainos-mcp
-
okx-mcp-cli -h
- 4. Inspect operation schema before execution:
-
okx-mcp-cli dex-okx-market-price -h
-
okx-mcp-cli dex-okx-market-token-search -h
-
okx-mcp-cli dex-okx-balance-total-value -h
-
okx-mcp-cli dex-okx-dex-quote -h
- 5. Prefer read operations first, then high-impact operations.
Capability Map
-
dex-okx-market-price
-
dex-okx-market-trades
-
dex-okx-market-candlesticks
-
dex-okx-market-candlesticks-history
-
dex-okx-index-current-price
-
dex-okx-index-historical-price
- - Token discovery/enrichment:
-
dex-okx-market-token-search
-
dex-okx-market-token-ranking
-
dex-okx-market-token-holder
-
dex-okx-market-token-basic-info
-
dex-okx-market-token-price-info
-
dex-okx-balance-chains
-
dex-okx-balance-total-value
-
dex-okx-balance-total-token-balances
-
dex-okx-balance-specific-token-balance
-
dex-okx-dex-aggregator-supported-chains
-
dex-okx-dex-liquidity
-
dex-okx-dex-quote
-
dex-okx-dex-approve-transaction
-
dex-okx-dex-swap
- INLINECODE38
ChainIndex Quick Reference
- - Ethereum: INLINECODE39
- BSC: INLINECODE40
- XLayer: INLINECODE41
- Solana: INLINECODE42
- Base: INLINECODE43
- Arbitrum: INLINECODE44
Always prefer runtime discovery (dex-okx-market-price-chains / dex-okx-dex-aggregator-supported-chains / dex-okx-balance-chains) when possible.
Guardrails
- - Keep automation on JSON output envelope; do not rely on
--text. - Parse stable fields first:
ok, kind, protocol, data, error. - Use
okx-mcp-cli as default command path. - INLINECODE55 is equivalent to
uxc https://web3.okx.com/api/v1/onchainos-mcp <operation> .... - If call result contains
Request header OK-ACCESS-KEY can not be empty:
- confirm auth binding matches endpoint with
uxc auth binding match https://web3.okx.com/api/v1/onchainos-mcp
- update credential with explicit header:
uxc auth credential set okx-mcp --auth-type api_key --api-key-header OK-ACCESS-KEY --secret-env OKX_ACCESS_KEY
- confirm credential has a secret source (
--secret-env,
--secret-op, or literal
--secret)
- - For high-impact operations require explicit user confirmation:
-
dex-okx-dex-approve-transaction
-
dex-okx-dex-swap
-
dex-okx-dex-solana-swap-instruction
- - Solana caveat from OKX docs:
- for market candles/trades, use wSOL token address
So11111111111111111111111111111111111111112
- for some price contexts, SOL system address
11111111111111111111111111111111 may also appear in docs
- when data is empty on Solana, verify operation-level address expectation first.
References
- INLINECODE68
OKX MCP 技能
使用此技能通过 uxc 运行 OKX MCP 操作。
复用 uxc 技能进行共享协议发现、输出解析以及通用认证/绑定流程。
前提条件
- - uxc 已安装并可在 PATH 中使用。
- 可访问 https://web3.okx.com/api/v1/onchainos-mcp。
- 拥有 OKX Onchain API 密钥以进行真实调用。
快速试用密钥
如需快速只读试用,OKX 文档目前公开了一个共享演示密钥:
- - d573a84c-8e79-4a35-b0c6-427e9ad2478d
示例:
- - uxc auth credential set okx-mcp --auth-type api_key --api-key-header OK-ACCESS-KEY --secret d573a84c-8e79-4a35-b0c6-427e9ad2478d
日常使用、稳定性和生产工作流请使用您自己的密钥。
核心工作流
- 1. 通过帮助优先探测确认端点和协议:
- uxc https://web3.okx.com/api/v1/onchainos-mcp -h
- 2. 配置凭证/绑定以实现可重复认证:
- uxc auth credential set okx-mcp --auth-type api
key --api-key-header OK-ACCESS-KEY --secret-env OKXACCESS_KEY
- uxc auth credential set okx-mcp --auth-type api_key --api-key-header OK-ACCESS-KEY --secret-op op://Engineering/okx/OK-ACCESS-KEY
- uxc auth binding add --id okx-mcp --host web3.okx.com --path-prefix /api/v1/onchainos-mcp --scheme https --credential okx-mcp --priority 100
- 3. 默认使用固定链接命令:
- command -v okx-mcp-cli
- 如果缺失,创建它:uxc link okx-mcp-cli https://web3.okx.com/api/v1/onchainos-mcp
- okx-mcp-cli -h
- 4. 执行前检查操作模式:
- okx-mcp-cli dex-okx-market-price -h
- okx-mcp-cli dex-okx-market-token-search -h
- okx-mcp-cli dex-okx-balance-total-value -h
- okx-mcp-cli dex-okx-dex-quote -h
- 5. 优先执行只读操作,然后是高影响操作。
能力映射
- dex-okx-market-price
- dex-okx-market-trades
- dex-okx-market-candlesticks
- dex-okx-market-candlesticks-history
- dex-okx-index-current-price
- dex-okx-index-historical-price
- dex-okx-market-token-search
- dex-okx-market-token-ranking
- dex-okx-market-token-holder
- dex-okx-market-token-basic-info
- dex-okx-market-token-price-info
- dex-okx-balance-chains
- dex-okx-balance-total-value
- dex-okx-balance-total-token-balances
- dex-okx-balance-specific-token-balance
- dex-okx-dex-aggregator-supported-chains
- dex-okx-dex-liquidity
- dex-okx-dex-quote
- dex-okx-dex-approve-transaction
- dex-okx-dex-swap
- dex-okx-dex-solana-swap-instruction
链索引快速参考
- - 以太坊:1
- BSC:56
- XLayer:196
- Solana:501
- Base:8453
- Arbitrum:42161
尽可能优先使用运行时发现(dex-okx-market-price-chains / dex-okx-dex-aggregator-supported-chains / dex-okx-balance-chains)。
安全护栏
- - 保持自动化在 JSON 输出信封上;不要依赖 --text。
- 首先解析稳定字段:ok、kind、protocol、data、error。
- 使用 okx-mcp-cli 作为默认命令路径。
- okx-mcp-cli ... 等同于 uxc https://web3.okx.com/api/v1/onchainos-mcp ...。
- 如果调用结果包含 Request header OK-ACCESS-KEY can not be empty:
- 使用 uxc auth binding match https://web3.okx.com/api/v1/onchainos-mcp 确认认证绑定与端点匹配
- 使用显式标头更新凭证:uxc auth credential set okx-mcp --auth-type api
key --api-key-header OK-ACCESS-KEY --secret-env OKXACCESS_KEY
- 确认凭证具有密钥源(--secret-env、--secret-op 或字面量 --secret)
- dex-okx-dex-approve-transaction
- dex-okx-dex-swap
- dex-okx-dex-solana-swap-instruction
- 对于市场蜡烛图/交易,使用 wSOL 代币地址 So11111111111111111111111111111111111111112
- 对于某些价格上下文,SOL 系统地址 11111111111111111111111111111111 也可能出现在文档中
- 当 Solana 上的数据为空时,首先验证操作级别的地址预期。
参考
- references/usage-patterns.md