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
| Name | What it is | Required |
|---|---|---|
RPC_URL | Ethereum 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 calllist_commands: list supported router commandsdescribe_command: describe a command and its parametersencode_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
Skills that pair well
MCP or skill?
The MCP gives the agent the hands. The skill teaches the right way to use them. Together, the result is better and uses fewer tokens.
cc-skill-coding-standardsHelps your agent follow universal coding standards. It understands best practices for TypeScript, JavaScript, React, and Node.js. It's useful for ensuring code quality and consistency.okx-dapp-discoveryHelps your agent find a supported DeFi app by name, such as Aave or Uniswap, and install its plugin after you confirm.universal-scraping-architectHelps your agent build reliable web scraping or document extraction pipelines that check their output before you trust the data.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.