lifi-mcp-skill

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

LI.FI MCP Skill

LI.FI MCP Skill

Use this skill to run LI.FI MCP operations through
uxc
.
Reuse the
uxc
skill for generic protocol discovery, auth binding, envelope parsing, and error handling.
使用本技能通过
uxc
执行LI.FI MCP操作。
复用
uxc
技能来实现通用协议发现、认证绑定、信封解析和错误处理。

Prerequisites

前提条件

  • uxc
    is installed and available in
    PATH
    .
  • Network access to
    https://mcp.li.quest/mcp
    .
  • Optional: a LI.FI API key for higher rate limits.
  • uxc
    已安装且可在
    PATH
    中访问。
  • 可访问网络地址
    https://mcp.li.quest/mcp
  • 可选:LI.FI API密钥,用于提升速率限制。

Core Workflow

核心工作流程

  1. Verify endpoint and protocol with help-first probing:
    • uxc https://mcp.li.quest/mcp -h
    • Confirm protocol is MCP (
      protocol == "mcp"
      in the envelope).
  2. Optional auth setup for higher rate limits:
    • uxc auth credential set lifi-mcp --auth-type bearer --secret-env LIFI_API_KEY
    • uxc auth binding add --id lifi-mcp --host mcp.li.quest --path-prefix /mcp --scheme https --credential lifi-mcp --priority 100
    • LI.FI accepts either
      Authorization: Bearer <key>
      or
      X-LiFi-Api-Key
      ; prefer bearer unless endpoint behavior changes.
  3. Use a fixed link command by default:
    • command -v lifi-mcp-cli
    • If missing, create it:
      • uxc link lifi-mcp-cli https://mcp.li.quest/mcp
    • lifi-mcp-cli -h
  4. Inspect operation schema before execution:
    • lifi-mcp-cli get-chains -h
    • lifi-mcp-cli get-token -h
    • lifi-mcp-cli get-quote -h
    • lifi-mcp-cli get-status -h
  5. Prefer discovery first, then route/quote, then execution-precheck queries.
  1. 通过优先探测验证端点和协议:
    • uxc https://mcp.li.quest/mcp -h
    • 确认协议为MCP(信封中
      protocol == "mcp"
      )。
  2. 可选:设置认证以提升速率限制:
    • uxc auth credential set lifi-mcp --auth-type bearer --secret-env LIFI_API_KEY
    • uxc auth binding add --id lifi-mcp --host mcp.li.quest --path-prefix /mcp --scheme https --credential lifi-mcp --priority 100
    • LI.FI支持
      Authorization: Bearer <key>
      X-LiFi-Api-Key
      两种方式;除非端点行为变更,否则优先使用bearer方式。
  3. 默认使用固定链接命令:
    • command -v lifi-mcp-cli
    • 若未找到,创建链接:
      • uxc link lifi-mcp-cli https://mcp.li.quest/mcp
    • lifi-mcp-cli -h
  4. 执行前检查操作 schema:
    • lifi-mcp-cli get-chains -h
    • lifi-mcp-cli get-token -h
    • lifi-mcp-cli get-quote -h
    • lifi-mcp-cli get-status -h
  5. 优先执行发现操作,然后是路由/报价,最后是执行前检查查询。

Capability Map

功能映射

  • Chain and token discovery:
    • get-chains
    • get-chain-by-id
    • get-chain-by-name
    • get-tokens
    • get-token
  • Route discovery and provider availability:
    • get-connections
    • get-tools
  • Quotes and route planning:
    • get-quote
    • get-routes
    • get-step-transaction
    • get-quote-with-calls
  • Wallet prechecks:
    • get-native-token-balance
    • get-token-balance
    • get-allowance
    • get-gas-prices
    • get-gas-suggestion
  • Monitoring and service checks:
    • get-status
    • test-api-key
    • health-check
Always inspect host help and operation help in the current endpoint version before relying on an operation name or argument shape.
  • 链与代币发现:
    • get-chains
    • get-chain-by-id
    • get-chain-by-name
    • get-tokens
    • get-token
  • 路由发现与提供商可用性:
    • get-connections
    • get-tools
  • 报价与路由规划:
    • get-quote
    • get-routes
    • get-step-transaction
    • get-quote-with-calls
  • 钱包预检查:
    • get-native-token-balance
    • get-token-balance
    • get-allowance
    • get-gas-prices
    • get-gas-suggestion
  • 监控与服务检查:
    • get-status
    • test-api-key
    • health-check
在依赖某个操作名称或参数格式之前,务必检查当前端点版本中的主机帮助和操作帮助。

Recommended Usage Pattern

