Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .agents/.skill-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"version": 3,
"skills": {
"workflow-init": {
"source": "vercel/workflow",
"sourceType": "github",
"sourceUrl": "https://github.com/vercel/workflow.git",
"skillPath": "skills/workflow-init/SKILL.md",
"skillFolderHash": "51e8190b4abf978532dac4e9705225c75652b9b3",
"installedAt": "2026-02-22T13:21:44.400Z",
"updatedAt": "2026-02-24T06:29:38.279Z"
},
"find-skills": {
"source": "vercel-labs/skills",
"sourceType": "github",
"sourceUrl": "https://github.com/vercel-labs/skills.git",
"skillPath": "skills/find-skills/SKILL.md",
"skillFolderHash": "c2f31172b6f256272305a5e6e7228b258446899f",
"installedAt": "2026-02-22T13:21:51.443Z",
"updatedAt": "2026-02-22T13:21:51.443Z"
},
"gemini-api-dev": {
"source": "google-gemini/gemini-skills",
"sourceType": "github",
"sourceUrl": "https://github.com/google-gemini/gemini-skills.git",
"skillPath": "skills/gemini-api-dev/SKILL.md",
"skillFolderHash": "5c9c6bc8cf2ef3e3b11d784a97281d721fdac0ca",
"installedAt": "2026-02-25T04:16:08.363Z",
"updatedAt": "2026-02-25T04:16:08.363Z"
},
"1inch-mcp-server": {
"source": "1inch/1inch-ai",
"sourceType": "github",
"sourceUrl": "https://github.com/1inch/1inch-ai.git",
"skillPath": "skills/1inch-mcp-server/SKILL.md",
"skillFolderHash": "4dc601b333912ea9fbf39ae6a091de5378c38cd2",
"installedAt": "2026-05-13T00:43:47.009Z",
"updatedAt": "2026-05-13T00:43:47.009Z"
},
"appkit": {
"source": "reown-com/skills",
"sourceType": "github",
"sourceUrl": "https://github.com/reown-com/skills.git",
"skillPath": "skills/appkit/SKILL.md",
"skillFolderHash": "69cb3fa2213f1b4f93b9b3e27b4c56052d2825b6",
"installedAt": "2026-05-16T07:40:04.402Z",
"updatedAt": "2026-05-16T07:40:04.402Z"
}
},
"dismissed": {
"findSkillsPrompt": true
},
"lastSelectedAgents": [
"amp",
"antigravity",
"antigravity-cli",
"cline",
"codex",
"cursor",
"deepagents",
"gemini-cli",
"github-copilot",
"kimi-code-cli",
"opencode",
"warp",
"zed",
"claude-code"
]
}
116 changes: 116 additions & 0 deletions .agents/skills/1inch-mcp-server/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
name: 1inch-mcp-server
description: >-
Connect to the 1inch MCP server for documentation search, SDK examples, token swaps,
limit orders, authenticated product API access, and (when registered) org-scoped log lookup. Use when the user asks about 1inch integration,
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.
license: MIT
compatibility: Requires an MCP-capable client with HTTP transport (preferred) or stdio plus Node.js 18+ for supergateway bridging.
metadata:
mcp_url_production: https://api.1inch.com/mcp/protocol
documentation: https://business.1inch.com/portal/documentation/ai-integration/ecosystem
---

# 1inch MCP Server

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.

## When to use this skill

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.

**Documentation and discovery** (`search`)

- Explain or find behavior in 1inch docs: APIs, slippage, supported chains, rate limits, error codes, SDK usage.
- Compare approaches (e.g. classic vs Fusion vs cross-chain) or look up parameters before coding.

**SDK examples** (`list_examples`, `get_example`)

- Show runnable example code: swap flows, limit orders, chain-specific snippets.
- Pull source from a named example package for copy-paste or review.

**MCP resources** (server `resources` / `read`, if the client lists them)

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

**Swaps and routing** (`swap` — requires auth)

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

**Limit orders** (`orderbook` — requires auth)

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

