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

# Use a published Storybook

A published Storybook can share your component docs with agents anywhere, such as the agents of teams that use your design system. It needs a [components manifest](https://storybook.js.org/docs/11/ai/reference/manifests.md), which your framework doesn't generate yet. See [framework support](https://storybook.js.org/docs/11/ai/reference/manifests.md#framework-support).

Your agent can look up components from a Storybook that doesn't run on your machine, such as your team's published design system. A published Storybook can serve an MCP server with the docs tools, so agents anywhere can find your components and their props and usage.

## When to use it

- Teams that build apps with your design system want their agents to reuse its components.
- Your agent works in a repository that doesn't have the Storybook with the components it needs.

A published Storybook shares only the component docs. To write stories, run tests, and create reviews, your agent needs a local Storybook with [skills](https://storybook.js.org/docs/11/ai/connect.md#install-the-skills) or the [MCP server](https://storybook.js.org/docs/11/ai/reference/mcp-server.md).

If the app's own Storybook can compose the published one, you can use [composition](https://storybook.js.org/docs/11/sharing/storybook-composition.md) instead. Your agent then finds the components of both Storybooks with the [`/component-docs`](https://storybook.js.org/docs/11/ai/skills/component-docs.md) skill.

## Publish with Chromatic

When you [publish your Storybook with Chromatic](https://storybook.js.org/docs/11/sharing/publish-storybook.md#publish-storybook-with-chromatic), Chromatic also [publishes its MCP server](https://chromatic.com/docs/storybook-mcp/). The server is at your published Storybook's URL, followed by `/mcp`.

Each build has its own URL. For a URL that always points to your latest Storybook, use the permalink of your default branch:

```
https://<branch>--<app-id>.chromatic.com/mcp
```

For example, `https://main--642d765a7e8afcfb104268dc.chromatic.com/mcp`.

Before you publish, make sure that the [components manifest is on](https://storybook.js.org/docs/11/ai/reference/manifests.md#framework-support).

The published MCP server has the same access as your Storybook. If your Storybook is private, people sign in to Chromatic the first time their agent connects, and only people with access to your Chromatic project can use it. If your Storybook is public, anyone with the URL can use it.

To add the server to an agent, follow [Add the MCP server to your agent](https://storybook.js.org/docs/11/ai/reference/mcp-server.md#3-add-the-mcp-server-to-your-agent) with the [published URL](https://chromatic.com/docs/storybook-mcp/#use-the-mcp-server-without-a-local-storybook).

## Self-host with `@storybook/mcp`

To control the hosting, security, and updates of your MCP server, you can host it yourself.

`@storybook/mcp` is a library that creates a [`tmcp`-based](https://github.com/paoloricciuti/tmcp/) MCP server. The server serves your components and docs from your Storybook's [manifests](https://storybook.js.org/docs/11/ai/reference/manifests.md).

### Prerequisites

- Node.js 22.12+
- A [manifest](https://storybook.js.org/docs/11/ai/reference/manifests.md) source that contains:
  - `components.json` (required)
  - `docs.json` (optional)

### API

See the [package README](https://github.com/storybookjs/storybook/tree/next/code/lib/mcp#api-reference) for the full API of `@storybook/mcp`.

### Example implementation

This is a minimal server that uses `@storybook/mcp`:

```ts title="server.ts"

const storybookMcpHandler = await createStorybookMcpHandler();

export async function handleRequest(request: Request): Promise<Response> {
  if (new URL(request.url).pathname === '/mcp') {
    return storybookMcpHandler(request);
  }

  return new Response('Not found', { status: 404 });
}
```

For a Node example, see [`serve.ts`](https://github.com/storybookjs/storybook/blob/next/code/lib/mcp/serve.ts) in the Storybook repository.

**More AI resources**

- [Connect your agent](https://storybook.js.org/docs/11/ai/connect.md)
- [Component docs](https://storybook.js.org/docs/11/ai/skills/component-docs.md)
- [Manifests](https://storybook.js.org/docs/11/ai/reference/manifests.md)
- [MCP server](https://storybook.js.org/docs/11/ai/reference/mcp-server.md)