ask-matt
MAmattpocock/skills337k4,978 new stars in the last 7 days
Quote and execute token swaps via the 1inch MCP `swap` tool: Classic (DEX aggregation), Fusion (gasless intent), and Fusion+/cross-chain. Use when the user wants best rate, gasless swap, bridge-less cross-chain, or quote comparison.
Use the authenticated MCP tool swap. Call authenticate first if you are not already a real user (initialize 200 is still anonymous). Do not hand-build calldata for normal flows.
Unless the user explicitly wants to sign with their own tooling (private key, cast, viem), offer WalletConnect before executing: pair via the walletconnect tool (see the 1inch-walletconnect skill), then call swap. With an active session, execute defaults to true — the tool handles approve txs, EIP-712 signing, submission, and native escrow sends through the connected wallet, and the user simply approves each prompt in their wallet app. No key handling, no manual signing steps.
execute: false only when the user wants unsigned calldata / typed data to sign elsewhere.execute: true explicitly to require a wallet session (errors if not connected).preferredType: "classic".preferredType: "fusion".dstChain; preferredType: "crosschain".walletconnect, then call swap with src, dst, amount, chain, from (the connected wallet address). The user approves in their wallet.swap directly. Omit preferredType to let the server recommend, or set it explicitly.quoteOnly: true → compare quotes / recommended → execute with chosen preferredType.signedOrder + orderHash.Load the reference for your flow before signing or broadcasting:
| Flow | Reference | MCP resource fallback |
|---|---|---|
| Quote | references/QUOTE.md | file://1inch-mcp/guides/swap/quote |
| Classic | references/CLASSIC.md | file://1inch-mcp/guides/swap/classic |
| Fusion | references/FUSION.md | file://1inch-mcp/guides/swap/fusion |
| Cross-chain | references/CROSSCHAIN.md | file://1inch-mcp/guides/swap/crosschain |
The references are the primary source (they work in every client). The MCP resource URIs serve the same content live for clients that read resources.
The manual signing snippets in the references (cast / Python / viem) are only needed without a WalletConnect session — with one, the tool executes through the connected wallet automatically.
MAmattpocock/skills337k4,978 new stars in the last 7 days
MAmattpocock/skills337k4,978 new stars in the last 7 days
MAmattpocock/skills337k4,978 new stars in the last 7 days
OBobra/superpowers331k4,772 new stars in the last 7 days
AFaffaan-m/ECC315k4,381 new stars in the last 7 days
AFaffaan-m/ECC315k4,381 new stars in the last 7 days