uniswap-tx-builder
The uniswap-tx-builder server builds unsigned Uniswap v3 transactions and provides read-only utilities — it never holds private keys or signs, returning raw calldata (plus unsigned EIP-1559 RLP) for you to sign and broadcast with your own wallet.
Transaction Building Tools:
build_collect— Collect all uncollected fees from a Uniswap v3 positionbuild_close— Remove all liquidity and collect fees; optionally burn the empty NFT in the same multicallbuild_mint— Mint a new Uniswap v3 liquidity position given raw ticks and wei amountsbuild_increase— Add liquidity to an existing Uniswap v3 positionbuild_approve— Create an ERC-20approvetransaction (e.g., for the NonfungiblePositionManager or Permit2)build_wrap— Wrap native ETH into WETH via the Universal Routerbuild_swap— Exact-in single-hop swap via the Universal Router, with optional ETH wrap/unwrap and Permit2 payment paths
Read-Only / Planning Tools:
get_swap_quote— Live quote for an exact-in single-hop swap via Uniswap v3 QuoterV2, includingamountOutMinplan_position— Convert a human-readable price range and token amounts into aligned ticks and wei amounts ready forbuild_mintget_pool_state— Fetch live pool state (tick, price, spacing); optionally suggest a tick range and compute desired amounts from wallet balancesget_positions— List all Uniswap v3 position NFTs held by a wallet, including tokens, fees, and liquidity
Key Characteristics:
Keyless: never holds or signs keys; only builds calldata and reads public RPCs
Optional simulation: most tools support an
eth_calldry-run (simulateflag orsenderparameter); a reverted simulation returns an error before you signOffline encoding: calldata is built without network access; RPC is only needed for on-chain reads and simulations
Multi-chain: supports Ethereum, Optimism, Polygon, Base, and Arbitrum (configurable via env vars)
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@uniswap-tx-builderBuild a mint for 0.2 ETH and 500 USDC on Ethereum mainnet."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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."
Ecosystem
Part of Yummybait:
cdp-wallet-agent-example— a reference agent that drives this MCP with a Coinbase CDP wallet as the signer.yummybait.finance — the product these tools power.
Related MCP server: MCP Wallet Signer
Tools
Every build tool returns tx = { to, data, value, chainId } plus rlp — the unsigned
EIP-1559 (type-2) serialization of tx with nonce/fees/gas zeroed (signing services like the
CDP API populate them; serialize tx yourself if you manage nonces) — and a human description.
value is "0" except the payable Universal Router wrap/swap builds. Addresses are 0x…40;
positionId and amounts are decimal strings (they exceed JS safe integers).
Tool | Purpose | Needs RPC? |
| Collect all uncollected fees from a position to | Only for the dry-run (on by default; |
| Remove all liquidity + collect; | Always — reads the position first |
| Mint a new position (raw ticks + wei amounts). | Only with |
| Add liquidity to an existing position. | Only with |
| Build an ERC-20 | Only with |
| Wrap native ETH → WETH via the Universal Router ( | Only with |
| Exact-in single-hop | Only with |
| Read-only. Quote an exact-in single-hop swap via Uniswap v3 QuoterV2 — the live | Always |
| Read-only. Turn a human price range + human amounts into aligned ticks + wei amounts for | Always |
| Read-only. Live pool state (tick, sqrtPriceX96, human price, spacing); optional ±pct range suggestion (rounded inward) and live-ratio | Always |
| Read-only. List every position NFT a wallet holds (token0/1, fee, tick range, liquidity, tokens owed) via the NFPM's ERC-721 enumeration. | Always |
Encoding itself is offline: build_mint, build_increase, build_wrap, build_swap, and
build_collect (with simulate: false) produce calldata without any network access. Only chain
reads need a reachable RPC endpoint — and public defaults are baked in per chain, so nothing has
to be configured either way (see Configuration to override them).
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); wrap/swap/approve
simulate when you pass sender (the signing wallet). A reverted simulation comes back as an
error — don't sign a tx that failed to simulate. When a dry-run succeeds, the response also
includes simulationResult — the actual decoded return value of the call (e.g.
{amount0, amount1} for build_collect/build_close, {tokenId, liquidity, amount0, amount1}
for build_mint, {approved} for build_approve) rather than just the simulated: true flag.
build_wrap/build_swap go through the Universal Router's execute, which has no return value,
so they only report simulated. See the companion skill for the full argument reference and
position lifecycle.
Install & run
From npm (no clone, stdio transport — what MCP clients spawn):
npx -y @yummybait/uniswap-tx-builder-mcpFrom source:
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 # vitestSet MCP_HTTP_PORT to serve the streamable-HTTP transport instead of stdio (endpoint:
http://<host>:<port>/mcp). HTTP runs stateless — every POST gets a fresh server/transport
pair, so any number of clients can connect and reconnect freely with no session bookkeeping:
MCP_HTTP_PORT=8102 npm run devDocker — 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 # HTTPConnect to an MCP client
Claude Code (stdio via npm):
claude mcp add uniswap-tx-builder -- npx -y @yummybait/uniswap-tx-builder-mcpGeneric client config (Claude Desktop, etc.) — add to the client's mcpServers:
{
"mcpServers": {
"uniswap-tx-builder": {
"command": "npx",
"args": ["-y", "@yummybait/uniswap-tx-builder-mcp"],
"env": { "RPC_ETH": "https://your-eth-rpc" }
}
}
}(For a local build, swap the command for node /abs/path/to/uniswap-tx-builder-mcp/dist/mcp.js.)
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@yummybaitB. npx — copies the skill into a skills dir (no clone needed):
# personal (~/.claude/skills, every project)
npx -p @yummybait/uniswap-tx-builder-mcp uniswap-tx-builder-skill
# or project-scoped (./.claude/skills, checked in with a repo)
npx -p @yummybait/uniswap-tx-builder-mcp uniswap-tx-builder-skill --projectC. Manual copy — straight from a checkout:
cp -r skills/uniswap-tx-builder ~/.claude/skills/ # personal
mkdir -p .claude/skills && cp -r skills/uniswap-tx-builder .claude/skills/ # projectThe agent picks it up by its SKILL.md frontmatter — no restart needed for project skills.
Configuration
Per-chain RPCs default to public endpoints; override with env vars (see src/config.ts):
Chain | ID | RPC env var |
Ethereum | 1 |
|
Optimism | 10 |
|
Polygon | 137 |
|
Base | 8453 |
|
Arbitrum | 42161 |
|
Public RPCs are rate-limited and best-effort — set your own for anything beyond casual use.
Architecture
One code path, transport kept separate so it stays testable and ready for a future v4 tool set:
builder.ts calldata + unsigned-RLP encoding (viem), position/pool reads
ticks.ts pure tick / sqrt-price / liquidity math (no I/O)
operations.ts build + optional eth_call simulate + response shaping
server.ts the MCP tool surface (schemas, registration, logging)
mcp.ts transport bootstrap (stdio / stateless streamable HTTP)CI / releases
GitHub Actions (.github/workflows/):
CI — typecheck + tests + npm-tarball allowlist check on every push to
mainand on PRs.Release — pushing a
v*tag re-runs the tests, bumps the version onmainto match the tag (package.json+.claude-plugin/plugin.json), publishes the npm package (@yummybait/uniswap-tx-builder-mcp) with provenance, and builds + publishes the Docker image to GHCR (ghcr.io/yummybait-fin/uniswap-tx-builder-mcp), tagged with the version (andlatest). The tag is the single version source for both artifacts; the bump lands onmainafter the tag, so the tagged commit keeps its old version.
git tag v0.3.0 && git push origin v0.3.0 # cut a releasenpm supply-chain posture
The npm publish job is locked down; keep these properties when touching it:
Trusted publishing (OIDC) — no long-lived npm token in CI. Configured on npmjs.com under package → Settings → Trusted publisher (GitHub Actions, this repo,
release.yml). TheNPM_TOKENsecret path in the workflow exists only to bootstrap the first release (trusted publishers can't be configured before the package exists) — delete the secret afterwards and set the package's publishing access to "Require two-factor authentication and disallow tokens".Provenance —
publishConfig.provenance: trueattaches a Sigstore attestation linking every published tarball to the exact workflow run and commit. It also makes an accidental localnpm publishfail (no OIDC outside CI). Consumers verify withnpm audit signatures.Gates before publish —
npm audit signatures(registry attestations of the dep tree),npm audit --omit=dev --audit-level=high(no known high/critical vulns in shipped deps), typecheck + full test suite (prepublishOnly), andscripts/verify-tarball.mjs(the tarball must contain exactly the allowlisted files — no secrets, no strays).Hardened job —
npm ci --ignore-scripts(no dependency postinstall runs where publish credentials live), minimal per-job permissions, actions pinned to commit SHAs, Dependabot keeping pins and deps fresh.
Scope
Uniswap v3 NonfungiblePositionManager on the chains above. Calling an unconfigured chain returns
an "Unsupported chain" error. Roadmap: Uniswap v4 as a separate set of tools alongside these.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server for querying Uniswap pools/pairs by token address, delivering clean, structured results for easy integration and analysis.Last updated54MIT
- Alicense-qualityAmaintenanceNon-custodial MCP server that routes blockchain transactions to your browser wallet (MetaMask, Rabby, etc.) for signing — private keys never leave your browser.Last updated2MIT
- AlicenseAqualityAmaintenanceSelf-custodial crypto portfolio and DeFi MCP server. Read balances and positions (Aave, Compound, Morpho, Uniswap V3, Lido, EigenLayer) across Ethereum, Arbitrum, Polygon, and Base, and prepare transactions for approval on a Ledger via WalletConnect.Last updated100744Business Source 1.1
- AlicenseAqualityAmaintenanceSelf-custodial crypto portfolio and DeFi MCP server. Read balances and positions (Aave, Compound, Morpho, Uniswap V3, Lido, EigenLayer) across Ethereum, Arbitrum, Polygon, and Base, and prepare transactions for approval on a Ledger via WalletConnect.Last updated100744Business Source 1.1
Related MCP Connectors
Hive MCP server implementing the EIP-712 over USB/DMK ledger-bridge integration spec…
MCP server connecting AI agents to non-custodial staking data across 130+ networks.
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Yummybait-fin/uniswap-tx-builder-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server