Connect AI tools to LI.FI cross-chain swap functionality via the Model Context Protocol
The LI.FI MCP Server integrates with the LI.FI API to provide cross-chain swap functionality across multiple liquidity pools and bridges via the Model Context Protocol (MCP).MCP is a standard protocol for AI model integration, allowing AI tools like Claude, Cursor, Windsurf, and VS Code Copilot to access external tools and data sources directly.
This server provides read-only tools. It does not sign or broadcast transactions. Quote responses include unsigned transactionRequest objects that must be signed and submitted externally using your own wallet.
Paste this into your MCP client config and start querying cross-chain swap data. See Installation for tool-specific setup instructions.For higher rate limits, add your LI.FI API key via the X-LiFi-Api-Key header or Authorization: Bearer header.
The MCP server wraps the LI.FI REST API into MCP-compatible tools that AI agents can call directly. Instead of constructing HTTP requests, your AI tool discovers and invokes structured tools like get-quote, get-chains, and get-token.
Copy
Ask AI
AI Tool (Claude, Cursor, etc.) │ ▼MCP Protocol │ ▼LI.FI MCP Server (https://mcp.li.quest/mcp) │ ▼LI.FI API (https://li.quest) │ ▼27+ Bridges & 31+ DEXes across 58 chains
A typical cross-chain swap via the MCP server follows this flow:
Copy
Ask AI
1. get-chains # Find chain IDs and RPC URLs2. get-token (chain, symbol) # Get token addresses3. get-quote (...) # Get best route and transactionRequest4. get-allowance (...) # Check if token approval is needed5. (external) Approve tokens using your wallet if allowance < amount6. (external) Sign and broadcast transactionRequest using your wallet7. get-status (txHash) # Track cross-chain progress
Without an API key, the server uses the public rate limit (200 requests / 2 hours). With an API key, you get higher rate limits (200 requests / minute).Pass your API key via HTTP headers in your MCP client config:
Authorization: Bearer your_api_key
X-LiFi-Api-Key: your_api_key
Use the test-api-key MCP tool to verify your key is valid and check rate limit information.