# MCP server for AI agents

> Connect Claude, Cursor or any MCP client to Wagyu's Model Context Protocol server to quote, create and track swaps as tools. No key needed.

Wagyu runs a [Model Context Protocol](https://modelcontextprotocol.io) server, so an AI agent can quote, create and track a swap without writing an HTTP client:

```text
https://mcp.wagyu.xyz
```

It is a stateless Streamable HTTP server (protocol version `2025-06-18`). No key or account is needed.

## Connect

<!-- Claude Code -->
```bash
claude mcp add --transport http wagyu https://mcp.wagyu.xyz
```

<!-- JSON config (Claude Desktop, Cursor, Windsurf…) -->
```json
{
  "mcpServers": {
    "wagyu": { "type": "http", "url": "https://mcp.wagyu.xyz" }
  }
}
```

## Tools

The server exposes 6 tools:

| Tool | Read-only | What it does | Required arguments |
| --- | --- | --- | --- |
| `list_chains` | Yes | Chains available right now, which ids can be a source or a destination, and featured tokens. | — |
| `search_tokens` | Yes | Find a token address and decimals by symbol, name or address. | `direction` |
| `get_quote` | Yes | Estimate a swap. | `fromChainId`, `fromToken`, `toChainId`, `toToken`, `amount` |
| `create_swap` | No | Create a durable order that spends `amount` of fromToken. | `fromChainId`, `fromToken`, `toChainId`, `toToken`, `amount`, `toAddress` |
| `get_swap` | Yes | Current status and customerState of an order. | `orderId`, `sessionId` |
| `set_refund_address` | No | Only when get_swap shows customerState { kind: "action_required", action: "refund_address" }. | `orderId`, `sessionId`, `refundAddress` |

_Live from `tools/list` on `https://mcp.wagyu.xyz`, read when this page was built (4 Nov 2026, 08:24 UTC)._

On connection the server also sends the agent these instructions:

<!-- Server instructions (sent on initialize) -->
```text
Wagyu swaps any supported asset (including Monero) across chains. Flow:
1. list_chains, then search_tokens to find the exact token address on each chain.
2. get_quote to show the user what they would receive. Amounts are human decimals ("0.5"), never atomic units.
3. create_swap only after the user confirms. It returns a deposit address and exact amount; no money moves until
   that deposit is sent from a wallet the user controls. Never call create_swap again after a timeout or error
   without asking the user: a second call creates a second order.
4. Keep the returned sessionId private: it is the only credential for get_swap and set_refund_address.
5. Poll get_swap (every 30 s or slower) until status is completed, failed, expired or refunded.
customerState is the only authority for what the user must do next. Branch on error "code", never on prose.
```

## Amounts are human decimals here

Unlike the HTTP API, the tools take amounts as **human decimals** such as `"0.5"`, never atomic units. The server converts them with the catalog's decimals and refuses an amount with more decimal places than the token supports. Quote results add `fromAmountDecimal` and `toAmountDecimal` next to the atomic amounts.

> **Pass token addresses, not "native":** The tool descriptions say a chain's native coin can be passed as `"native"`. On the live server this fails for Ethereum ("Token native is not listed on chain 1"). Pass the token value from `search_tokens` or `list_chains` instead: for example `0x0000000000000000000000000000000000000000` for ETH and `XMR` for Monero.

`search_tokens` needs a `direction` (`from` for tokens you send, `to` for tokens you receive).

## Funds stay with the user's wallet

The server never holds keys or moves funds. `create_swap` returns a funding instruction: the deposit address, the exact amount and the deadline. The agent sends it with its own wallet tool or shows it to the user. Nothing moves until that deposit arrives.

## Rules the agent must follow

These are the same rules as the HTTP API.

- **Confirm with the user before `create_swap`.** Never call it again after a timeout or an error: a second call creates a second order.
- **Keep `sessionId` private.** It is the only credential for `get_swap` and `set_refund_address`.
- **Poll `get_swap` every 30 seconds or slower** until the status is `completed`, `failed`, `expired` or `refunded`.
- **Let `customerState` decide** what the user must do next.
- **Branch on the error `code`**, never on its wording. A failed tool call returns the API error, for example `{"status":404,"code":"not_found","error":"Not found."}`.

## Earn fees through the MCP server

Orders placed through the server are attributed to Wagyu's own MCP integration. If you embed the server in your own product, send your [integrator key](https://docs.wagyu.xyz/authentication.md) as an HTTP header on the MCP connection:

```http
x-integrator-key: wg_YOUR_KEY
```

Your orders are then attributed to you and earn your fee. An invalid key is refused with `401` before any tool runs (checked live).

---
Source: https://docs.wagyu.xyz/mcp · Built from the live Wagyu API on 2026-11-04.