**Other product HTTP APIs** (`product_api` — requires auth)

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

**Operations and support** (`debug` — requires auth, **optional** tool)

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

**Client setup and configuration**

- 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.
- Use **API keys**, **OAuth**, or understand **which tools are public vs authenticated**.

**General triggers**

- “Connect 1inch to my IDE / agent / MCP” or “how do I authenticate for 1inch MCP.”
- Building or integrating a **dapp, bot, or backend** that uses 1inch Business APIs with AI help.

If the question is only **unrelated off-chain** topics with no 1inch API or MCP angle, you do not need this skill.

## Server URL (production)

`https://api.1inch.com/mcp/protocol` (Streamable HTTP)

## Client setup (summary)

| Client | Transport | Config pattern |
| -------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------- |
| Cursor | HTTP | `.cursor/mcp.json` -> `"url": "https://api.1inch.com/mcp/protocol"` |
| VS Code Copilot | HTTP | `.vscode/mcp.json` -> `type: "http"`, same URL |
| Claude Code / Codex / Gemini CLI | HTTP | CLI `mcp add` with `--transport http` and the URL |
| Claude Desktop | stdio | Launch `npx -y supergateway --streamableHttp <URL> --outputTransport stdio` (see [references/AUTH.md](references/AUTH.md)) |

Prefer **HTTP** when the client supports it; use **supergateway** only for stdio-only clients.

## Tools overview

| Tool | Auth | Purpose |
| --------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `search` | Public | Search 1inch docs and API reference |
| `list_examples` | Public | List SDK example packages |
| `get_example` | Public | Fetch example source files |
| `swap` | Authenticated | Quotes and swap execution flows |
| `orderbook` | Authenticated | Build/create/list/cancel limit orders |
| `product_api` | Authenticated | Call other 1inch product APIs |
| `debug` | Authenticated | Organization-scoped request log lookup (Grafana Loki) — **optional**; only appears in `tools/list` when the deployment registers it. |

Full parameters: [references/TOOLS.md](references/TOOLS.md).

## Authentication

- **API key:** `Authorization: Bearer <key>` on the HTTP transport where the client allows headers.
- **OAuth:** Supported by the server for interactive login when no API key is set.

Details and client-specific snippets: [references/AUTH.md](references/AUTH.md).

## Example prompts (for the user)

- "Search 1inch docs for how to set slippage on Base."
- "Show the TypeScript swap example for Fusion on Ethereum."
- "Quote swapping 100 USDC to ETH on Arbitrum" (requires auth for execution tools).
- "List my open limit orders on Ethereum" / "Build a limit order to sell 1 WETH for USDC" (auth).
- "What's my portfolio value on Arbitrum?" or "Fetch spot price for this token" via `product_api` (auth).
- "Find logs for request id … in the last hour" when `debug` is available (auth).

## Progressive disclosure

- Load [references/TOOLS.md](references/TOOLS.md) when you need exact tool arguments or edge cases.
- Load [references/AUTH.md](references/AUTH.md) when configuring headers, OAuth, or Claude Desktop bridging.

## Legal

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).
48 changes: 48 additions & 0 deletions .agents/skills/1inch-mcp-server/references/AUTH.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Authentication -- 1inch MCP

## API key

