Skip to content

MCP_Server_Claude_Code_Desktop

Elnaril edited this page Nov 9, 2026 · 1 revision

How to install and configure the SDK MCP server in Claude Code and Claude Desktop ?

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

Claude Code and Claude Desktop both configure their MCP servers with the same mcpServers JSON block, so the same entry works for both.

With or without installing the SDK

You can run the server in two ways:

  • With the SDK installed: install the optional mcp extra, then use the ur-mcp command.
pip install 'uniswap-universal-router-decoder[mcp]'

The quotes around the package name are needed for your shell to not interpret the brackets.

  • Without installing anything: let uv run the server on the fly with uvx.

The two only differ by the command and args of the server entry:

command args
With the SDK installed ur-mcp none
Without installing uvx ["--from", "uniswap-universal-router-decoder[mcp]", "ur-mcp"]

The rest of this recipe shows both for each client.

Configuration in Claude Code

Claude Code adds MCP servers with the claude mcp add command. The -- separates Claude Code's own options from the command that runs the server.

With the SDK installed:

claude mcp add --scope user uniswap-universal-router-decoder -- ur-mcp

Without installing it:

claude mcp add --scope user uniswap-universal-router-decoder -- uvx --from 'uniswap-universal-router-decoder[mcp]' ur-mcp

A few notes:

  • --scope user makes the server available in all your projects. Use --scope project to share it with your team through a .mcp.json file, or omit it for the default local scope (current project only).
  • The RPC_URL environment variable is optional: only the decode_transaction tool needs it. Add it with --env RPC_URL=https://..., but place another option such as --transport stdio between --env and the server name, otherwise Claude Code reads the name as another KEY=value pair.

Configuration file

Claude Code also reads the same mcpServers block from a .mcp.json file at the root of your project (project scope):

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

Configuration in Claude Desktop

Claude Desktop reads its MCP servers from claude_desktop_config.json. Open it from Settings → Developer → Edit Config, and add the entry.

With the SDK installed:

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

Without installing it:

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

The file is located at:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Restart Claude Desktop after saving.

Check that it works

  • Claude Code: run claude mcp list, or /mcp from within a session.
  • Claude Desktop: open the connectors list (the "Add files, connectors, and more" indicator) and check that the server appears.

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 the client can auto-approve them i/o prompting on every call.

Ending words

And that's it! Your Claude Code and Claude Desktop agents can now decode and encode Universal Router data for you.

See also How to install and configure the SDK MCP server in Zed ? and in VS Code ?.

Clone this wiki locally