okx-mcp-skill

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OKX MCP Skill

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.
使用本Skill通过
uxc
执行OKX MCP操作。
复用
uxc
Skill以实现共享协议发现、输出解析以及通用认证/绑定流程。

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.
  • uxc
    已安装且可在
    PATH
    中访问。
  • 可访问
    https://web3.okx.com/api/v1/onchainos-mcp
    网络。
  • 拥有OKX Onchain API密钥用于实际调用。

Quick Trial Key

快速试用密钥

For quick read-only trial, OKX docs currently expose a shared demo key:
  • d573a84c-8e79-4a35-b0c6-427e9ad2478d
Example:
  • uxc auth credential set okx-mcp --auth-type api_key --api-key-header OK-ACCESS-KEY --secret d573a84c-8e79-4a35-b0c6-427e9ad2478d
Use your own key for regular usage, stability, and production workflows.
如需快速进行只读试用,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
常规使用、追求稳定性以及生产流程请使用您自己的密钥。

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.
  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 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. 默认使用固定链接命令:
    • command -v okx-mcp-cli
    • 如果缺失,创建链接:
      uxc link okx-mcp-cli https://web3.okx.com/api/v1/onchainos-mcp
    • okx-mcp-cli -h
  4. 执行前检查操作schema:
    • 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. 优先执行只读操作,再执行高影响操作。

Capability Map

功能映射

  • Market:
    • 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
  • Wallet:
    • dex-okx-balance-chains
    • dex-okx-balance-total-value
    • dex-okx-balance-total-token-balances
    • dex-okx-balance-specific-token-balance
  • Swap:
    • 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
  • 市场相关:
    • 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

ChainIndex Quick Reference

ChainIndex快速参考

  • Ethereum:
    1
  • BSC:
    56
  • XLayer:
    196
  • Solana:
    501
  • Base:
    8453
  • Arbitrum:
    42161
Always prefer runtime discovery (
dex-okx-market-price-chains
/
dex-okx-dex-aggregator-supported-chains
/
dex-okx-balance-chains
) when possible.
  • Ethereum:
    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
)。

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.
  • okx-mcp-cli <operation> ...
    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.
  • 自动化操作仅基于JSON输出包,不要依赖
    --text
    格式。
  • 优先解析稳定字段:
    ok
    ,
    kind
    ,
    protocol
    ,
    data
    ,
    error
  • 使用
    okx-mcp-cli
    作为默认命令路径。
  • okx-mcp-cli <operation> ...
    等同于
    uxc https://web3.okx.com/api/v1/onchainos-mcp <operation> ...
  • 如果调用结果包含
    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 OKX_ACCESS_KEY
    • 确认凭证有密钥来源(
      --secret-env
      ,
      --secret-op
      , 或字面量
      --secret
  • 高影响操作需要用户明确确认:
    • dex-okx-dex-approve-transaction
    • dex-okx-dex-swap
    • dex-okx-dex-solana-swap-instruction
  • OKX文档中关于Solana的注意事项:
    • 市场蜡烛图/交易数据需使用wSOL代币地址
      So11111111111111111111111111111111111111112
    • 在某些价格场景下,SOL系统地址
      11111111111111111111111111111111
      也可能出现在文档中
    • 当Solana上数据为空时,首先验证操作层面的地址要求。

References

参考资料

  • Invocation patterns:
    • references/usage-patterns.md
  • 调用模式:
    • references/usage-patterns.md