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.
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.
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.
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
-
get-native-token-balance
-
get-token-balance
-
get-allowance
-
get-gas-prices
-
get-gas-suggestion
- - Monitoring and service checks:
-
get-status
-
test-api-key
- INLINECODE36
Always inspect host help and operation help in the current endpoint version before relying on an operation name or argument shape.
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.
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. - INLINECODE52 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.
Tested Real Scenario
The endpoint was verified through uxc host discovery and returned a live MCP tool list including:
- - INLINECODE62
- INLINECODE63
- INLINECODE64
- INLINECODE65
- INLINECODE66
- INLINECODE67
- INLINECODE68
- INLINECODE69
- INLINECODE70
- INLINECODE71
- INLINECODE72
- INLINECODE73
- INLINECODE74
- INLINECODE75
This confirms the skill target is a real hosted MCP surface accessible via UXC.
References
- INLINECODE76
LI.FI MCP 技能
使用此技能通过 uxc 运行 LI.FI MCP 操作。
复用 uxc 技能进行通用协议发现、认证绑定、信封解析和错误处理。
前置条件
- - uxc 已安装并位于 PATH 环境变量中。
- 可访问 https://mcp.li.quest/mcp 网络端点。
- 可选:用于更高速率限制的 LI.FI API 密钥。
核心工作流程
- 1. 通过帮助优先探测验证端点和协议:
- uxc https://mcp.li.quest/mcp -h
- 确认协议为 MCP(信封中 protocol == mcp)。
- 2. 可选:为更高速率限制设置认证:
- uxc auth credential set lifi-mcp --auth-type bearer --secret-env LIFI
APIKEY
- 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
或 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. 执行前检查操作模式:
- 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. 优先进行发现,然后是路由/报价,最后是执行预检查查询。
能力映射
- 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
在依赖操作名称或参数结构之前,始终检查当前端点版本的主机帮助和操作帮助。
推荐使用模式
- 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=<钱包地址> fromAmount=<最小单位金额>
- 5. 验证执行前置条件:
- lifi-mcp-cli get-allowance ...
- lifi-mcp-cli get-native-token-balance ...
- 6. 仅在外部签名交易已广播后使用 get-status。
防护措施
- - 保持自动化使用 JSON 输出信封;不要依赖 --text。
- 优先解析稳定字段:ok、kind、protocol、data、error。
- 使用 lifi-mcp-cli 作为默认命令路径。
- 当配置了相同的认证绑定时,lifi-mcp-cli <操作> ... 等同于 uxc https://mcp.li.quest/mcp <操作> ...。
- 仅在链接设置不可用时,临时使用直接的 uxc <端点> ... 作为后备方案。
- 简单参数优先使用 key=value 格式,嵌套对象使用位置 JSON。
- 从代理角度来看,此端点是只读的:
- 它不签署交易
- 它不广播交易
- 它返回未签名的 transactionRequest 对象供外部钱包执行
- - 不要将 get-quote 或 get-step-transaction 呈现为已执行的交易;它们只是执行计划。
- 在建议 ERC20 路由可执行之前,如果路由需要授权,请检查授权额度。
- 仅当用户明确想要多个备选方案时,才优先使用 get-routes;默认使用 get-quote 获取最佳路由。
- 在实际测试中,链查询工具接受名称,但代币/余额/授权工具在使用数字链 ID 时更可靠。发现后优先使用数字 ID。
经过测试的真实场景
通过 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/usage-patterns.md