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

# MCP Setup for Claude Desktop

> Step-by-step guide to configure Claude Desktop with LeoKit's MCP server

## Quick Setup

Get LeoKit's cross-chain swap tools integrated into Claude Desktop in under 2 minutes.

<Info>
  **Prerequisites:**

  * [Claude Desktop](https://claude.ai/download) installed
  * A LeoKit API key from [dash.leokit.dev](https://dash.leokit.dev)
</Info>

## Setup Options

<CardGroup cols={2}>
  <Card title="Remote Server" icon="cloud" href="#remote-server-recommended">
    Use our hosted MCP server - no installation required
  </Card>

  <Card title="Local Installation" icon="laptop" href="#local-installation">
    Run the MCP server on your machine via npm
  </Card>
</CardGroup>

## Remote Server (Recommended)

### Step 1: Get Your API Key

1. Visit [dash.leokit.dev](https://dash.leokit.dev)
2. Sign up or log in
3. Navigate to API Keys section
4. Create a new API key

### Step 2: Configure Claude Desktop

Add this configuration to your Claude Desktop config file:

**Config File Location:**

* **macOS/Linux:** `~/.config/claude/claude_desktop_config.json`
* **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

**Configuration:**

```json theme={null}
{
  "mcpServers": {
    "leokit": {
      "transport": {
        "type": "http",
        "url": "https://mcp.leokit.dev/mcp",
        "headers": {
          "Authorization": "Bearer YOUR-LEOKIT-API-KEY"
        }
      }
    }
  }
}
```

<Warning>
  Replace `YOUR-LEOKIT-API-KEY` with your actual API key from the dashboard
</Warning>

### Step 3: Restart Claude Desktop

Close and reopen Claude Desktop to load the new configuration.

### Step 4: Verify Setup

Test the integration by asking Claude:

```
"List available LeoKit tools"
```

You should see tools like `leokit_get_quote`, `leokit_create_deposit`, etc.

## Local Installation

If you prefer to run the MCP server locally:

### Step 1: Install via NPM

```bash theme={null}
npm install -g @inleo/leokit-mcp
```

### Step 2: Configure Claude Desktop

Add this configuration:

```json theme={null}
{
  "mcpServers": {
    "leokit": {
      "command": "npx",
      "args": ["-y", "@inleo/leokit-mcp"],
      "env": {
        "LEOKIT_API_KEY": "YOUR-LEOKIT-API-KEY"
      }
    }
  }
}
```

### Step 3: Restart and Verify

Restart Claude Desktop and verify as described above.

## One-Line Setup Scripts

For automated setup, use our installation scripts:

<CodeGroup>
  ```bash macOS/Linux theme={null}
  curl -fsSL https://raw.githubusercontent.com/LeoFinance/leodex-backend/main/apps/leokit-mcp/scripts/setup-claude.sh | bash
  ```

  ```powershell Windows theme={null}
  irm https://raw.githubusercontent.com/LeoFinance/leodex-backend/main/apps/leokit-mcp/scripts/setup-claude.ps1 | iex
  ```
</CodeGroup>

## Available Tools

Once configured, you can use these tools through Claude:

<AccordionGroup>
  <Accordion title="leokit_get_quote" icon="chart-line">
    Get swap quotes from multiple DEX protocols across 30+ blockchains.

    **Example:** *"Get me a quote for swapping 1 ETH to USDC"*
  </Accordion>

  <Accordion title="leokit_create_deposit" icon="file-code">
    Generate unsigned transactions for executing swaps.

    **Example:** *"Create a deposit transaction for quote ID abc123"*
  </Accordion>

  <Accordion title="leokit_check_status" icon="magnifying-glass">
    Check the status of a swap transaction.

    **Example:** *"Check the status of my swap with transaction hash 0x..."*
  </Accordion>

  <Accordion title="leokit_get_assets" icon="coins">
    List all supported tokens and chains.

    **Example:** *"Show me all available assets on Arbitrum"*
  </Accordion>

  <Accordion title="leokit_get_balances" icon="wallet">
    Check wallet balances across multiple chains.

    **Example:** *"Check my ETH balance at 0x..."*
  </Accordion>
</AccordionGroup>

## Example Usage

Here's how to use LeoKit tools through Claude:

<Steps>
  <Step title="Get a Quote">
    ```
    "Get me a quote for swapping 1 BTC to ETH.
     My origin address is bc1q...
     and destination is 0x..."
    ```
  </Step>

  <Step title="Review Options">
    Claude will fetch quotes from multiple protocols (THORChain, MAYAChain, Chainflip, etc.) and present the best options.
  </Step>

  <Step title="Create Transaction">
    ```
    "Create a deposit transaction for the THORChain quote"
    ```
  </Step>

  <Step title="Execute">
    Claude will generate the unsigned transaction. You can then sign and broadcast it using your preferred wallet.
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Tools Not Appearing" icon="triangle-exclamation">
    **Solutions:**

    * Verify your API key is correct
    * Check the config file path matches your OS
    * Ensure Claude Desktop was fully restarted
    * Check for JSON syntax errors in the config file
  </Accordion>

  <Accordion title="Authentication Errors" icon="lock">
    **Solutions:**

    * Confirm your API key is active in the dashboard
    * Verify the API key is correctly placed in the config
    * Check that there are no extra spaces in the Bearer token
  </Accordion>

  <Accordion title="Connection Issues" icon="wifi">
    **Solutions:**

    * For remote setup: Check internet connection
    * For local setup: Verify npm package is installed
    * Check firewall settings aren't blocking connections
  </Accordion>
</AccordionGroup>

## Advanced Configuration

### Custom API Endpoint

To use a self-hosted LeoKit API:

```json theme={null}
{
  "mcpServers": {
    "leokit": {
      "transport": {
        "type": "http",
        "url": "https://mcp.leokit.dev/mcp",
        "headers": {
          "Authorization": "Bearer YOUR-API-KEY"
        }
      }
    }
  }
}
```

Then set the environment variable:

```bash theme={null}
export LEOKIT_API_URL="https://your-api.example.com"
```

### Multiple Configurations

You can run both local and remote setups simultaneously with different names:

```json theme={null}
{
  "mcpServers": {
    "leokit-remote": {
      "transport": {
        "type": "http",
        "url": "https://mcp.leokit.dev/mcp",
        "headers": {
          "Authorization": "Bearer YOUR-API-KEY"
        }
      }
    },
    "leokit-local": {
      "command": "npx",
      "args": ["-y", "@inleo/leokit-mcp"],
      "env": {
        "LEOKIT_API_KEY": "YOUR-API-KEY"
      }
    }
  }
}
```

## Need Help?

* **Dashboard:** [dash.leokit.dev](https://dash.leokit.dev)
* **Documentation:** [docs.leokit.dev](https://docs.leokit.dev)
* **Support:** Join our [Discord](https://discord.gg/leofinance)

## Next Steps

<CardGroup cols={2}>
  <Card title="MCP Integration Guide" icon="book" href="/guides/mcp-integration">
    Learn more about using MCP tools
  </Card>

  <Card title="Complete Swap Flow" icon="arrows-rotate" href="/guides/complete-swap-flow">
    Understand the full swap process
  </Card>
</CardGroup>
