Skip to main content
Glama

Relay MCP Server

A Model Context Protocol server for Relay Protocol — cross-chain bridge and swap tools for AI agents.

Install with Cursor

Tools (16)

Quoting & Routing

Tool

Description

get_bridge_quote

Quote for bridging same token across chains

get_swap_quote

Quote for swapping between different tokens (same-chain or cross-chain)

estimate_fees

Fee breakdown for a bridge or swap route

Token & Chain Discovery

Tool

Description

get_supported_chains

List supported blockchain networks (slim response)

get_supported_tokens

Search for tokens across chains

get_trending_tokens

Currently trending tokens across Relay-supported chains

get_token_price

Current USD price of a token

get_token_details

Full token fundamentals: price, market cap, volume, liquidity, optional price chart

get_swap_sources

List DEX aggregators and AMMs that Relay routes through

Chain Health

Tool

Description

check_chain_status

Chain health, solver liquidity, and route configuration (3 API calls in 1 tool)

Transaction Tracking

Tool

Description

get_transaction_status

Check status by request ID or on-chain tx hash

get_transaction_history

Past transactions for a wallet

index_transaction

Tell Relay to index a transaction it may have missed

Integrator Tools

Tool

Description

get_app_fees

Claimable app fee balances and claim history (2 API calls in 1 tool)

get_relay_app_url

Deep link to the Relay web app with pre-filled parameters

get_api_schema

Discover Relay API endpoints and inspect their schemas

Related MCP server: Hyperlane MCP Server

Usage

Claude Desktop / Claude Code

Add to your claude_desktop_config.json or .claude.json:

{
  "mcpServers": {
    "relay": {
      "command": "npx",
      "args": ["-y", "@relayprotocol/relay-mcp"]
    }
  }
}

Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "relay": {
      "command": "npx",
      "args": ["-y", "@relayprotocol/relay-mcp"]
    }
  }
}

Run from source

npm install
npm run build
npm start

Environment variables

Variable

Default

Description

RELAY_API_URL

https://api.relay.link

Relay API base URL

RELAY_API_KEY

—

API key. Required by get_transaction_history (GET /requests/v3); optional elsewhere for higher rate limits

MCP_TOKEN_SECRET

random per process

HTTP mode only. Signs OAuth tokens; set it so tokens stay valid across restarts

Features

  • Chain name resolution — Pass "base", "ethereum", "arb" instead of numeric chain IDs. Supports aliases and fuzzy matching.

  • Input validation — Addresses, amounts, and chain IDs are validated before hitting the API, with clear error messages.

  • Bundled tools — check_chain_status and get_app_fees combine multiple API calls into single tools with parallel fetching.

  • Decision-tree descriptions — Tool descriptions guide agents to pick the right tool ("For just the price, use get_token_price. For full fundamentals, use get_token_details.").

  • Slim responses — Responses are trimmed to essential fields. Chart data is downsampled from ~21KB to ~3KB.

  • API schema discovery — get_api_schema lets agents explore available endpoints on demand (progressive disclosure pattern).

  • Tx hash lookup — get_transaction_status accepts either a request ID or an on-chain transaction hash.

  • Structured errors — Errors are categorized (validation, api, network, rate_limit, server, auth) with retryability hints.

Architecture

  • Transport: Stdio (MCP spec)

  • Runtime: Node.js >=20

  • API: Direct HTTP calls to api.relay.link (no SDK dependency)

  • Read-only: Returns quotes, fees, and status. Does not sign or broadcast transactions.

Agent flow examples

User: "Bridge 0.1 ETH from Ethereum to Base"

1. Agent calls get_bridge_quote(originChainId="ethereum", destinationChainId="base", ...)
   → chain names resolved automatically, quote returned with fees and ETA
2. Agent shows user the quote and a link to execute on relay.link
User: "What tokens are trending on Base?"

1. Agent calls get_trending_tokens(chainId="base")
   → returns token identities (no prices)
2. Agent calls get_token_price for each interesting token
   → returns current USD prices

License

MIT

Available Tools

10 tools
estimate_feesA

Estimate the fees for a bridge or swap without committing to execution. Returns a breakdown of gas fees, relayer fees, and total cost impact. Useful for comparing routes or showing users expected costs.

Inputs: originChainId (required), destinationChainId (required), originCurrency (required), destinationCurrency (required), +2 more.

execute_bridgeA

Get a quote and unsigned transactions for a bridge or swap via Relay. Returns ALL steps required to complete the transfer.

For ERC-20 tokens (like USDC), there are typically TWO steps:

  1. approve — An ERC-20 approval transaction allowing Relay to spend the token.

  2. deposit — The actual bridge/swap transaction.

For native tokens (ETH), there is usually just ONE step:

  1. deposit — The bridge/swap transaction.

Some routes may also include a "signature" step (EIP-712 signing instead of a transaction).

Each step has a "kind" field:

  • "transaction" → must be signed and broadcast via eth_sendTransaction

  • "signature" → must be signed via eth_signTypedData_v4, then POSTed to the Relay API

After calling this tool, pass ALL the returned steps to the wallet tool with action "execute" to sign and submit them in order. The wallet tool handles the full multi-step flow automatically.

If a wallet is connected via the wallet tool, the sender defaults to the connected address. Returns a requestId for tracking status via get_transaction_status.

Inputs: originChainId (required), destinationChainId (required), originCurrency (required), destinationCurrency (required), +3 more.

get_bridge_quoteA

Get a quote for bridging the same token from one chain to another (e.g. ETH on Ethereum → ETH on Base). Returns estimated output amount, fees breakdown, and time estimate. Use get_swap_quote instead if you want to change the token type.

