lifi-mcp-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLI.FI MCP Skill
LI.FI MCP Skill
Use this skill to run LI.FI MCP operations through .
uxcReuse the skill for generic protocol discovery, auth binding, envelope parsing, and error handling.
uxc使用本技能通过执行LI.FI MCP操作。
uxc复用技能来实现通用协议发现、认证绑定、信封解析和错误处理。
uxcPrerequisites
前提条件
- is installed and available in
uxc.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
核心工作流程
- Verify endpoint and protocol with help-first probing:
uxc https://mcp.li.quest/mcp -h- Confirm protocol is MCP (in the envelope).
protocol == "mcp"
- Optional auth setup for higher rate limits:
uxc auth credential set lifi-mcp --auth-type bearer --secret-env LIFI_API_KEYuxc auth binding add --id lifi-mcp --host mcp.li.quest --path-prefix /mcp --scheme https --credential lifi-mcp --priority 100- LI.FI accepts either or
Authorization: Bearer <key>; prefer bearer unless endpoint behavior changes.X-LiFi-Api-Key
- 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
- Inspect operation schema before execution:
lifi-mcp-cli get-chains -hlifi-mcp-cli get-token -hlifi-mcp-cli get-quote -hlifi-mcp-cli get-status -h
- Prefer discovery first, then route/quote, then execution-precheck queries.
- 通过优先探测验证端点和协议:
uxc https://mcp.li.quest/mcp -h- 确认协议为MCP(信封中)。
protocol == "mcp"
- 可选:设置认证以提升速率限制:
uxc auth credential set lifi-mcp --auth-type bearer --secret-env LIFI_API_KEYuxc 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>两种方式;除非端点行为变更,否则优先使用bearer方式。X-LiFi-Api-Key
- 默认使用固定链接命令:
command -v lifi-mcp-cli- 若未找到,创建链接:
uxc link lifi-mcp-cli https://mcp.li.quest/mcp
lifi-mcp-cli -h
- 执行前检查操作 schema:
lifi-mcp-cli get-chains -hlifi-mcp-cli get-token -hlifi-mcp-cli get-quote -hlifi-mcp-cli get-status -h
- 优先执行发现操作,然后是路由/报价,最后是执行前检查查询。
Capability Map
功能映射
- Chain and token discovery:
get-chainsget-chain-by-idget-chain-by-nameget-tokensget-token
- Route discovery and provider availability:
get-connectionsget-tools
- Quotes and route planning:
get-quoteget-routesget-step-transactionget-quote-with-calls
- Wallet prechecks:
get-native-token-balanceget-token-balanceget-allowanceget-gas-pricesget-gas-suggestion
- Monitoring and service checks:
get-statustest-api-keyhealth-check
Always inspect host help and operation help in the current endpoint version before relying on an operation name or argument shape.
- 链与代币发现:
get-chainsget-chain-by-idget-chain-by-nameget-tokensget-token
- 路由发现与提供商可用性:
get-connectionsget-tools
- 报价与路由规划:
get-quoteget-routesget-step-transactionget-quote-with-calls
- 钱包预检查:
get-native-token-balanceget-token-balanceget-allowanceget-gas-pricesget-gas-suggestion
- 监控与服务检查:
get-statustest-api-keyhealth-check
在依赖某个操作名称或参数格式之前,务必检查当前端点版本中的主机帮助和操作帮助。
Recommended Usage Pattern
推荐使用模式
- Discover chain IDs dynamically:
lifi-mcp-cli get-chainslifi-mcp-cli get-chain-by-name name=base
- Resolve token addresses before quoting:
lifi-mcp-cli get-token chain=8453 token=USDC
- Check whether a route exists before asking for a quote:
lifi-mcp-cli get-connections fromChain=8453 toChain=42161
- Generate the quote:
lifi-mcp-cli get-quote fromChain=8453 toChain=42161 fromToken=USDC toToken=USDC fromAddress=<wallet> fromAmount=<smallest-unit-amount>
- Validate execution preconditions:
lifi-mcp-cli get-allowance ...lifi-mcp-cli get-native-token-balance ...
- Use only after the externally signed transaction has been broadcast.
get-status
- 动态发现链ID:
lifi-mcp-cli get-chainslifi-mcp-cli get-chain-by-name name=base
- 报价前解析代币地址:
lifi-mcp-cli get-token chain=8453 token=USDC
- 请求报价前检查是否存在路由:
lifi-mcp-cli get-connections fromChain=8453 toChain=42161
- 生成报价:
lifi-mcp-cli get-quote fromChain=8453 toChain=42161 fromToken=USDC toToken=USDC fromAddress=<wallet> fromAmount=<smallest-unit-amount>
- 验证执行前置条件:
lifi-mcp-cli get-allowance ...lifi-mcp-cli get-native-token-balance ...
- 仅在外部签名交易已广播后使用。
get-status
Guardrails
防护规则
- Keep automation on JSON output envelope; do not rely on .
--text - Parse stable fields first: ,
ok,kind,protocol,data.error - Use as the default command path.
lifi-mcp-cli - is equivalent to
lifi-mcp-cli <operation> ...when the same auth binding is configured.uxc https://mcp.li.quest/mcp <operation> ... - Use direct only as a temporary fallback when link setup is unavailable.
uxc "<endpoint>" ... - Prefer for simple arguments and positional JSON for nested objects.
key=value - This endpoint is read-only from the agent perspective:
- it does not sign transactions
- it does not broadcast transactions
- it returns unsigned objects for external wallet execution
transactionRequest
- Do not present or
get-quoteas executed trades; they are execution plans only.get-step-transaction - Before suggesting an ERC20 route as ready to execute, check allowance if the route needs approval.
- Prefer only when the user explicitly wants multiple alternatives; default to
get-routesfor the best route.get-quote - 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> ... - 仅当链接设置不可用时,才临时使用直接的作为 fallback。
uxc "<endpoint>" ... - 简单参数优先使用格式,嵌套对象使用位置JSON。
key=value - 从Agent视角来看,该端点是只读的:
- 它不会签名交易
- 它不会广播交易
- 它返回未签名的对象,供外部钱包执行
transactionRequest
- 不要将或
get-quote展示为已执行的交易;它们仅为执行计划。get-step-transaction - 在建议ERC20路由可执行之前,若路由需要授权,请检查授权额度。
- 仅当用户明确需要多种备选方案时才使用;默认使用
get-routes获取最优路由。get-quote - 在实时测试中,链查询工具接受名称,但代币/余额/授权工具使用数字链ID更可靠。发现后优先使用数字ID。
Tested Real Scenario
已测试的真实场景
The endpoint was verified through host discovery and returned a live MCP tool list including:
uxcget-allowanceget-chain-by-idget-chain-by-nameget-chainsget-connectionsget-gas-pricesget-gas-suggestionget-quoteget-routesget-statusget-tokenget-tokensget-toolshealth-check
This confirms the skill target is a real hosted MCP surface accessible via UXC.
通过主机发现验证了该端点,返回了包含以下工具的实时MCP工具列表:
uxcget-allowanceget-chain-by-idget-chain-by-nameget-chainsget-connectionsget-gas-pricesget-gas-suggestionget-quoteget-routesget-statusget-tokenget-tokensget-toolshealth-check
这证实了本技能的目标是可通过UXC访问的真实托管MCP服务。
References
参考资料
- Invocation patterns:
references/usage-patterns.md
- 调用模式:
references/usage-patterns.md