> ## Documentation Index
> Fetch the complete documentation index at: https://weaverse.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Weaverse component configuration uses `settings`. `inspector` is deprecated; never generate it.
> Weaverse Hydrogen themes use React Router v7: import from `react-router`, never `react-router-dom` or `@remix-run/*`.
> Before using any code sample, read `@weaverse/hydrogen` in the project's `package.json`: 6.x and 5.x import from different entries and use different type names, so code for one does not build on the other.
> `@weaverse/hydrogen` 6 (Shopify Hydrogen 2026.10 and later, the version these docs show) imports from `@weaverse/hydrogen/react-router` and uses `Weaverse*` types such as `WeaverseComponentProps`, `WeaverseComponentLoaderArgs` and `WeaverseComponentSchema`; the root `@weaverse/hydrogen` entry only exports `createSchema()`, data helpers and types.
> `@weaverse/hydrogen` 5.x (Hydrogen 2026.4 and earlier) imports everything from `@weaverse/hydrogen` and uses `HydrogenComponentProps`, `ComponentLoaderArgs` and `HydrogenComponentSchema`. On a 5.x project, convert samples to these names. Upgrade to 6 only when asked (`npx @weaverse/cli@latest migrate v6`, plus the Hydrogen 2026.10 upgrade). Do not mix major versions.
> Next.js themes use `@weaverse/hydrogen` 6.2.0 or later: import client and shared code from `@weaverse/hydrogen/next` and server-only code from `@weaverse/hydrogen/next/server`. `@weaverse/next` is deprecated; never install or import it.
> For live project data (pages, theme settings, translations), use the Weaverse MCP server: https://weaverse.io/docs/developer-tools/weaverse-mcp

# Weaverse MCP

> Connect Claude, ChatGPT and other AI agents to Weaverse: search the docs and work with your own store over the Content API using the Model Context Protocol

# Weaverse MCP