Inputs: originChainId (required), destinationChainId (required), currency (required), amount (required), +2 more.

get_relay_app_urlA

Generate a deep link to the Relay web app with pre-filled bridge/swap parameters. The user can open this URL in their browser to START a new transaction via the Relay UI. This is NOT a transaction tracking URL — do NOT use it to check on an in-progress transaction. For tracking, use get_transaction_status with the requestId.

Inputs: destinationChainId (required), fromChainId, fromCurrency, toCurrency, +3 more.

get_supported_chainsA

List all blockchain networks supported by Relay for bridging and swapping. Returns chain IDs, names, native currencies, and status. Use this to resolve chain names to chain IDs before calling other tools.

Inputs: vmType.

get_supported_tokensA

Search for tokens supported by Relay across chains. Use this to find token contract addresses before getting quotes. Returns token symbol, name, address, and chain availability.

Inputs: chainIds, term, verified, limit.

get_swap_quoteA

Get a quote for swapping between different tokens, optionally across chains (e.g. ETH on Ethereum → USDC on Base, or USDC → WETH on the same chain). Returns estimated output amount, fees, and time estimate.

Inputs: originChainId (required), destinationChainId (required), originCurrency (required), destinationCurrency (required), +3 more.

get_transaction_historyA

Get past Relay bridge and swap transactions for a wallet address. Returns transaction IDs, statuses, chains, and timestamps. Supports pagination via cursor.

Inputs: user (required), limit, cursor.

get_transaction_statusA

Check the status of a Relay bridge or swap transaction. Use the requestId returned from execute_bridge.

Statuses: waiting — The origin chain transaction has been broadcast but not yet confirmed on-chain. Just wait — no further action needed. pending — The relay network has picked up the request and is processing the cross-chain transfer. success — Complete. Funds have arrived on the destination chain. failure — The transaction failed. refund — The transaction was refunded to the sender.

IMPORTANT: After the wallet "execute" action completes all steps (approval + deposit), Relay handles the cross-chain delivery automatically. Poll every 5-10 seconds until success or failure. The user does NOT need to do anything else after execution completes — just wait.

Inputs: requestId (required).

walletA

Connect a user's wallet via WalletConnect. The user scans a QR code with their mobile wallet (MetaMask, Rainbow, etc.) to approve transactions — private keys never leave their device.

Actions: pair — Returns a WalletConnect URI. You MUST then display it as a QR code (see below), then IMMEDIATELY call status to wait for connection. status — Waits up to 60s for the wallet to connect. Blocks until connected or timeout. Call this right after rendering the QR. execute — Execute ALL steps from execute_bridge in order. Handles multi-step flows (approval + deposit) and both transaction and signature steps automatically. disconnect — End the wallet session.

IMPORTANT: After calling pair, you must:

  1. Render the returned URI as a QR code using the bash command below.

  2. Immediately call wallet with action 'status' — it will block until the user scans and connects (up to 60s).

Run this bash command to render the QR as an image, substituting the URI:

python3 -c " import qrcode, tempfile, os qr = qrcode.QRCode(border=3, box_size=10, error_correction=qrcode.constants.ERROR_CORRECT_L) qr.add_data('WALLETCONNECT_URI_HERE') qr.make() img = qr.make_image(fill_color='black', back_color='white') p = os.path.join(tempfile.gettempdir(), 'relay-wc-qr.png') img.save(p) os.system(f'open {p}') print(f'QR code opened: {p}') "

If python3 qrcode is not installed, run: pip3 install "qrcode[pil]"

Typical flow: pair → render QR via bash → (user scans) → status → execute_bridge → execute → get_transaction_status

Inputs: action (required), chainIds, steps.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool has a distinct purpose with clear boundaries. For example, estimate_fees is for cost estimation only, execute_bridge handles transaction preparation, get_bridge_quote and get_swap_quote are for different quote types, and wallet manages wallet connections and execution. No tools appear to overlap or cause confusion.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case, such as estimate_fees, execute_bridge, get_transaction_status, and wallet. The naming is predictable and uniform across all 10 tools, making them easy to identify and use.

    Tool Count5/5

    With 10 tools, the server is well-scoped for its purpose of handling cross-chain bridges and swaps. Each tool serves a specific role in the workflow, from setup (get_supported_chains, get_supported_tokens) to execution (execute_bridge, wallet) and monitoring (get_transaction_status, get_transaction_history), with no redundant or missing tools.

    Completeness5/5

    The toolset provides complete coverage for the domain of cross-chain transactions. It includes setup tools for chains and tokens, quote and fee estimation tools, execution and wallet management tools, and monitoring tools for status and history. There are no obvious gaps, and the tools support the full lifecycle from preparation to completion.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to perform cross-chain bridging operations using natural language intents, with support for multiple protocols (Across, Stargate) and advanced security features like oracle validation and slippage protection. Provides comprehensive bridging tools including quote estimation, transaction building, and approval management across Arbitrum and Ethereum networks.
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Enables LLM assistants to interact with the Hyperlane cross-chain protocol for deploying blockchain infrastructure, sending cross-chain messages, managing validators and relayers, and facilitating asset transfers between multiple blockchains.
      6
      7
      MIT
    • A
      license
      A
      quality
      F
      maintenance
      Enables cross-chain bridging, multi-chain token swaps, and real-time pricing across over 50 blockchain networks using the Relay Protocol REST API. It allows users to browse thousands of tokens, generate quotes, and monitor transaction status directly through natural language.
      9
      1
      MIT