|
| 1 | +--- |
| 2 | +title: ENS Omnigraph MCP (AI agents) |
| 3 | +description: Query the ENS Omnigraph from any MCP client — first-party, built into every ENSNode instance at /api/mcp. |
| 4 | +--- |
| 5 | + |
| 6 | +import { Aside, LinkCard } from "@astrojs/starlight/components"; |
| 7 | +import IntegrateHostedEnsNodeTip from "@components/molecules/IntegrateHostedEnsNodeTip.astro"; |
| 8 | + |
| 9 | +Every ENSNode instance exposes the [ENS Omnigraph API](/docs/integrate/integration-options/omnigraph-graphql-api) over the [Model Context Protocol](https://modelcontextprotocol.io/) at **`/api/mcp`**, using the streamable-HTTP transport. This lets MCP clients — [Cursor](https://www.cursor.com/), [Claude Desktop](https://claude.ai/download), and any agent that speaks MCP — run Omnigraph queries directly. |
| 10 | + |
| 11 | +It's first-party and built in: the same endpoint works locally (`http://localhost:4334/api/mcp`) and against any hosted instance, so there's nothing to install or deploy — point your client at a URL and go. |
| 12 | + |
| 13 | +<IntegrateHostedEnsNodeTip /> |
| 14 | + |
| 15 | +## The tool |
| 16 | + |
| 17 | +The server exposes a single, read-only tool: |
| 18 | + |
| 19 | +- **`omnigraph_query`** — accepts a GraphQL `query` (and optional `variables`) and returns the raw `{ data, errors }` JSON, exactly as the [HTTP endpoint](/docs/integrate/integration-options/omnigraph-graphql-api#1-the-endpoint) does. Because it's the full Omnigraph behind one tool, an agent can answer any question the Omnigraph can — resolve records, search Domains, list a user's Domains, and much more — without a fixed, hand-written tool per use case. |
| 20 | + |
| 21 | +## Cursor |
| 22 | + |
| 23 | +Cursor supports streamable-HTTP MCP servers natively via a `url` in `mcp.json`. |
| 24 | + |
| 25 | +**Project-scoped** (recommended when working in one repo) — create `.cursor/mcp.json` in the project root: |
| 26 | + |
| 27 | +```json title=".cursor/mcp.json" |
| 28 | +{ |
| 29 | + "mcpServers": { |
| 30 | + "ensnode-omnigraph": { |
| 31 | + "url": "https://api.v2-sepolia.ensnode.io/api/mcp" |
| 32 | + } |
| 33 | + } |
| 34 | +} |
| 35 | +``` |
| 36 | + |
| 37 | +**User-scoped** (all projects) — use `~/.cursor/mcp.json` with the same shape. |
| 38 | + |
| 39 | +For a local ENSApi instance: |
| 40 | + |
| 41 | +```json title=".cursor/mcp.json" |
| 42 | +{ |
| 43 | + "mcpServers": { |
| 44 | + "ensnode-omnigraph": { |
| 45 | + "url": "http://localhost:4334/api/mcp" |
| 46 | + } |
| 47 | + } |
| 48 | +} |
| 49 | +``` |
| 50 | + |
| 51 | +Then: |
| 52 | + |
| 53 | +1. Open **Cursor Settings → Tools & MCP** (or **Features → MCP**). |
| 54 | +2. Confirm `ensnode-omnigraph` is listed with a green status and the `omnigraph_query` tool. |
| 55 | +3. In chat, ask ENS questions in plain language — e.g. _"Who owns vitalik.eth?"_ or _"List domains owned by 0x…"_ — and let the agent call `omnigraph_query`. |
| 56 | + |
| 57 | +<Aside type="tip" title="Pair with ensskills"> |
| 58 | + MCP gives the agent **execution**; [`ensskills`](/docs/integrate/integration-options/ensskills) gives it **query authoring**. Install the **`omnigraph`** skill so the agent writes correct GraphQL on the first try. In this monorepo, `pnpm install` already symlinks `ensskills` into `.cursor/skills/`. |
| 59 | +</Aside> |
| 60 | + |
| 61 | +## Claude Desktop |
| 62 | + |
| 63 | +Claude Desktop configures MCP servers in a JSON file (restart Claude after editing): |
| 64 | + |
| 65 | +| OS | Config path | |
| 66 | +| ------- | ----------------------------------------------------------------- | |
| 67 | +| macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` | |
| 68 | +| Windows | `%APPDATA%\Claude\claude_desktop_config.json` | |
| 69 | + |
| 70 | +Many Claude Desktop builds expect **stdio** MCP servers rather than a remote URL. Bridge to ENSNode's streamable-HTTP endpoint with [`mcp-remote`](https://www.npmjs.com/package/mcp-remote): |
| 71 | + |
| 72 | +```json title="claude_desktop_config.json" |
| 73 | +{ |
| 74 | + "mcpServers": { |
| 75 | + "ensnode-omnigraph": { |
| 76 | + "command": "npx", |
| 77 | + "args": [ |
| 78 | + "-y", |
| 79 | + "mcp-remote", |
| 80 | + "https://api.v2-sepolia.ensnode.io/api/mcp" |
| 81 | + ] |
| 82 | + } |
| 83 | + } |
| 84 | +} |
| 85 | +``` |
| 86 | + |
| 87 | +For local development, swap the URL for `http://localhost:4334/api/mcp`. |
| 88 | + |
| 89 | +After restart, start a new conversation and ask ENS questions — Claude should invoke `omnigraph_query` when it needs indexed ENS data. |
| 90 | + |
| 91 | +<Aside type="note" title="Claude Code / other MCP clients"> |
| 92 | + Clients that support streamable HTTP directly (like Cursor) can use the `"url"` form instead of `mcp-remote`. Check your client's MCP docs for whether it accepts a remote `url` or requires a stdio `command`. |
| 93 | +</Aside> |
| 94 | + |
| 95 | +## Verify the connection |
| 96 | + |
| 97 | +To smoke-test without an editor, use the [MCP Inspector](https://github.com/modelcontextprotocol/inspector): |
| 98 | + |
| 99 | +```bash |
| 100 | +npx @modelcontextprotocol/inspector |
| 101 | +``` |
| 102 | + |
| 103 | +Set **Transport** to **Streamable HTTP**, **URL** to your `/api/mcp` endpoint, connect, then **List Tools** — you should see `omnigraph_query`. Call it with: |
| 104 | + |
| 105 | +```json |
| 106 | +{ |
| 107 | + "query": "{ __typename }" |
| 108 | +} |
| 109 | +``` |
| 110 | + |
| 111 | +## Authoring queries |
| 112 | + |
| 113 | +The MCP endpoint runs whatever GraphQL you hand it — it does not author queries for you. To discover the schema and write correct queries: |
| 114 | + |
| 115 | +- Explore interactively in the **GraphiQL playground** at `/api/omnigraph`. |
| 116 | +- Browse the [Omnigraph Schema Reference](/docs/integrate/omnigraph/schema-reference) and [Omnigraph examples](/docs/integrate/omnigraph/examples). |
| 117 | +- Give your agent the [`ensskills`](/docs/integrate/integration-options/ensskills) **`omnigraph`** skill, which teaches the unified ENSv1 + ENSv2 datamodel, resolution, pagination, and vetted example queries — so it writes queries that work the first time. |
| 118 | + |
| 119 | +<Aside type="note" title="Read-only"> |
| 120 | + The Omnigraph is a read-only API, and so is this MCP server. It indexes and serves ENS state; it does not send transactions or mutate onchain data. |
| 121 | +</Aside> |
| 122 | + |
| 123 | +## Where to go next |
| 124 | + |
| 125 | +- Want to call the same API over plain HTTP, `curl`, or your own GraphQL client? See the [ENS Omnigraph API (GraphQL)](/docs/integrate/integration-options/omnigraph-graphql-api) guide. |
| 126 | +- Building integration code rather than driving an agent? Use [`enssdk`](/docs/integrate/integration-options/enssdk) (typed client) or [`enskit`](/docs/integrate/integration-options/enskit) (React). |
| 127 | + |
| 128 | +<LinkCard |
| 129 | + title="ENS Omnigraph API (GraphQL)" |
| 130 | + description="The HTTP GraphQL API this MCP server wraps." |
| 131 | + href="/docs/integrate/integration-options/omnigraph-graphql-api" |
| 132 | +/> |
| 133 | + |
| 134 | +<LinkCard |
| 135 | + title="ensskills (AI agents)" |
| 136 | + description="Agent skills that teach how to author Omnigraph queries." |
| 137 | + href="/docs/integrate/integration-options/ensskills" |
| 138 | +/> |
| 139 | + |
| 140 | +<LinkCard |
| 141 | + title="Model Context Protocol" |
| 142 | + description="The open protocol this endpoint implements." |
| 143 | + href="https://modelcontextprotocol.io/" |
| 144 | +/> |
0 commit comments