|
| 1 | +--- |
| 2 | +name: 1inch-mcp-server |
| 3 | +description: >- |
| 4 | + Connect to the 1inch MCP server for documentation search, SDK examples, token swaps, |
| 5 | + limit orders, authenticated product API access, and (when registered) org-scoped log lookup. Use when the user asks about 1inch integration, |
| 6 | + DeFi swaps, classic or Fusion or cross-chain flows, orderbook, portfolio, gas or spot price APIs, API keys, MCP or IDE setup, or blockchain development with 1inch. |
| 7 | +license: MIT |
| 8 | +compatibility: Requires an MCP-capable client with HTTP transport (preferred) or stdio plus Node.js 18+ for supergateway bridging. |
| 9 | +metadata: |
| 10 | + mcp_url_production: https://api.1inch.com/mcp/protocol |
| 11 | + documentation: https://business.1inch.com/portal/documentation/ai-integration/ecosystem |
| 12 | +--- |
| 13 | + |
| 14 | +# 1inch MCP Server |
| 15 | + |
| 16 | +This skill teaches agents how to wire and use the **1inch MCP server** so users get docs, examples, and (with auth) swaps and APIs without re-explaining setup each session. |
| 17 | + |
| 18 | +## When to use this skill |
| 19 | + |
| 20 | +Load this skill whenever the user’s goal depends on the **1inch MCP server** (tools, URL, or auth) or on **1inch Business** product APIs from an AI-assisted workflow. |
| 21 | + |
| 22 | +**Documentation and discovery** (`search`) |
| 23 | + |
| 24 | +- Explain or find behavior in 1inch docs: APIs, slippage, supported chains, rate limits, error codes, SDK usage. |
| 25 | +- Compare approaches (e.g. classic vs Fusion vs cross-chain) or look up parameters before coding. |
| 26 | + |
| 27 | +**SDK examples** (`list_examples`, `get_example`) |
| 28 | + |
| 29 | +- Show runnable example code: swap flows, limit orders, chain-specific snippets. |
| 30 | +- Pull source from a named example package for copy-paste or review. |
| 31 | + |
| 32 | +**MCP resources** (server `resources` / `read`, if the client lists them) |
| 33 | + |
| 34 | +- Use bundled guides: **swap workflow**, **classic / Fusion / cross-chain** swap guides, **quote** guide, **orderbook workflow**, and the **API index**; plus **SDK examples** as a resource—when the user wants a single structured document instead of or alongside `search`. |
| 35 | + |
| 36 | +**Swaps and routing** (`swap` — requires auth) |
| 37 | + |
| 38 | +- The tool does the heavy work server-side: routing, quotes, and assembling **ready-to-use** data (e.g. unsigned transaction parameters, typed data, or follow-up steps for Fusion/cross-chain). The user or wallet only **signs** and **submits** what the tool returns—no hand-built calldata in the client for normal flows. Supports **classic**, **Fusion (intent)**, and **cross-chain**; `quoteOnly` for inspection without execution. |
| 39 | + |
| 40 | +**Limit orders** (`orderbook` — requires auth) |
| 41 | + |
| 42 | +- Same idea: `build` runs server-side order construction; the response is **EIP-712 (or similar) data ready to sign**—then `create` with the signature, or `list` / `cancel` for lifecycle. The tool carries the orderbook API complexity; the user supplies signing and on-chain follow-through. |
| 43 | + |
| 44 | +**Other product HTTP APIs** (`product_api` — requires auth) |
| 45 | + |
| 46 | +- Call 1inch product endpoints exposed via the gateway: e.g. **portfolio**, **spot price**, **gas price**, **token** metadata, and other [documented](https://business.1inch.com/portal/llms.txt) paths—without re-inventing base URLs and auth for each call. |
| 47 | + |
| 48 | +**Operations and support** (`debug` — requires auth, **optional** tool) |
| 49 | + |
| 50 | +- Look up **organization-scoped** application logs (e.g. by `x-request-id` or time window) when the server exposes this tool and the user is debugging production or API behavior for their org. |
| 51 | + |
| 52 | +**Client setup and configuration** |
| 53 | + |
| 54 | +- Wire **MCP in Cursor, VS Code, Claude Desktop, Claude Code, Codex, Gemini CLI**, or other HTTP/stdio clients; set **`https://api.1inch.com/mcp/protocol`**, headers, or supergateway. |
| 55 | +- Use **API keys**, **OAuth**, or understand **which tools are public vs authenticated**. |
| 56 | + |
| 57 | +**General triggers** |
| 58 | + |
| 59 | +- “Connect 1inch to my IDE / agent / MCP” or “how do I authenticate for 1inch MCP.” |
| 60 | +- Building or integrating a **dapp, bot, or backend** that uses 1inch Business APIs with AI help. |
| 61 | + |
| 62 | +If the question is only **unrelated off-chain** topics with no 1inch API or MCP angle, you do not need this skill. |
| 63 | + |
| 64 | +## Server URL (production) |
| 65 | + |
| 66 | +`https://api.1inch.com/mcp/protocol` (Streamable HTTP) |
| 67 | + |
| 68 | +## Client setup (summary) |
| 69 | + |
| 70 | +| Client | Transport | Config pattern | |
| 71 | +| -------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------- | |
| 72 | +| Cursor | HTTP | `.cursor/mcp.json` -> `"url": "https://api.1inch.com/mcp/protocol"` | |
| 73 | +| VS Code Copilot | HTTP | `.vscode/mcp.json` -> `type: "http"`, same URL | |
| 74 | +| Claude Code / Codex / Gemini CLI | HTTP | CLI `mcp add` with `--transport http` and the URL | |
| 75 | +| Claude Desktop | stdio | Launch `npx -y supergateway --streamableHttp <URL> --outputTransport stdio` (see [references/AUTH.md](references/AUTH.md)) | |
| 76 | + |
| 77 | +Prefer **HTTP** when the client supports it; use **supergateway** only for stdio-only clients. |
| 78 | + |
| 79 | +## Tools overview |
| 80 | + |
| 81 | +| Tool | Auth | Purpose | |
| 82 | +| --------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------ | |
| 83 | +| `search` | Public | Search 1inch docs and API reference | |
| 84 | +| `list_examples` | Public | List SDK example packages | |
| 85 | +| `get_example` | Public | Fetch example source files | |
| 86 | +| `swap` | Authenticated | Quotes and swap execution flows | |
| 87 | +| `orderbook` | Authenticated | Build/create/list/cancel limit orders | |
| 88 | +| `product_api` | Authenticated | Call other 1inch product APIs | |
| 89 | +| `debug` | Authenticated | Organization-scoped request log lookup (Grafana Loki) — **optional**; only appears in `tools/list` when the deployment registers it. | |
| 90 | + |
| 91 | +Full parameters: [references/TOOLS.md](references/TOOLS.md). |
| 92 | + |
| 93 | +## Authentication |
| 94 | + |
| 95 | +- **API key:** `Authorization: Bearer <key>` on the HTTP transport where the client allows headers. |
| 96 | +- **OAuth:** Supported by the server for interactive login when no API key is set. |
| 97 | + |
| 98 | +Details and client-specific snippets: [references/AUTH.md](references/AUTH.md). |
| 99 | + |
| 100 | +## Example prompts (for the user) |
| 101 | + |
| 102 | +- "Search 1inch docs for how to set slippage on Base." |
| 103 | +- "Show the TypeScript swap example for Fusion on Ethereum." |
| 104 | +- "Quote swapping 100 USDC to ETH on Arbitrum" (requires auth for execution tools). |
| 105 | +- "List my open limit orders on Ethereum" / "Build a limit order to sell 1 WETH for USDC" (auth). |
| 106 | +- "What's my portfolio value on Arbitrum?" or "Fetch spot price for this token" via `product_api` (auth). |
| 107 | +- "Find logs for request id … in the last hour" when `debug` is available (auth). |
| 108 | + |
| 109 | +## Progressive disclosure |
| 110 | + |
| 111 | +- Load [references/TOOLS.md](references/TOOLS.md) when you need exact tool arguments or edge cases. |
| 112 | +- Load [references/AUTH.md](references/AUTH.md) when configuring headers, OAuth, or Claude Desktop bridging. |
| 113 | + |
| 114 | +## Legal |
| 115 | + |
| 116 | +Use of the MCP server is subject to 1inch Business Portal terms linked from the [product documentation](https://business.1inch.com/portal/documentation/ai-integration/mcp-server). |
0 commit comments