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

# MCP Server

> Connect AI coding agents to deBridge for cross-chain swaps

Ask your AI assistant to bridge 1 ETH from Arbitrum to Solana. Get a quote in seconds. Click one link to execute.

The deBridge MCP Server ([`@debridge-finance/debridge-mcp`](http://npmjs.com/package/@debridge-finance/debridge-mcp)) gives AI
agents direct access to the deBridge Liquidity Network — search 40,000+ tokens, get quotes for cross-chain and same-chain swaps,
generate transaction data, and create shareable [deBridge App](https://app.debridge.finance) links based on
[custom linking](/dln-details/widget/app). No API keys required.

## How It Works

The MCP server is a stateless proxy that translates MCP tool calls into deBridge REST API requests. It does no heavy computation,
keeps no state, and stores nothing. The AI agent never talks to the deBridge API directly — all requests flow through the server.

```mermaid theme={null}
sequenceDiagram
    participant Agent as AI Agent
    participant Server as MCP Server
    participant API as deBridge API

    Agent->>Server: MCP tool call (e.g. create_tx)
    Server->>API: REST request
    API-->>Server: JSON response
    Server-->>Agent: Tool result
    Agent->>Agent: Presents result to user
```

The server calls public deBridge APIs, which provide a generous 50 requests per minute rate limit without authentication.

## Use Cases

* **Developers building on deBridge** — test quotes, check token addresses, and verify chain IDs without leaving the IDE. The MCP
  server turns an AI assistant into a live deBridge API explorer.
* **Power users in AI chat** — get quick swap quotes as part of a broader conversation. One click on the generated link to execute
  the swap.
* **Analysts and content creators** — query live pricing data conversationally. Compare bridge rates across chains for reports and
  research.
* **Trading bots and dashboards** — autonomous agents that monitor prices across chains and generate swap links when conditions
  are met.
* **Integrate with the existing AI agents** — any agent that supports MCP servers can use this to offer deBridge swaps without
  building their own API integration and expand their capabilities into DeFi space.

## Quick Start

Add this to your MCP configuration file:

```json theme={null}
{
  "mcpServers": {
    "debridge-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@debridge-finance/debridge-mcp@latest"
      ]
    }
  }
}
```

This works for most AI coding agents (Cursor, Claude Code, Windsurf, Cline, etc.). See [Configuration](#configuration) for
framework-specific paths and options.

<Note>
  **Claude Desktop** requires HTTP transport. Start the server with `MCP_TRANSPORT=http npx -y
      @debridge-finance/debridge-mcp@latest`, then configure the URL `http://localhost:3000/mcp`. See [Configuration](#configuration)
  for details.
</Note>

## Tools

### `get_instructions`

Returns the built-in workflow guide that describes the recommended sequence for using the deBridge MCP tools.

No parameters.

<Tip>
  Call this first to understand the recommended workflow before using other tools.
</Tip>

### `search_tokens`

Resolves token names, symbols, or addresses to contract addresses across supported chains.

| Parameter | Type   | Required | Description                          |
| --------- | ------ | -------- | ------------------------------------ |
| `query`   | string | Yes      | Token name, symbol, or address       |
| `chainId` | string | No       | Filter by chain ID                   |
| `name`    | string | No       | Filter by token name (partial match) |
| `limit`   | number | No       | Max results (default: 10)            |

Results are ranked by relevance: exact symbol match → exact name match → starts-with → substring.

**Example:**

```json theme={null}
{
  "query": "USDC",
  "chainId": "1"
}
```

```json theme={null}
{
  "tokens": [
    {
      "symbol": "USDC",
      "name": "USD Coin",
      "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
      "decimals": 6,
      "chainId": "1"
    }
  ]
}
```

### `get_supported_chains`

Lists all blockchain networks supported by DLN.

No parameters.

**Example response:**

```json theme={null}
{
  "chains": [
    { "chainId": "1", "chainName": "Ethereum" },
    { "chainId": "56", "chainName": "BNB Chain" },
    { "chainId": "137", "chainName": "Polygon" },
    { "chainId": "42161", "chainName": "Arbitrum" },
    { "chainId": "7565164", "chainName": "Solana" }
  ]
}
```

### `create_tx`

Get quotes for cross-chain swaps.

| Parameter                       | Type    | Required | Description                             |
| ------------------------------- | ------- | -------- | --------------------------------------- |
| `srcChainId`                    | string  | Yes      | Source chain ID                         |
| `srcChainTokenIn`               | string  | Yes      | Source token address                    |
| `srcChainTokenInAmount`         | string  | Yes      | Amount in smallest units (wei/lamports) |
| `dstChainId`                    | string  | Yes      | Destination chain ID                    |
| `dstChainTokenOut`              | string  | Yes      | Destination token address               |
| `dstChainTokenOutRecipient`     | string  | Yes      | Recipient wallet address                |
| `srcChainOrderAuthorityAddress` | string  | Yes      | Sender's wallet address                 |
| `dstChainOrderAuthorityAddress` | string  | Yes      | Recipient's authority address           |
| `dstChainTokenOutAmount`        | string  | No       | Output amount or `"auto"` (default)     |
| `prependOperatingExpenses`      | boolean | No       | Include operating expenses in input     |

<Warning>
  All token amounts must be in the smallest unit of the token. For example, 1 USDC = `"1000000"` (6 decimals), 1 ETH =
  `"1000000000000000000"` (18 decimals). Use `search_tokens` to find the correct `decimals` value.
</Warning>

<Note>
  The native token (ETH, BNB, MATIC, etc.) is represented by the zero address: `0x0000000000000000000000000000000000000000`.

  SOL on Solana is represented with `11111111111111111111111111111111` and Wrapped SOL (WSOL) is represented with
  `So11111111111111111111111111111111111111112`.
</Note>

### `estimate_same_chain_swap`

Estimates a same-chain token swap. Returns the expected output amount, fees, slippage, and aggregator comparisons.

| Parameter               | Type   | Required | Description                                   |
| ----------------------- | ------ | -------- | --------------------------------------------- |
| `chainId`               | string | Yes      | Chain ID (native or deBridge internal)        |
| `tokenIn`               | string | Yes      | Input token address (zero address for native) |
| `tokenInAmount`         | string | Yes      | Amount in smallest units (wei/lamports)       |
| `tokenOut`              | string | Yes      | Output token address                          |
| `tokenOutAmount`        | string | No       | Expected output or `"auto"` (default)         |
| `slippage`              | string | No       | Slippage tolerance or `"auto"` (default)      |
| `affiliateFeePercent`   | number | No       | Affiliate fee percentage                      |
| `affiliateFeeRecipient` | string | No       | Affiliate fee recipient address               |

<Tip>
  This tool accepts both native chain IDs (e.g. `4326` for MegaETH) and deBridge internal IDs.
</Tip>

### `get_trade_dapp_url`

Generates a shareable deBridge App URL for a given trade.

| Parameter        | Type   | Required | Description                                      |
| ---------------- | ------ | -------- | ------------------------------------------------ |
| `inputChain`     | string | Yes      | Source chain ID                                  |
| `outputChain`    | string | Yes      | Destination chain ID                             |
| `amount`         | string | Yes      | Human-readable amount (e.g., `"1.5"`)            |
| `inputCurrency`  | string | No       | Source token address (empty for native)          |
| `outputCurrency` | string | No       | Destination token address (empty for native)     |
| `dlnMode`        | string | No       | `"simple"` or `"advanced"` (default: `"simple"`) |

<Tip>
  Unlike `create_tx`, this tool uses human-readable amounts — pass `"1.5"` for 1.5 ETH, not the wei value.
</Tip>

**Example output:**

```
https://app.debridge.finance/order?inputChain=1&outputChain=42161&inputCurrency=&outputCurrency=&amount=1.5&dlnMode=simple
```

## Workflow

The recommended sequence for performing a swap:

1. **Resolve chains** — call `get_supported_chains` to find the chain IDs for the source and destination networks.
2. **Resolve tokens** — call `search_tokens` with the chain ID to get the token contract addresses and decimals.
3. **Get a quote** — call `create_tx` for cross-chain swaps or `estimate_same_chain_swap` for same-chain swaps.
4. **Share a link** — call `get_trade_dapp_url` to generate a deBridge App URL the user can open to execute the swap.

<Note>
  The MCP server never touches private keys or signs transactions. The user always completes the swap themselves: open the
  generated link, connect their wallet, review, and sign. This browser handoff is a deliberate security boundary — the server
  handles pricing and quoting, while the user retains full control over execution.
</Note>

## Example

**Prompt:** `Bridge 1 ETH from Arbitrum to USDC on Solana`

1. **Resolve chains** — call `get_supported_chains` to find that Arbitrum is `42161` and Solana is `7565164`.
2. **Resolve source token** — call `search_tokens` with `query: "ETH"` and `chainId: "42161"` to get the native token address
   (`0x0000000000000000000000000000000000000000`, 18 decimals).
3. **Resolve destination token** — call `search_tokens` with `query: "USDC"` and `chainId: "7565164"` to get the USDC address on
   Solana.
4. **Create the transaction** — call `create_tx` with the resolved addresses and `srcChainTokenInAmount: "1000000000000000000"` (1
   ETH in wei). The response includes the estimated output amount and transaction data.
5. **Generate a link** — call `get_trade_dapp_url` with `inputChain: "42161"`, `outputChain: "7565164"`, `amount: "1"`, and the
   resolved token addresses.
6. **User completes the swap** — the user opens the generated link in their browser, connects their wallet, and signs the
   transaction.

## Configuration

The standard configuration works for most frameworks:

```json theme={null}
{
  "mcpServers": {
    "debridge-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@debridge-finance/debridge-mcp@latest"
      ]
    }
  }
}
```

<Accordion title="Claude Code">
  ```bash theme={null}

  claude mcp add debridge npx -- -y @debridge-finance/debridge-mcp@latest 

  ```
</Accordion>

<Accordion title="Cursor">
  Add to `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global):

  ```json theme={null}
  {
    "mcpServers": {
      "debridge-mcp": {
        "command": "npx",
        "args": [
          "-y",
          "@debridge-finance/debridge-mcp@latest"
        ]
      }
    }
  }
  ```
</Accordion>

<Accordion title="VS Code + GitHub Copilot">
  Add to `.vscode/mcp.json`:

  ```json theme={null}
  {
    "servers": {
      "debridge-mcp": {
        "type": "stdio",
        "command": "npx",
        "args": ["-y", "@debridge-finance/debridge-mcp@latest"]
      }
    }
  }
  ```
</Accordion>

<Accordion title="Windsurf">
  Add to `~/.codeium/windsurf/mcp_config.json`:

  ```json theme={null}
  {
    "mcpServers": {
      "debridge-mcp": {
        "command": "npx",
        "args": [
          "-y",
          "@debridge-finance/debridge-mcp@latest"
        ]
      }
    }
  }
  ```
</Accordion>

<Accordion title="Docker">
  Clone [the repository](https://github.com/debridge-finance/debridge-mcp/tree/main) and build from source:

  ```bash theme={null}
  docker build -t debridge-mcp .
  docker run -p 3000:3000 debridge-mcp
  ```
</Accordion>

## Environment Variables

| Variable        | Default   | Description                               |
| --------------- | --------- | ----------------------------------------- |
| `MCP_TRANSPORT` | `stdio`   | Set to `"http"` for HTTP streaming mode   |
| `PORT`          | `3000`    | HTTP server port (HTTP mode only)         |
| `HOST`          | `0.0.0.0` | HTTP server bind address (HTTP mode only) |

## Resources

* [GitHub Repository](https://github.com/debridge-finance/debridge-mcp)
* [npm Package](https://www.npmjs.com/package/@debridge-finance/debridge-mcp)
* [DLN API Documentation](/dln-details/integration-guidelines/order-creation/authentication)
* [deBridge App](https://app.debridge.finance)