The Weaverse MCP server connects AI tools (Cursor, Claude, Codex, and any other
[Model Context Protocol](https://modelcontextprotocol.io) client) to Weaverse. It
does two things:

1. **Docs** — search the Weaverse documentation and knowledge base.
2. **Your account** — read your own Weaverse projects, pages, theme settings, and
   locales over the [Content API](https://weaverse.io/docs/content-api/overview.md), scoped to your shop.

The documentation itself is public. How you reach it depends on the server:
the local server and the docs-only MCP search it without credentials, while
the hosted connector requires sign-in for every tool, including docs search.
The account tools only ever see the one store you connected, whether through
sign-in (hosted connector) or an API key (local server).

## Ways to connect

> [card] Hosted connector (Claude, ChatGPT)
>
> `https://mcp.weaverse.io/mcp`. Nothing to install: add it as a connector and
> sign in with your Shopify store. Each store approves its own access.

> [card] @weaverse/mcp (local)
>
> Runs on your machine via `npx` with a Content API key. For Cursor, Claude
> Code, Codex, VS Code and other local MCP clients.

> [card] Docs-only MCP
>
> `https://docs.weaverse.io/mcp`. Documentation search only, with no store
> access.

## Hosted connector for Claude and ChatGPT

The hosted connector runs the same tools as `@weaverse/mcp` at
`https://mcp.weaverse.io/mcp`. It never uses an API key. Each store signs in and
approves access itself, and every request is limited to that store. Every
hosted request needs that sign-in, even documentation search; use the
docs-only MCP if you want docs without connecting a store.

> [!WARNING]
>
> **Edits are live.** The hosted connector offers the nine read tools to every
> connection. The six edit tools appear only if you grant the edit permission
> (`content:write`), and `delete_pages` also needs the delete permission
> (`content:delete`). Edits change your live storefront immediately, so grant
> edit permission only when you want the assistant to make changes. Weaverse
> is not yet listed in the Claude or ChatGPT app directories, so add the URL
> yourself as shown below.

**1. Add the connector**

* **Claude**: open **Customize → Connectors**, add a custom connector, and
  enter `https://mcp.weaverse.io/mcp`.
* **ChatGPT**: open **Plugins**, select **+ → Add custom MCP server**, enter
  a name and `https://mcp.weaverse.io/mcp`, choose OAuth authentication,
  accept the risk warning, and select **Create as a plugin** (per OpenAI's
  [Connect and test your plugin](https://developers.openai.com/plugins/deploy/connect-chatgpt)
  guide). Workspace policies may restrict custom MCP servers.

**2. Sign in with your store**

You are sent to Weaverse. Sign in with the Shopify account that owns the
store. If you are already signed in to Weaverse, you go straight to the
approval screen.

**3. Approve access**

The approval screen shows the app asking, your store, and where it sends you
back. Reading your projects, pages and theme settings is always included.
Every other permission the assistant requests is a separate checkbox, off
by default, so leave edit permission unchecked for read-only use. Choose
**Approve** or **Deny**.

**4. Try a read**

Ask "Which Weaverse projects does my store have?" The assistant calls
`list_projects` and shows only your store's projects.

### Permissions

| Permission | Approval screen | What the connector can do |
| - | - | - |
| `content:read` | Always included | Every read tool and docs search. |
| `content:write` | "Save drafts and edit content" checkbox | `update_page`, `update_theme_settings`, `update_project`, `create_page`, `assign_template_resources`. Page and theme edits go **live on the storefront immediately**: this connector does not use drafts. `update_project` only renames the project in Weaverse. |
| `content:delete` | "Delete content" checkbox | Additionally needed for `delete_pages`. If you ask to delete without it, the assistant asks you to approve it. |

The connector's tools never use publishing, project-management or translation
permissions. Leave those unchecked if an assistant requests them.

Access tokens last one hour and are renewed automatically while the connection
is active. If the store uninstalls Weaverse, every connection stops working
immediately.

### Disconnect

* In the assistant, remove or disconnect the Weaverse connector.
* In Weaverse, open **[Dashboard → Account](https://studio.weaverse.io/dashboard/account) → Connected AI apps** and choose
  **Disconnect**. Access is revoked on the very next request. To use the
  connector again, connect and approve again.

> [!NOTE]
>
> Both surfaces search the same documentation. `@weaverse/mcp` proxies that same
> docs search and adds account tools on top, so it is a strict superset of the
> hosted docs MCP.

## Install & configure `@weaverse/mcp` (local)

Add the server to your MCP client. Pass your API key (optional — omit it for
docs-only use) via the `env` block.

> [tab] Cursor
>
> Add to `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (per-project):
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "weaverse": {
>       "command": "npx",
>       "args": ["-y", "@weaverse/mcp"],
>       "env": { "WEAVERSE_API_KEY": "your-key" }
>     }
>   }
> }
> ```

> [tab] Claude Desktop
>
> Edit the config file:
>
> * **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
> * **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "weaverse": {
>       "command": "npx",
>       "args": ["-y", "@weaverse/mcp"],
>       "env": { "WEAVERSE_API_KEY": "your-key" }
>     }
>   }
> }
> ```
>
> Restart Claude Desktop.

> [tab] Claude Code
>
> ```bash theme={null}
> claude mcp add weaverse \
>   --env WEAVERSE_API_KEY=your-key \
>   -- npx -y @weaverse/mcp
> ```

> [tab] opencode
>
> opencode reads `opencode.json` (project) or
> `~/.config/opencode/opencode.json` (global) with an `mcp` block:
>
> ```json theme={null}
> {
>   "$schema": "https://opencode.ai/config.json",
>   "mcp": {
>     "weaverse": {
>       "type": "local",
>       "command": ["npx", "-y", "@weaverse/mcp"],
>       "environment": { "WEAVERSE_API_KEY": "your-key" }
>     }
>   }
> }
> ```

> [tab] Codex
>
> Codex CLI uses TOML, not JSON. Add to `~/.codex/config.toml`:
>
> ```toml theme={null}
> [mcp_servers.weaverse]
> command = "npx"
> args = ["-y", "@weaverse/mcp"]
> env = { WEAVERSE_API_KEY = "your-key" }
> ```

> [tab] VS Code
>
> Add to `.vscode/mcp.json` (or your user `mcp.json`). VS Code uses a top-level
> `servers` key (not `mcpServers`):
>
> ```json theme={null}
> {
>   "servers": {
>     "weaverse": {
>       "command": "npx",
>       "args": ["-y", "@weaverse/mcp"],
>       "env": { "WEAVERSE_API_KEY": "your-key" }
>     }
>   }
> }
> ```

> [!NOTE]
>
> Leave `WEAVERSE_API_KEY` out to run docs-only — `search_weaverse_docs` still
> works. Existing installs that only search docs keep working unchanged.

> [!NOTE]
>
> Using another MCP-compatible client — **pi**, Gemini CLI, or anything else that
> speaks MCP? Point it at `npx -y @weaverse/mcp` and put `WEAVERSE_API_KEY` in
> the server's environment.

## Authentication (local server)

The local server forwards `WEAVERSE_API_KEY` to the Content API as
`Authorization: Bearer <key>`. It never validates or stores the token itself —
the Content API enforces shop scoping and scopes. An account tool called without
a valid, sufficiently-scoped key returns a clear auth error, never data.

**1. Get a key**

Create a Content API key in **[Weaverse Dashboard → Account → API
Keys](https://studio.weaverse.io/dashboard/account)**.

**2. Add it to your MCP config**

Put it in the `env` block as shown above.

**3. Confirm**

Ask your agent to call `list_projects`. It returns the projects the key can
access.

### Scopes & shop isolation

Account tools map to Content API scopes (`content:read` for reads,
`content:write` for edits, `content:delete` for `delete_pages`). Each key or
connection is scoped to a single Weaverse store: requests can only touch that
store's projects, and reaching across stores returns a `403`. Revoke keys in
**Dashboard → Account → API Keys** and hosted connections in **Dashboard →
Account → Connected AI apps**.

## Available tools

### Docs (no API key; the hosted connector still requires sign-in)

> [card] search\_weaverse\_docs
>
> Search the Weaverse knowledge base for features, schema/input settings, SDK
> hooks, theme settings, and implementation guides. Returns titles, direct links,
> and content. Also registered as `search_docs`.
>
> Backed by the official Weaverse documentation MCP (hosted by Mintlify) — the
> knowledge base, ranking, and freshness all live upstream.

### Account reads (hosted connection or `WEAVERSE_API_KEY`)

| Tool | Description |
| - | - |
| `list_projects` | List the projects in your store (cursor-paginated). |
| `get_project` | Get one project, including its `revision`. |
| `list_pages` | List page assignments in a project (filter by `type` / `locale`). |
| `get_page` | Get a page's content and its `updatedAt`. Defaults to the editable `weaverse` item tree; `format: "portable-text"` is a read-only view. |
| `get_theme_settings` | Get a project's own theme settings and their `revision`. |
| `list_languages` | List a project's locales. |
| `get_openapi_spec` | Get the Content API's OpenAPI document (public reference data). |

### Live edits (opt-in)

Edit tools appear only when edits are allowed: on the local server with
`WEAVERSE_ENABLE_LIVE_WRITES=true` and a key, and on the hosted connector when
you granted the edit permission (`content:write`). `delete_pages` is listed
with them but also needs the delete permission (`content:delete`).

| Tool | Description |
| - | - |
| `update_page` | Merge item data, create typed items, relink `children`. Pass `expectedUpdatedAt` from `get_page`. Live immediately. |
| `update_theme_settings` | Merge top-level theme keys. Pass `expectedRevision` from `get_theme_settings`. Live immediately. |
| `update_project` | Rename a project (Weaverse metadata only, not storefront content). Pass `expectedUpdatedAt` = `get_project.revision`. |
| `create_page` | Create a page and its assignment. Live immediately. |
| `assign_template_resources` | Attach products/collections to an existing shared template page. New routes go live immediately. |
| `delete_pages` | Soft-delete pages by ids, or by handles + type + locale. Needs `content:delete`. Live immediately. |

> [!NOTE]
>
> The edit tools require `@weaverse/mcp` 4.0.0 or later for the
> `update_project` revision check and the required `locale` on handle
> deletes. `npx -y @weaverse/mcp` fetches the latest version.

> [!TIP]
>
> `get_page` can also return [Portable Text](https://weaverse.io/docs/content-api/portable-text.md)
> (`format: "portable-text"`), structured JSON that is easier for an LLM to
> read. It is read-only: edit with the default `weaverse` format.

### Try it

Once `@weaverse/mcp` is connected, a read-only prompt is a safe first check:

Use the Weaverse MCP server. List my Weaverse projects. For the first project, list its pages and summarize them by page type and locale. Do not call any write tools.

Use the Weaverse MCP server. List my Weaverse projects. For the first project, list its pages and summarize them by page type and locale. Do not call any write tools.

## Content writes & safety

> [!WARNING]
>
> Write tools change the **live storefront immediately**: edits propagate
> through the same cache-invalidation path as a Studio save. The MCP tools have
> **no draft, preview, publish or restore step** and no automatic rollback.
> Weaverse's own drafts, publishing and version restore exist in Studio and the
> [Content API](https://weaverse.io/docs/content-api/overview.md), but this connector does not use them.
> The assistant should confirm each change with you first.

* **Read first, then write.** The three update tools take a baseline from
  your last read: `update_page` (`get_page.updatedAt`),
  `update_theme_settings` (`get_theme_settings.revision`) and `update_project`
  (`get_project.revision`). If someone changed the content since (for example
  in Studio), the write is rejected with `409` instead of overwriting newer
  work. Re-read and try again. The hosted connector requires the baseline on
  these three tools. `create_page`, `assign_template_resources` and
  `delete_pages` take no baseline; they have their own checks (for example, a
  duplicate page or a missing `content:delete` permission is refused).
* Send only the keys you mean to change; nested objects are replaced wholesale.
* A `500` after a create, delete or assignment may come after the change was
  saved. Re-read before retrying.

Write scope is deliberately narrow:

* **Page content** — merge item data, create items, relink children
  (`update_page`), create pages (`create_page`), attach resources to a template
  page (`assign_template_resources`), and soft-delete pages (`delete_pages`).
* **Theme settings** — top-level key merges only (`update_theme_settings`).
  Weaverse attempts a theme-version snapshot, but this connector cannot restore it.
* **Project** — `name` only (`update_project`). This renames the project in
  Weaverse (project metadata); it does not change storefront content.

**Account-level operations are never exposed via MCP** — creating or deleting
projects, billing, team/members, plan changes, and store linkage stay
human-only in [Weaverse Builder](https://studio.weaverse.io).

## How docs search relates to `docs.weaverse.io/mcp`

`https://docs.weaverse.io/mcp` is the Mintlify-hosted, docs-only MCP (it resolves
to `https://weaverse.io/docs/mcp`). `@weaverse/mcp` proxies that exact docs search
and layers the account tools on top. Pick the hosted URL for a zero-install docs
lookup; pick `@weaverse/mcp` when you want your agent to work with your projects.

## Related

> [card] [Content API](https://weaverse.io/docs/content-api/overview.md)
>
> The REST API the account tools wrap — reads and writes. The MCP is its agent-native front end.

> [card] [Shopify Hydrogen Skills](https://weaverse.io/docs/developer-tools/shopify-hydrogen-skills.md)
>
> Agent skills for building Weaverse + Hydrogen storefronts. After setup, the same key powers the account tools here.

> [card] [Weaverse CLI](https://weaverse.io/docs/developer-tools/weaverse-cli.md)
>
> Project setup and theme scaffolding.

> [card] [Weaverse SDKs](https://weaverse.io/docs/developer-tools/weaverse-sdks.md)
>
> Build custom components for Weaverse Hydrogen themes.

## Troubleshooting

> [accordion] Account tools return an authentication error
>
> * Local server: confirm `WEAVERSE_API_KEY` is set in the server's `env`
>   block and the key is not revoked in **Dashboard → Account → API Keys**.
> * Hosted connector: reconnect. The connection may have been disconnected in
>   **Connected AI apps**, or the store uninstalled Weaverse.
> * Docs tools work without a key; only the account tools need one.

> [accordion] An edit is rejected with 409 or asks for a baseline
>
> * Someone changed the content since your last read. Re-read with `get_page`,
>   `get_theme_settings` or `get_project`, then apply the change again.
> * The hosted connector requires `expectedUpdatedAt` / `expectedRevision` from
>   that read for `update_page`, `update_theme_settings` and `update_project`.

> [accordion] “Access denied” on a project
>
> * The key is scoped to one shop. You can only access that shop's projects.
> * Use `list_projects` to see exactly what the key or connection can reach.

> [accordion] Server won't start
>
> * Ensure Node.js is installed and `npx -y @weaverse/mcp` can run.
> * Restart your AI tool after editing its MCP config.
> * The server logs a startup line to stderr noting whether account tools are enabled.

> [accordion] No docs results
>
> * Be specific and use Weaverse terms (e.g. `createSchema`, `WeaverseRoot`, "input settings").
> * Docs search requires network access to the hosted documentation MCP.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.