Uniswap Plugin
[!IMPORTANT] Complete the short Base MCP onboarding flow defined inUniswap on Base: token swaps using the proxy-approval flow (no Permit2 signing) and LP position management for V2, V3, and V4. UseSKILL.mdbefore calling any Uniswap endpoint. The user’s wallet address — passed aswalletAddressin every swap and LP call — is fetched lazily when needed.
web_request to fetch unsigned calldata from the Uniswap API, then execute transaction previews with send_calls.
No additional MCP server is required.
Prerequisite: trade-api.gateway.uniswap.org and liquidity.api.uniswap.org must be in the MCP server’s web_request allowlist. If requests are rejected by the allowlist, inform the user.
Chain: Base mainnet (chainId 8453 / 0x2105)
Auth Headers
Use these headers for all requests:/check_approval, /quote, and /swap.
x-permit2-disabled, Uniswap can return Permit2 or Universal Router behavior instead of the proxy-approval flow described here.
Swap Flow: Proxy Approval, No Permit2
Base URL:https://trade-api.gateway.uniswap.org/v1
1. POST /check_approval
Headers: auth headers plus "x-permit2-disabled": "true".
approval can be null, especially for native ETH. If it is non-null, pass it to send_calls. You can batch the approval and swap together after /swap returns.
2. POST /quote
Headers: auth headers plus "x-permit2-disabled": "true".
"slippageTolerance": <0-20> instead of autoSlippage if the user specifies slippage. See Slippage Warnings before submitting elevated values.
Response includes a top-level quote object plus metadata. Keep the response as a flat object for /swap; do not nest it under a quote key.
3. POST /swap
Headers: auth headers plus "x-permit2-disabled": "true".
Use the /quote response as the body, but remove any null or absent permit fields before sending:
signature, and do not send permitData or permitTransaction when they are null.
Response:
Swap send_calls
Approval and swap can be sent separately or batched in one send_calls preview:
Swap Orchestration
LP Flow
Base URL:https://liquidity.api.uniswap.org/lp
Use this host for LP endpoints in this plugin environment. Do not switch to api.uniswap.org or trade-api.gateway.uniswap.org/v1/lp/... unless that host is explicitly available to the API key and MCP allowlist.
Pool Discovery: POST /lp/pool_info
Use pool discovery before creating V3/V4 LP positions. poolReference must be a valid pool address for V3 or pool ID for V4.
fee=3000, tickSpacing=60 pool reference observed in testing:
/lp/pool_info instead of hard-coding a pool reference unless the user explicitly selected a pool.
Approval Step: POST /lp/check_approval
Use this before LP create/increase/decrease operations. The body uses lpTokens as an array of token/amount objects.
action: "CREATE" | "INCREASE" | "DECREASE" | "MIGRATE"
Response:
transactions is empty, no approval transaction is needed. If it has entries, map every transactions[*].transaction to send_calls.
Create V3/V4 Position: POST /lp/create
newPool instead of existingPool when creating a pool:
tickBounds when possible. priceBounds can be accepted by the API, but its price units are easy to misread; validate carefully before using it.
Manage Existing Positions
| Action | Endpoint | Key params |
|---|---|---|
| Add liquidity | POST /lp/increase | walletAddress, chainId, protocol, token0Address, token1Address, nftTokenId, independentToken { tokenAddress, amount } |
| Remove liquidity | POST /lp/decrease | walletAddress, chainId, protocol, token0Address, token1Address, nftTokenId, liquidityPercentageToDecrease (0-100) |
| Collect fees | POST /lp/claim_fees | walletAddress, chainId, protocol, tokenId; optional simulateTransaction |
| Create V2 position | POST /lp/create_classic | walletAddress, poolParameters { token0Address, token1Address, chainId }, independentToken { tokenAddress, amount } |
"slippageTolerance": <decimal> where 0.5 means 0.5%. See Slippage Warnings before submitting elevated values.
Important: LP APIs can return calldata for syntactically valid nftTokenId values even if the connected wallet may not own the position. Treat generated calldata as a transaction preview input, not proof of ownership or guaranteed execution.
Claim Fees: POST /lp/claim_fees
Create V2 Position: POST /lp/create_classic
/lp/check_approval may return multiple approval transactions. Batch all approvals plus the create transaction if you want one send_calls approval link.
LP send_calls
For any LP operation response field such as create, increase, decrease, or claim, map to:
LP Orchestration
Example Prompts
Swap 1 USDC to WETH on Baseget_wallets-> address; use USDC address0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913, amount1000000.web_request POST /check_approvalwithx-permit2-disabled: true.web_request POST /quotewithx-permit2-disabled: true.- Remove null permit fields from quote response.
web_request POST /swapwithx-permit2-disabled: true.send_callsapproval + swap, or swap only if no approval was returned.
get_wallets-> address.web_request POST /lp/pool_infoto find the pool reference.web_request POST /lp/check_approvalusinglpTokensarray.web_request POST /lp/createusingexistingPool.poolReferenceandtickBounds.send_callsapproval transactions plus create transaction.
get_wallets-> address.- Confirm the wallet owns the
nftTokenIdor warn that generated calldata may still fail. web_request POST /lp/check_approvalwith action"INCREASE".web_request POST /lp/increase.send_callsapproval transactions plus increase transaction.
get_wallets-> address.web_request POST /lp/claim_feeswithtokenId.send_callsclaim transaction.
Slippage Warnings
High slippage tolerance exposes the user to worse fills and sandwich/MEV attacks. Before calling/swap or any LP endpoint with an elevated value, warn the user and get explicit confirmation:
| Tolerance | Level | Action |
|---|---|---|
| ≤ 1% | Normal | Proceed. |
| > 1% and ≤ 5% | Elevated | Mention the value and ask the user to confirm. |
| > 5% and ≤ 20% | High | Warn that the trade can fill significantly below quote and is a likely sandwich target. Require explicit confirmation. |
| > 20% | Very high | Strongly warn; do not submit without the user re-confirming the exact number. |
autoSlippage: "DEFAULT" on swaps rather than picking a high number.
Notes
- Native ETH address:
0x0000000000000000000000000000000000000000 - USDC on Base:
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 - WETH on Base:
0x4200000000000000000000000000000000000006 - Token amounts are base units: USDC = 1e6 per token, ETH/WETH = 1e18 per token.
- Use
chain: "base"withsend_calls, not numeric chain id. - For swap proxy approval, include
x-permit2-disabled: trueon/check_approval,/quote, and/swap. - For swap proxy approval, remove null
permitDataandpermitTransactionfields before calling/swap. /quoteresponse fields must be spread directly into/swapbody, not nested under aquotekey.- Do not send
signaturein the proxy swap flow.