> **Version 11 (RC)** — **React** / **TypeScript**
> Also available:
- `?codeOnly=true` for code snippets only
- other versions: Version 10.6 (latest) (`/docs/ai/reference/mcp-server.md`), Version 9 (`/docs/9/ai/reference/mcp-server.md`), Version 8 (`/docs/8/ai/reference/mcp-server.md`)

# MCP server

The Storybook MCP server lets your agent look up your components, write and test stories, and create a review of its work. It isn't available for your framework yet. See [supported frameworks](https://storybook.js.org/docs/11/ai/connect.md#supported-frameworks).

The Storybook MCP server gives your agent the same capabilities as the [skills](https://storybook.js.org/docs/11/ai/connect.md#install-the-skills) through the [Model Context Protocol](https://modelcontextprotocol.io/). Use it when you want your agent to call Storybook through MCP tools instead of CLI commands. Your agent still needs to run shell commands: the server tells it to read each step of the workflow with `npx storybook skills <id> --mcp`. For most setups, we recommend skills.

The MCP server runs as part of the Storybook dev server, so Storybook must be running for your agent to use it.

## Set up the MCP server

### 1. Install the addon

Run this command to install and register the Storybook MCP addon:

```shell
npx storybook add @storybook/addon-mcp
```

```shell
pnpm exec storybook add @storybook/addon-mcp
```

```shell
yarn exec storybook add @storybook/addon-mcp
```

When the dev server is running, the MCP server is available at `http://localhost:6006/mcp` (your port may be different). Open that URL in a browser to see the available tools and a link to the [manifest debugger](https://storybook.js.org/docs/11/ai/reference/manifests.md#debugging).

![The MCP server page in the browser](../../_assets/ai/addon-mcp-splash.png)

### 2. Check the components manifest

The MCP server's docs tools read the [components manifest](https://storybook.js.org/docs/11/ai/reference/manifests.md). Most frameworks that generate one turn it on by default. Check [framework support](https://storybook.js.org/docs/11/ai/reference/manifests.md#framework-support) to see whether you need to enable it. Without a components manifest, the docs tools are unavailable, but the other tools still work.

### 3. Add the MCP server to your agent

Run this command to add the MCP server to your agent:

```shell
npx mcp-add --type http --url "http://localhost:6006/mcp" --scope project
```

```shell
pnpm exec mcp-add --type http --url "http://localhost:6006/mcp" --scope project
```

```shell
yarn exec mcp-add --type http --url "http://localhost:6006/mcp" --scope project
```

Update the port in the URL if yours is different. When prompted, give the server a unique, descriptive name, such as `my-project-storybook`. Your agent uses this name to call the tools.

[`mcp-add`](https://github.com/paoloricciuti/mcp-add) adds MCP servers to many agents. You can also follow your agent's documentation to add the server manually, for example for [Claude Code](https://code.claude.com/docs/en/mcp#option-1-add-a-remote-http-server), [Gemini CLI](https://geminicli.com/docs/tools/mcp-server/#adding-an-http-server), [Codex](https://developers.openai.com/codex/mcp/), or [VS Code Copilot](https://code.visualstudio.com/docs/copilot/customization/mcp-servers#_configure-the-mcpjson-file).

[Host validation](https://storybook.js.org/docs/11/api/main-config/main-config-core.md#allowedhosts) applies to the MCP server. If your agent reaches Storybook through a hostname other than `localhost`, such as a reverse proxy, add that hostname to `core.allowedHosts`.

### 4. Check the connection

The MCP server tells your agent when to use its tools, so you don't need to add instructions to `AGENTS.md`.

To check the connection, start Storybook, then ask your agent to "List all documented components". The agent should call the `docs-list` tool and list the components in your Storybook.

## Tools

The MCP server gives your agent the tools that your project supports. The page at `http://localhost:6006/mcp` shows which ones those are.

| Tool                                        | What it does                                                                                                                                      | Requires                                                                    |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `stories-preview`                           | Gives direct links to stories                                                                                                                     |                                                                             |
| `stories-changed`                           | Lists the stories that your uncommitted changes affect                                                                                            | A builder that supports the module graph, such as Vite                      |
| `stories-find-by-component`                 | Finds the stories that use a component                                                                                                            | A builder that supports the module graph, such as Vite                      |
| `review-create`                             | Publishes an [agentic review](https://storybook.js.org/docs/11/ai/skills/ui-review.md)                                                                                            |                                                                             |
| `docs-list`, `docs-show`, `docs-show-story` | Look up components and their documentation, including those of [composed Storybooks](https://storybook.js.org/docs/11/sharing/storybook-composition.md) that have manifests | A [components manifest](https://storybook.js.org/docs/11/ai/reference/manifests.md)                                    |
| `test-run`                                  | Runs [story tests](https://storybook.js.org/docs/11/writing-tests.md), with [accessibility checks](https://storybook.js.org/docs/11/writing-tests/accessibility-testing.md) if they're set up   | The [Vitest addon](https://storybook.js.org/docs/11/writing-tests/integrations/vitest-addon.md) |

**More AI resources**

- [Connect your agent](https://storybook.js.org/docs/11/ai/connect.md)
- [Use a published Storybook](https://storybook.js.org/docs/11/ai/published-storybook.md)
- [Manifests](https://storybook.js.org/docs/11/ai/reference/manifests.md)