# SwapAPI MCP server

> Enables AI agents to retrieve executable token swap calldata for any EVM-compatible blockchain.

- Repository: https://github.com/swap-api/swap-api
- Page: https://hostedmcp.org/servers/swap-api/mcp
- Transport: stdio
- Stars: 22
- License: MIT
- Latest version: 0.1.0

## Install

### Claude Code

```sh
claude mcp add mcp -- npx -y @swapapi/mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@swapapi/mcp"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@swapapi/mcp"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"mcp","type":"stdio","command":"npx","args":["-y","@swapapi/mcp"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@swapapi/mcp"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add mcp -- npx -y @swapapi/mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.mcp]
command = "npx"
args = ["-y", "@swapapi/mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user mcp npx -- -y @swapapi/mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@swapapi/mcp"
      ]
    }
  }
}
```

## Tools (1)

- `sender`

## FAQ

### How do I swap using a native token like ETH?

To use a native token as the input, use the address 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for the tokenIn parameter.

### What should I check before submitting a swap transaction?

You should ensure ERC-20 approval is granted, verify the sender has sufficient balance, estimate gas with a buffer, simulate the transaction, and submit within 30 seconds.
