Uniswap Tx Builder

by Yummybait-fin

291 downloads
Not rated
GitHub

About

Keyless MCP server for building unsigned Uniswap v3 liquidity transactions (collect, close, mint)

Details

Author
Yummybait-fin
Downloads
291
Categories
Finance

- CI — typecheck + tests on every push to main and on PRs
- Release — pushing a v* tag re-runs the tests, bumps the version on main to match the tag

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Uniswap Tx Builder
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

The README includes setup instructions such as docker build -t uniswap-tx-builder-mcp:local . # local build.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "uniswap tx builder": {
            "uniswap-tx-builder-mcp": {
                "command": "docker",
                "args": [
                    "build",
                    "-t",
                    "uniswap-tx-builder-mcp:local",
                    ".",
                    "#",
                    "local",
                    "build"
                ]
            }
        }
    }
}

McpServers

{
    "uniswap-tx-builder-mcp": {
        "command": "docker",
        "args": [
            "build",
            "-t",
            "uniswap-tx-builder-mcp:local",
            ".",
            "#",
            "local",
            "build"
        ]
    }
}

uniswap-tx-builder-mcp

A keyless MCP server that builds unsigned Uniswap v3
liquidity-position transactions and optionally simulates them via eth_call. It never holds
keys and never signs
— you take the returned calldata and sign + broadcast it with your own
wallet (viem, a CDP wallet MCP, any signer).

Because it's keyless, the only limits that apply to a built tx are your wallet's — the server's
threat surface is just "it returns calldata and reads public RPCs."

Tools

Every build tool returns tx = { to, data, value, chainId } (value is always "0") plus a
human description. Addresses are 0x…40; positionId and amounts are decimal strings (they
exceed JS safe integers).

| Tool | Purpose |
|------|---------|
| build_collect | Collect all uncollected fees from a position to recipient. |
| build_close | Remove all liquidity + collect; burn: true also burns the empty NFT. Returns the read position. |
| build_mint | Mint a new position (raw ticks + wei amounts). |
| build_increase | Add liquidity to an existing position. |
| plan_position | Read-only. Turn a human price range + human amounts into aligned ticks + wei amounts for build_mint. Reads token decimals over RPC. |

simulate runs an opt-in eth_call dry-run: on by default for collect/close, off for
mint/increase (those need approvals + balances, so the dry-run usually reverts). A reverted
simulation comes back as an error — don't sign a tx that failed to simulate. See the companion
skill for the full argument reference and position lifecycle.

Install & run

npm install
npm run dev                 # stdio MCP from source via tsx
npm run build && npm start  # compile to dist/, then run the built server
npm test                    # vitest

Set MCP_HTTP_PORT to serve the streamable-HTTP transport instead of stdio (endpoint:
http://<host>:<port>/mcp):

MCP_HTTP_PORT=8102 npm run dev

Docker — build locally, or pull a released image from GHCR:

docker build -t uniswap-tx-builder-mcp:local .                        # local build
docker pull ghcr.io/yummybait-fin/uniswap-tx-builder-mcp:latest       # released image

docker run -i --rm uniswap-tx-builder-mcp:local # stdio
docker run --rm -p 8102:8102 -e MCP_HTTP_PORT=8102 uniswap-tx-builder-mcp:local # HTTP

Connect to an MCP client

Claude Code (stdio, from a local build):

npm run build
claude mcp add uniswap-tx-builder -- node /abs/path/to/uniswap-tx-builder-mcp/dist/mcp.js

Generic client config (Claude Desktop, etc.) — add to the client's mcpServers:

{
  "mcpServers": {
    "uniswap-tx-builder": {
      "command": "node",
      "args": ["/abs/path/to/uniswap-tx-builder-mcp/dist/mcp.js"],
      "env": { "RPC_ETH": "https://your-eth-rpc" }
    }
  }
}

For HTTP, run the server with MCP_HTTP_PORT and point the client at http://<host>:<port>/mcp.

Install the companion skill

skills/uniswap-tx-builder/ is a generic agent skill (no app- or wallet-specific knowledge)
that teaches an agent how to drive these tools: the argument reference, simulate-first, the
close→mint rebalance sequence, and the "your wallet signs" handoff. It pairs with the MCP — install
both. Pick whichever install path suits you.

A. Claude Code plugin (/plugin) — the repo doubles as a plugin marketplace:

/plugin marketplace add Yummybait-fin/uniswap-tx-builder-mcp
/plugin install uniswap-tx-builder@yummybait

B. npx — copies the skill into a skills dir (no clone needed):

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.