Skip to content
Skillpedia
● Free and open sourceπŸ’» LocalπŸ”“ No API keyFinance

Uniswap Universal Router Decoder

Lets your AI agent decode and encode Uniswap Universal Router calldata for V2, V3 and V4 without signing or sending anything.

277 stars on GitHubby ElnarilLicense MITUpdated 20 days ago

How to install

This MCP is local: it runs on your computer.

It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Code…). Choose your app:

Paste in the terminal:

claude mcp add uniswap-universal-router-decoder -- uvx --from "uniswap-universal-router-decoder[mcp]" ur-mcp uniswap-universal-router-decoder

What to fill in

NameWhat it isRequired
RPC_URLEthereum RPC endpoint. Optional: only decode_transaction needs it.No

Ready! Now test it

Restart the app and paste one of these requests in the chat:

Decode this Universal Router calldata and explain each command.
List the commands the router supports and describe V3_SWAP_EXACT_IN.

What it is

This server turns raw Uniswap Universal Router transaction data into readable form and back again. It is read-only: it never signs or sends transactions. It comes from a Python library for developers who know web3.py.

What it can do

  • Decode Universal Router calldata
  • encode_calldata: rebuild calldata from a decoded call
  • list_commands: list supported router commands
  • describe_command: describe a command and its parameters
  • encode_v3_path: encode a V3 swap path

When to use

  • β€ΊWhen you want to understand what a Uniswap transaction does before approving it
  • β€ΊWhen you need to rebuild calldata from a decoded call
  • β€ΊWhen you are debugging a swap that uses V2, V3 or V4 commands

What you need

Python and pip. Install uniswap-universal-router-decoder with the mcp extra, which provides the ur-mcp server. No account is needed.

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

Frequently asked questions

Can it move my funds?

No. The registry description says it is read-only and never signs or sends, and the MCP tools are annotated as read-only.

Which Uniswap versions are supported?

V2, V3 and V4 commands through the Universal Router, with a version mapping table in the readme.

Is it free?

It is a Python package on PyPI under an open license shown in the readme badges.

Are all commands rebuildable?

No. V4_SWAP, V4_POSITION_MANAGER_CALL and EXECUTE_SUB_PLAN can be decoded but not rebuilt from a decoded call.

Is there a command line?

Yes. The ur-decode and ur-encode tools print JSON and can be used in scripts.

Do I need an RPC endpoint?

Only for functions that make RPC calls. Plain decoding works without one.

If it does not work

  • β€ΊInstall with the mcp extra so the ur-mcp command exists.
  • β€ΊUse a Python virtual environment and update pip if installation fails.
  • β€ΊRun ur-encode list and look for the rebuildable flag to see which commands can be re-encoded.

5 new skills a week. 1 minute to read.