Skip to content

MCP_Server_Zed

Elnaril edited this page Nov 3, 2026 · 1 revision

How to install and configure the SDK MCP server in Zed ?

The SDK comes with an optional MCP server, ur-mcp, which exposes the codec to AI agents (like the Zed agent) over stdio. It is side-effect free: its tools only inspect or derive Universal Router data, they never sign or broadcast a transaction.

Installation

The MCP server is an optional extra of the SDK:

pip install 'uniswap-universal-router-decoder[mcp]'

This installs the ur-mcp command in your environment. The quotes around the package name are needed for your shell to not interpret the brackets.

Configuration in Zed

Zed reads its MCP servers from the context_servers section of its settings file. Open it with the zed: open settings file action (or from Settings → AI → MCP Servers), and add the following entry:

{
  "context_servers": {
    "uniswap-universal-router-decoder": {
      "command": "ur-mcp",
      "env": {
        "RPC_URL": "https://..."
      }
    }
  }
}

A few notes:

  • command can be ur-mcp if it is on your PATH, or the absolute path to ur-mcp in your virtual environment (ex: /path/to/venv/bin/ur-mcp).
  • RPC_URL is optional: only the decode_transaction tool needs it. It can also be provided as ETH_RPC_URL, or per call through the rpc_url tool argument.

Without installing the SDK

If you don't want to install the SDK in your environment, you can let uv run the server on the fly:

{
  "context_servers": {
    "uniswap-universal-router-decoder": {
      "command": "uvx",
      "args": ["--from", "uniswap-universal-router-decoder[mcp]", "ur-mcp"],
      "env": {
        "RPC_URL": "https://..."
      }
    }
  }
}

Check that it works

Open Settings → AI → MCP Servers and look at the indicator dot next to the server name: green means it is running properly.

Available tools

The server provides eight tools:

  • list_commands / describe_command: discover the decoded call format and the commands
  • decode_transaction: fetch and decode a transaction sent to the UR (needs an RPC endpoint)
  • decode_calldata, encode_calldata, decode_error, decode_v3_path, encode_v3_path: decode or encode data without an RPC endpoint

encode_calldata is the mirror of decode_calldata: it rebuilds the calldata from a decoded call, so an agent can decode a route, edit it and re-encode it.

The tools are annotated as read-only, so Zed can auto-approve them i/o prompting on every call.

Ending words

And that's it! Your Zed agent can now decode and encode Universal Router data for you.

See also How to get started with the Python Uniswap Universal Router SDK ? for the Python API.

Clone this wiki locally