> ## Documentation Index
> Fetch the complete documentation index at: https://docs.li.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> 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](https://li.quest) to provide cross-chain swap functionality across multiple liquidity pools and bridges via the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/).

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.

<Warning>
  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.
</Warning>

## Quickstart

Add the hosted LI.FI MCP server to your AI tool. No installation required:

```json theme={"system"}
{
  "mcpServers": {
    "lifi": {
      "type": "http",
      "url": "https://mcp.li.quest/mcp"
    }
  }
}
```

Paste this into your MCP client config and start querying cross-chain swap data. See [Installation](/mcp-server/installation) for tool-specific setup instructions.

For higher rate limits, add your [LI.FI API key](https://li.fi/) via the `X-LiFi-Api-Key` header or `Authorization: Bearer` header.

## How It Works

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`.

```text theme={"system"}
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
```

## Example Workflow

A typical cross-chain swap via the MCP server follows this flow:

```text theme={"system"}
1. get-chains                    # Find chain IDs and RPC URLs
2. get-token (chain, symbol)     # Get token addresses
3. get-quote (...)               # Get best route and transactionRequest
4. get-allowance (...)           # Check if token approval is needed
5. (external) Approve tokens using your wallet if allowance < amount
6. (external) Sign and broadcast transactionRequest using your wallet
7. get-status (txHash)           # Track cross-chain progress
```

## API Key Configuration

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.

<Card title="Get an API Key" icon="key" href="https://li.fi/">
  Sign up at li.fi to get your API key
</Card>

## Common Chain IDs

| Chain     | ID               | Native Token |
| --------- | ---------------- | ------------ |
| Ethereum  | 1                | ETH          |
| Polygon   | 137              | MATIC        |
| Arbitrum  | 42161            | ETH          |
| Optimism  | 10               | ETH          |
| BSC       | 56               | BNB          |
| Avalanche | 43114            | AVAX         |
| Base      | 8453             | ETH          |
| Solana    | 1151111081099710 | SOL          |

<Tip>
  Use `get-chains` or `get-chain-by-name` to dynamically look up chain IDs instead of hardcoding them.
</Tip>

## Next Steps

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/mcp-server/installation">
    Setup instructions for Claude, Cursor, Windsurf, VS Code, and more
  </Card>

  <Card title="Available Tools" icon="wrench" href="/mcp-server/tools">
    Complete reference for all MCP tools
  </Card>

  <Card title="Examples" icon="code" href="/mcp-server/examples">
    Example prompts, responses, and code samples
  </Card>
</CardGroup>