Obtain a key from the [1inch Business Portal](https://business.1inch.com/portal).

Pass it as:

`Authorization: Bearer <YOUR_API_KEY>`

How you set this depends on the client:

- **Cursor** (`.cursor/mcp.json`): `headers.Authorization`
- **VS Code** (`.vscode/mcp.json`): `headers.Authorization`
- **Claude Code**: `claude mcp add --header "Authorization: Bearer ..."`
- **Claude Desktop** (stdio via supergateway): add `--header` `Authorization: Bearer ...` to the supergateway args **after** `--streamableHttp` and URL (see product docs).

## OAuth

If the user calls an authenticated tool without a key, MCP clients that support OAuth can start a browser login against the 1inch Business Portal. After login, tools work for that session.

Protected tools (including the optional `debug` log lookup) need a **non-anonymous** session: a **Bearer API key** and/or **OAuth** as supported by the gateway, plus (for `debug`) organization context for log scoping. The `debug` tool is only available when the server registers it; see [TOOLS.md](TOOLS.md).

## Stdio bridging (Claude Desktop and similar)

When the client only supports stdio:

```bash
npx -y supergateway \
--streamableHttp https://api.1inch.com/mcp/protocol \
--outputTransport stdio
```

With API key:

```bash
npx -y supergateway \
--streamableHttp https://api.1inch.com/mcp/protocol \
--header "Authorization: Bearer YOUR_API_KEY" \
--outputTransport stdio
```

Use **absolute paths** to `npx` and ensure `PATH` in the MCP server `env` includes your Node binary directory.

## Security

- Never commit API keys to repositories or skills.
- Treat skills that mention keys as **user-supplied configuration**, not embedded secrets.
72 changes: 72 additions & 0 deletions .agents/skills/1inch-mcp-server/references/TOOLS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 1inch MCP tools -- reference

Production endpoint: `https://api.1inch.com/mcp/protocol`.

Tools expose **safety hints** to clients: read-only tools use `readOnlyHint`; tools that can change on-chain or remote state use `destructiveHint`.

## Public tools

### `search`

Search documentation, API references, and SDK guides.

| Parameter | Type | Required | Notes |
| -------------- | ------- | -------- | -------------------------- |
| `query` | string | Yes | Search string |
| `limit` | number | No | 1-100, page size |
| `page` | number | No | 1-based pagination |
| `include_body` | boolean | No | Include full document body |

### `list_examples`

No parameters. Returns available SDK example identifiers.

### `get_example`

| Parameter | Type | Required | Notes |
| --------- | ------ | -------- | ------------------------------------- |
| `name` | string | Yes | Example id from `list_examples` |
| `file` | string | No | Specific file path inside the example |

## Authenticated tools

Require API key or OAuth session. See [AUTH.md](AUTH.md).

### `swap`

Token swaps (classic, Fusion, cross-chain). Supports quote-only mode (`quoteOnly: true`), execution (returns txs or typed data to sign), and submission (`signedOrder` / `orderHash` for Fusion/cross-chain).

Key parameters: `src`, `dst`, `amount`, `chain`, `from`, optional `quoteOnly`, `preferredType`, `dstChain`, `slippage`, `signedOrder`, `orderHash`.

Prefer the product docs for the full parameter matrix and flows.

### `orderbook`

Limit orders via Orderbook API v4.1. **action** is required: `build` | `create` | `list` | `cancel`.

Typical flow: `build` -> user signs typed data -> `create` with signature.

### `product_api`

Proxy to 1inch product REST APIs.

| Parameter | Type | Required | Notes |
| --------- | ----------------- | -------- | ------------------------------------- |
| `method` | `"GET"` or `"POST"` | No | Default `GET` |
| `path` | string | Yes | API path (e.g. portfolio, price, gas) |
| `query` | object | No | Query string map |
| `body` | object | No | JSON body for POST |

Because the tool can perform writes via POST, it is marked **destructive** at the MCP layer even when `method` is GET.

### `debug`

**Optional** — the server only registers this tool when Grafana Loki integration is enabled. It does not appear in `tools/list` otherwise.

Org-scoped production debugging: look up application logs in Loki. Requires the same **authenticated** access as other protected tools (Bearer and/or OAuth per gateway); organization scope comes from the gateway context.

**Modes:** (1) pass `requestId` (e.g. `x-request-id`) with optional `startTime` / `endTime` (defaults: 24h lookback to `endTime` or now). (2) omit `requestId` and pass `startTime` and `endTime` (RFC3339), with optional `logLevel` (`info` | `warn` | `error`) and `limit` (1–100, default 50).

## Machine-readable API index

For discovering `product_api` paths: `https://business.1inch.com/portal/llms.txt`.
Loading