推荐使用模式

  1. Discover chain IDs dynamically:
    • lifi-mcp-cli get-chains
    • lifi-mcp-cli get-chain-by-name name=base
  2. Resolve token addresses before quoting:
    • lifi-mcp-cli get-token chain=8453 token=USDC
  3. Check whether a route exists before asking for a quote:
    • lifi-mcp-cli get-connections fromChain=8453 toChain=42161
  4. Generate the quote:
    • lifi-mcp-cli get-quote fromChain=8453 toChain=42161 fromToken=USDC toToken=USDC fromAddress=<wallet> fromAmount=<smallest-unit-amount>
  5. Validate execution preconditions:
    • lifi-mcp-cli get-allowance ...
    • lifi-mcp-cli get-native-token-balance ...
  6. Use
    get-status
    only after the externally signed transaction has been broadcast.
  1. 动态发现链ID:
    • lifi-mcp-cli get-chains
    • lifi-mcp-cli get-chain-by-name name=base
  2. 报价前解析代币地址:
    • lifi-mcp-cli get-token chain=8453 token=USDC
  3. 请求报价前检查是否存在路由:
    • lifi-mcp-cli get-connections fromChain=8453 toChain=42161
  4. 生成报价:
    • lifi-mcp-cli get-quote fromChain=8453 toChain=42161 fromToken=USDC toToken=USDC fromAddress=<wallet> fromAmount=<smallest-unit-amount>
  5. 验证执行前置条件:
    • lifi-mcp-cli get-allowance ...
    • lifi-mcp-cli get-native-token-balance ...
  6. 仅在外部签名交易已广播后使用
    get-status

Guardrails

防护规则

  • Keep automation on JSON output envelope; do not rely on
    --text
    .
  • Parse stable fields first:
    ok
    ,
    kind
    ,
    protocol
    ,
    data
    ,
    error
    .
  • Use
    lifi-mcp-cli
    as the default command path.
  • lifi-mcp-cli <operation> ...
    is equivalent to
    uxc https://mcp.li.quest/mcp <operation> ...
    when the same auth binding is configured.
  • Use direct
    uxc "<endpoint>" ...
    only as a temporary fallback when link setup is unavailable.
  • Prefer
    key=value
    for simple arguments and positional JSON for nested objects.
  • This endpoint is read-only from the agent perspective:
    • it does not sign transactions
    • it does not broadcast transactions
    • it returns unsigned
      transactionRequest
      objects for external wallet execution
  • Do not present
    get-quote
    or
    get-step-transaction
    as executed trades; they are execution plans only.
  • Before suggesting an ERC20 route as ready to execute, check allowance if the route needs approval.
  • Prefer
    get-routes
    only when the user explicitly wants multiple alternatives; default to
    get-quote
    for the best route.
  • In live testing, chain lookup tools accepted names, but token/balance/allowance tools were more reliable with numeric chain IDs. Prefer numeric IDs after discovery.
  • 自动化操作基于JSON输出信封;不要依赖
    --text
    格式。
  • 优先解析稳定字段:
    ok
    ,
    kind
    ,
    protocol
    ,
    data
    ,
    error
  • 使用
    lifi-mcp-cli
    作为默认命令路径。
  • 当配置了相同的认证绑定时,
    lifi-mcp-cli <operation> ...
    等同于
    uxc https://mcp.li.quest/mcp <operation> ...
  • 仅当链接设置不可用时,才临时使用直接的
    uxc "<endpoint>" ...
    作为 fallback。
  • 简单参数优先使用
    key=value
    格式,嵌套对象使用位置JSON。
  • 从Agent视角来看,该端点是只读的:
    • 不会签名交易
    • 不会广播交易
    • 它返回未签名的
      transactionRequest
      对象,供外部钱包执行
  • 不要将
    get-quote
    get-step-transaction
    展示为已执行的交易;它们仅为执行计划。
  • 在建议ERC20路由可执行之前,若路由需要授权,请检查授权额度。
  • 仅当用户明确需要多种备选方案时才使用
    get-routes
    ;默认使用
    get-quote
    获取最优路由。
  • 在实时测试中,链查询工具接受名称,但代币/余额/授权工具使用数字链ID更可靠。发现后优先使用数字ID。

Tested Real Scenario

已测试的真实场景

The endpoint was verified through
uxc
host discovery and returned a live MCP tool list including:
  • get-allowance
  • get-chain-by-id
  • get-chain-by-name
  • get-chains
  • get-connections
  • get-gas-prices
  • get-gas-suggestion
  • get-quote
  • get-routes
  • get-status
  • get-token
  • get-tokens
  • get-tools
  • health-check
This confirms the skill target is a real hosted MCP surface accessible via UXC.
通过
uxc
主机发现验证了该端点,返回了包含以下工具的实时MCP工具列表:
  • get-allowance
  • get-chain-by-id
  • get-chain-by-name
  • get-chains
  • get-connections
  • get-gas-prices
  • get-gas-suggestion
  • get-quote
  • get-routes
  • get-status
  • get-token
  • get-tokens
  • get-tools
  • health-check
这证实了本技能的目标是可通过UXC访问的真实托管MCP服务。

References

参考资料

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