Uniswap Tx Builder Mcp

io.github.Yummybait-fin由 GitHub 帳號 Yummybait-fin 發布v0.4.3更新於 Oct 24, 2026

Builds and simulates unsigned Uniswap v3 liquidity-position transactions — keyless, never signs.

已驗證STDIO僅桌面金融開發者工具

概覽

AI 產生的概覽

免金鑰的 MCP 伺服器,用來建構未簽署的 Uniswap v3 流動性部位與兌換交易,可選擇以 eth_call 模擬。

可以做什麼
  • 建構 Uniswap v3 部位的未簽署交易:收取手續費、平倉或銷毀、鑄造、增加流動性
  • 建構 ERC-20 授權、原生 ETH 包裝,以及經 Universal Router 的精確輸入單跳兌換
  • 讀取鏈上狀態:兌換報價、池子狀態,以及錢包持有的部位 NFT
  • 把人類可讀的價格區間與數量換算成對齊的 tick 和 wei 數量
  • 可選擇對建構結果做 eth_call 試跑,並回傳解碼後的模擬結果
適用情境
適合讓助理準備 Uniswap v3 部位或兌換的 calldata,再由你自己的錢包簽署並廣播;也適合在操作前查看池子、報價和既有部位。
執行需求
以 stdio 在本機執行,通常透過 npm 套件的 npx 或 Docker 映像啟動。不需要金鑰或帳號。鏈上讀取預設使用公開 RPC 端點,可用 RPC_ETH、RPC_OP、RPC_POLYGON、RPC_BASE 或 RPC_ARB 依鏈覆寫。只有讀取與模擬時需要網路存取。
安裝前請注意
它只回傳 calldata,從不簽署,簽署與廣播由你負責;模擬失敗的交易不要簽署。當 amount 設為 max 時會產生無上限的 ERC-20 授權,兌換或包裝在簽署後會轉移資金。公開 RPC 有速率限制,並會看到你的讀取查詢。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Uniswap Tx Builder Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

uniswap-tx-builder-mcp

[CI] [coverage] [npm version] [node] [license] [OpenSSF Scorecard]

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:

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).

ToolPurposeNeeds RPC?
build_collectCollect all uncollected fees from a position to recipient.Only for the dry-run (on by default; simulate: false builds offline)
build_closeRemove all liquidity + collect; burn: true also burns the empty NFT. Returns the read position.Always — reads the position first
build_mintMint a new position (raw ticks + wei amounts).Only with simulate: true
build_increaseAdd liquidity to an existing position.Only with simulate: true
build_approveBuild an ERC-20 approve(spender, amount) tx — e.g. the NFPM before build_mint/build_increase, or Permit2 before a Permit2-paid build_swap. amount: "max" for an unlimited allowance.Only with sender (enables the dry-run)
build_wrapWrap native ETH → WETH via the Universal Router (WRAP_ETH).Only with sender (enables the dry-run)
build_swapExact-in single-hop tokenIn → tokenOut swap via the Universal Router; with wrapWei (tokenIn = WETH9) it wraps native ETH first and sweeps the remainder, with unwrapOut (tokenOut = WETH9) it unwraps the output to native ETH — in the same tx either way. Pass sender and the default Permit2 payment path auto-detects an insufficient allowance, returning a signed-permit request instead of a tx — no separate on-chain Permit2 approval needed.Only with sender (enables the dry-run)
get_swap_quoteRead-only. Quote an exact-in single-hop swap via Uniswap v3 QuoterV2 — the live amountOut a build_swap with the same params would get, plus amountOutMin (after slippageBps) ready to feed straight into build_swap.Always
plan_positionRead-only. Turn a human price range + human amounts into aligned ticks + wei amounts for build_mint. Reads token decimals over RPC.Always
get_pool_stateRead-only. Live pool state (tick, sqrtPriceX96, human price, spacing); optional ±pct range suggestion (rounded inward) and live-ratio amount0Desired/amount1Desired from wallet balances.Always
get_positionsRead-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):

bash
npx -y @yummybait/uniswap-tx-builder-mcp

From source:

bash
npm installnpm run dev                 # stdio MCP from source via tsxnpm run build && npm start  # compile to dist/, then run the built servernpm test                    # vitest

Set 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:

bash
MCP_HTTP_PORT=8102 npm run dev

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

bash
docker build -t uniswap-tx-builder-mcp:local .                        # local builddocker pull ghcr.io/yummybait-fin/uniswap-tx-builder-mcp:latest       # released image
docker run -i --rm uniswap-tx-builder-mcp:local                       # stdiodocker run --rm -p 8102:8102 -e MCP_HTTP_PORT=8102 uniswap-tx-builder-mcp:local  # HTTP

Connect to an MCP client

Claude Code (stdio via npm):

bash
claude mcp add uniswap-tx-builder -- npx -y @yummybait/uniswap-tx-builder-mcp

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

json
{  "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:

text
/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
# 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 --project

C. Manual copy — straight from a checkout:

bash
cp -r skills/uniswap-tx-builder ~/.claude/skills/                       # personalmkdir -p .claude/skills && cp -r skills/uniswap-tx-builder .claude/skills/  # project

The 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):

ChainIDRPC env var
Ethereum1RPC_ETH
Optimism10RPC_OP
Polygon137RPC_POLYGON
Base8453RPC_BASE
Arbitrum42161RPC_ARB

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 readsticks.ts       pure tick / sqrt-price / liquidity math (no I/O)operations.ts  build + optional eth_call simulate + response shapingserver.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 main and on PRs.
  • Release — pushing a v* tag re-runs the tests, bumps the version on main to 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 (and latest). The tag is the single version source for both artifacts; the bump lands on main after the tag, so the tagged commit keeps its old version.
bash
git tag v0.3.0 && git push origin v0.3.0   # cut a release

npm 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). The NPM_TOKEN secret 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: true attaches a Sigstore attestation linking every published tarball to the exact workflow run and commit. It also makes an accidental local npm publish fail (no OIDC outside CI). Consumers verify with npm 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), and scripts/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.

來源:README.md,提交 2cfdb32

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.4.3最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分