# AI Documentation (MCP)

## Overview

**Broker as a Service** exposes a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server, allowing AI agents and coding assistants to discover assets, get quotes, execute cross-chain swaps, and monitor swap progress — all through natural language.

The MCP server uses **HTTP Streamable** transport in stateless mode and speaks MCP protocol versions `2024-11-05`, `2025-03-26`, `2025-06-18`, `2025-11-25` and `2026-07-28`. No API key is required to get started, though you can optionally provide one for partner-level tracking.

## MCP Endpoints

| Environment | URL |
| --- | --- |
| Production | `https://chainflip-broker.io/mcp` |
| Testing | `https://perseverance.chainflip-broker.io/mcp` |

## Available Tools

The MCP server exposes the following tools:

| Tool | Description |
| --- | --- |
| `list_assets` | List all available swap assets with ticker, network, decimals, minimum amounts, and USD prices |
| `get_quotes` | Get swap quotes using human-readable amounts (e.g. `1.5` for 1.5 BTC) |
| `get_native_quotes` | Get swap quotes using native unit amounts (e.g. `150000000` satoshis) |
| `start_swap` | Initiate a simple cross-chain swap |
| `start_dca_swap` | Initiate a Dollar Cost Averaging swap, split across multiple sub-swaps |
| `check_status` | Check the status of a swap by its swap ID |

A **swap-assistant** prompt is also available, providing AI agents with detailed guidance on the complete swap workflow — from asset discovery through quoting, execution, and monitoring.

## Connecting Your AI Tool

### Claude Code

Add the MCP server to your project by running:

```bash
claude mcp add chainflip-baas --transport http https://chainflip-broker.io/mcp
```

Or add it to your `.mcp.json` file:

```json
{
  "mcpServers": {
    "chainflip-baas": {
      "type": "url",
      "url": "https://chainflip-broker.io/mcp"
    }
  }
}
```

### Claude Desktop

Open **Settings > Developer > Edit Config** and add the server to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "chainflip-baas": {
      "type": "url",
      "url": "https://chainflip-broker.io/mcp"
    }
  }
}
```

Restart Claude Desktop to pick up the changes.

### OpenClaw

The quickest option is to install our published [ClawHub](https://clawhub.ai/baas/skills/chainflip) skill, which connects this MCP server and adds guided, natural-language swap workflows:

```bash
openclaw skills install @baas/chainflip
```

Or add the MCP server directly. Navigate to **Settings > MCP Servers > Add Server** and configure:

- **Name:** `chainflip-baas`
- **Type:** URL
- **URL:** `https://chainflip-broker.io/mcp`

### Cursor

Open **Cursor Settings > MCP** and click **Add new MCP server**. Set the type to `url` and enter:

```
https://chainflip-broker.io/mcp
```

Alternatively, add to your project's `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "chainflip-baas": {
      "type": "url",
      "url": "https://chainflip-broker.io/mcp"
    }
  }
}
```

### Windsurf

Open **Windsurf Settings > MCP** and click **Add Server**. Use the URL transport with:

```
https://chainflip-broker.io/mcp
```

Or add to your `~/.codeium/windsurf/mcp_config.json`:

```json
{
  "mcpServers": {
    "chainflip-baas": {
      "type": "url",
      "url": "https://chainflip-broker.io/mcp"
    }
  }
}
```

### Other MCP Clients

Any MCP-compatible client can connect using the HTTP Streamable transport. Point it at the endpoint URL:

```
https://chainflip-broker.io/mcp
```

For the testing environment, use `https://perseverance.chainflip-broker.io/mcp` instead. Both endpoints are also reachable over Tor; see [Tor (.onion)](https://docs.chainflip-broker.io/environments/tor/).

## Discovery

Clients that discover MCP servers automatically can find this one without configuration. The production server publishes an [MCP Server Card](https://github.com/modelcontextprotocol/ext-server-card) at `https://chainflip-broker.io/mcp/server-card`, listed in the domain's AI Catalog at `https://chainflip-broker.io/.well-known/ai-catalog.json`. Both formats are still experimental, so the documents may change as the specifications settle. Over Tor, the same paths on the onion address describe the onion endpoint.

## Authentication

An API key is **optional**. All tools are accessible without one, making it easy to explore and test.

To use your API key, pass it as the `apiKey` parameter on tools that support it (`get_quotes`, `get_native_quotes`, `start_swap`, `start_dca_swap`). Register at [chainflip-broker.io](https://chainflip-broker.io/register) to get one. Without a key the swaps still execute, but the volume books as house volume and earns no commission.

## Support

Feel free to [reach out to us](https://docs.chainflip-broker.io/resources/contact/) in case you need help.
