You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Single-line `mcp-add` snippet
- Don't hide renderer selector on any pages
- Consolidate callouts and include for all renderers
- Improve get started/installation section
Copy file name to clipboardExpand all lines: docs/ai/best-practices.mdx
+3-11Lines changed: 3 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,18 @@
1
1
---
2
2
title: Best practices for using Storybook with AI
3
-
hideRendererSelector: true
4
3
sidebar:
5
4
order: 2
6
5
title: Best practices
7
6
---
8
-
9
-
<IfnotRenderer={['react']}>
10
7
11
-
<Calloutvariant="info">
8
+
<Calloutvariant="info"icon="🧪">
12
9
The best practices here relate to the [generated manifests](./manifests.mdx), which are currently only supported for [React](?renderer=react) projects.
13
-
</Callout>
14
10
15
-
</If>
16
-
{/* End non-supported renderers */}
11
+
Additionally, the API may change in future releases. We welcome feedback and contributions to help improve this feature.
12
+
</Callout>
17
13
18
14
<Ifrenderer={['react']}>
19
15
20
-
<Calloutvariant="warning"icon="🧪">
21
-
This is a [**preview**](../releases/features.mdx#preview) feature and (though unlikely) the API may change in future releases. We welcome feedback and contributions to help improve this feature.
22
-
</Callout>
23
-
24
16
Use Storybook together with an AI agent effectively by following these best practices.
Copy file name to clipboardExpand all lines: docs/ai/index.mdx
+17-19Lines changed: 17 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,52 +1,50 @@
1
1
---
2
2
title: Using Storybook with AI
3
-
hideRendererSelector: true
4
3
sidebar:
5
4
order: 5
6
5
title: AI
7
6
---
8
-
9
-
<IfnotRenderer={['react']}>
10
7
11
-
<Calloutvariant="info">
8
+
<Calloutvariant="info"icon="🧪">
12
9
While they are in [preview](../releases/features.mdx#preview), Storybook's AI capabilities (specifically, the [manifests](./manifests.mdx) and [MCP server](./mcp/overview.mdx)) are currently only supported for [React](?renderer=react) projects.
13
-
</Callout>
14
10
15
-
</If>
16
-
{/* End non-supported renderers */}
11
+
Additionally, the API may change in future releases. We welcome feedback and contributions to help improve this feature.
12
+
</Callout>
17
13
18
14
<Ifrenderer={['react']}>
19
15
20
-
<Calloutvariant="warning"icon="🧪">
21
-
This is a [**preview**](../releases/features.mdx#preview) feature and (though unlikely) the API may change in future releases. We welcome feedback and contributions to help improve this feature.
22
-
</Callout>
23
-
24
16
With Storybook's AI capabilities, you can leverage the power of AI agents to speed up your development workflow. By connecting your Storybook to an AI agent via the [Storybook MCP server](./mcp/overview.mdx), you can enable your agent to understand your components and documentation, generate stories, run tests, and more.
25
17
26
18
## Get started
27
19
28
-
First, run this command to install and register the Storybook MCP addon:
20
+
### 1. Install the addon
21
+
22
+
Run this command to install and register the Storybook MCP addon:
29
23
30
24
<CodeSnippetspath="addon-mcp-add.md" />
31
25
32
-
After restarting your Storybook, you can access the MCP server at `http://localhost:6006/mcp` (your port may be different). When viewed in the browser, you'll see a page showing which tools are available and a link to the [manifest debugger](./manifests.mdx#debugging).
26
+
Now, when running Storybook's dev server, you can access the MCP server at `http://localhost:6006/mcp` (your port may be different). When viewed in the browser, you'll see a page showing which tools are available and a link to the [manifest debugger](./manifests.mdx#debugging).
33
27
34
28

35
29
36
-
Second, configure your agent to use the MCP server:
30
+
### 2. Add the MCP server to your agent
31
+
32
+
Then run this command to configure your agent to use the MCP server:
37
33
38
34
<CodeSnippetspath="mcp-add.md" />
39
35
40
-
You may need to update the port number in the URL. You will be prompted for a name for your MCP server toolset (e.g. "my-project-sb-mcp"). This is the name you'll use when calling the tools from your agent, so choose something descriptive and unique to avoid confusion with other tools.
36
+
You may need to update the port number in the URL. You will be prompted for a name for your MCP server (e.g. "my-project-sb-mcp"). This is the name you'll use when calling the tools from your agent, so choose something descriptive and unique to avoid confusion with other tools.
41
37
42
-
[`mcp-add`](https://github.com/paoloricciuti/mcp-add) is a CLI tool built to simplify the process of adding MCP servers to various agents.
38
+
[`mcp-add`](https://github.com/paoloricciuti/mcp-add) is a CLI tool designed to simplify adding MCP servers to various agents.
43
39
44
40
You can also follow your agent's documentation to add the MCP server as a tool provider manually, e.g. [Claude Code](https://code.claude.com/docs/en/mcp#option-1-add-a-remote-http-server), [Google Gemini CLI](https://geminicli.com/docs/tools/mcp-server/#adding-an-http-server), [OpenAI Codex](https://developers.openai.com/codex/mcp/), [VS Code Copilot](https://code.visualstudio.com/docs/copilot/customization/mcp-servers#_configure-the-mcpjson-file), etc.
45
41
46
-
Next, to guide your agent to use your MCP server, adjust your [`AGENTS.md`](https://agents.md/) (or [`CLAUDE.md`](https://code.claude.com/docs/en/memory#claude-md-files), if you're using Claude). The specifics will depend on your project and how you use agents in your development process, but something like this is a good starting point. Just make sure to replace `your-project-sb-mcp` with the name you chose for your MCP server toolset in the previous step.
42
+
### 3. Adjust your agent instructions
43
+
44
+
To guide your agent to use your MCP server, you should adjust your [`AGENTS.md`](https://agents.md/) (or [`CLAUDE.md`](https://code.claude.com/docs/en/memory#claude-md-files), if you're using Claude). The specifics will depend on your project and how you use agents in your development process, but something like this is a good starting point. Just make sure to replace `your-project-sb-mcp` with the name you chose for your MCP server toolset in the previous step.
47
45
48
46
<details>
49
-
<summary>AGENTS.md</summary>
47
+
<summary>Example instructions for AGENTS.md</summary>
50
48
51
49
```md title="AGENTS.md"
52
50
When working on UI components, always use the `your-project-sb-mcp` MCP tools to access Storybook's component and documentation knowledge before answering or taking any action.
@@ -64,7 +62,7 @@ Remember: A story name might not reflect the property name correctly, so always
64
62
65
63
</details>
66
64
67
-
Finally, test your agent's access to the MCP server by runninga prompt like "List all documented components". You should see a call to the `list-all-documentation` tool with a response listing components from your Storybook.
65
+
Finally, test your agent's access to the MCP server. First, make sure your Storybook is running, then run a prompt like "List all documented components". You should see a call to the [`list-all-documentation`](./mcp/overview.mdx#list-all-documentation) tool with a response listing components from your Storybook.
Copy file name to clipboardExpand all lines: docs/ai/manifests.mdx
+3-11Lines changed: 3 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,25 +1,17 @@
1
1
---
2
2
title: Manifests
3
-
hideRendererSelector: true
4
3
sidebar:
5
4
order: 3
6
5
---
7
6
8
-
<IfnotRenderer={['react']}>
9
-
10
-
<Calloutvariant="info">
7
+
<Calloutvariant="info"icon="🧪">
11
8
While they are in [preview](../releases/features.mdx#preview), Storybook's AI capabilities (specifically, the manifests and [MCP server](./mcp/overview.mdx)) are currently only supported for [React](?renderer=react) projects.
12
-
</Callout>
13
9
14
-
</If>
15
-
{/* End non-supported renderers */}
10
+
Additionally, the API may change in future releases. We welcome feedback and contributions to help improve this feature.
11
+
</Callout>
16
12
17
13
<Ifrenderer={['react']}>
18
14
19
-
<Calloutvariant="warning"icon="🧪">
20
-
This is a [**preview**](../releases/features.mdx#preview) feature and (though unlikely) the API may change in future releases. We welcome feedback and contributions to help improve this feature.
21
-
</Callout>
22
-
23
15
Your Storybook holds a wealth of information about your components: their names, descriptions, API, usage examples, and more. Manifests are JSON objects that describe the contents of your Storybook in a concise, structured way that is easy for AI agents to understand and use. The manifests are generated automatically from your Storybook's CSF and MDX files, and they are designed to be comprehensive and up-to-date representations of your Storybook's contents.
24
16
25
17
There are two types of manifests generated by Storybook: components and docs.
Copy file name to clipboardExpand all lines: docs/ai/mcp/api.mdx
+3-11Lines changed: 3 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,18 @@
1
1
---
2
2
title: MCP server API
3
-
hideRendererSelector: true
4
3
sidebar:
5
4
order: 2
6
5
title: API
7
6
---
8
-
9
-
<IfnotRenderer={['react']}>
10
7
11
-
<Calloutvariant="info">
8
+
<Calloutvariant="info"icon="🧪">
12
9
While they are in [preview](../../releases/features.mdx#preview), Storybook's AI capabilities (specifically, the [manifests](../manifests.mdx) and MCP server) are currently only supported for [React](?renderer=react) projects.
13
-
</Callout>
14
10
15
-
</If>
16
-
{/* End non-supported renderers */}
11
+
Additionally, the API may change in future releases. We welcome feedback and contributions to help improve this feature.
12
+
</Callout>
17
13
18
14
<Ifrenderer={['react']}>
19
15
20
-
<Calloutvariant="warning"icon="🧪">
21
-
This is a [**preview**](../../releases/features.mdx#preview) feature and (though unlikely) the API may change in future releases. We welcome feedback and contributions to help improve this feature.
22
-
</Callout>
23
-
24
16
## `@storybook/addon-mcp` options
25
17
26
18
The MCP server addon accepts the following options to configure the tools provided by the MCP server. You can provide these options when registering the addon in your `main.js|ts` file:
Copy file name to clipboardExpand all lines: docs/ai/mcp/overview.mdx
+6-14Lines changed: 6 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,18 @@
1
1
---
2
2
title: MCP server
3
-
hideRendererSelector: true
4
3
sidebar:
5
4
order: 1
6
5
title: Overview
7
6
---
8
7
9
-
<IfnotRenderer={['react']}>
10
-
11
-
<Calloutvariant="info">
8
+
<Calloutvariant="info"icon="🧪">
12
9
While they are in [preview](../../releases/features.mdx#preview), Storybook's AI capabilities (specifically, the [manifests](../manifests.mdx) and MCP server) are currently only supported for [React](?renderer=react) projects.
13
-
</Callout>
14
10
15
-
</If>
16
-
{/* End non-supported renderers */}
11
+
Additionally, the API may change in future releases. We welcome feedback and contributions to help improve this feature.
12
+
</Callout>
17
13
18
14
<Ifrenderer={['react']}>
19
15
20
-
<Calloutvariant="warning"icon="🧪">
21
-
This is a [**preview**](../../releases/features.mdx#preview) feature and (though unlikely) the API may change in future releases. We welcome feedback and contributions to help improve this feature.
22
-
</Callout>
23
-
24
16
Storybook's MCP server connects your Storybook to AI agents, allowing them to understand your components and documentation, generate stories, run tests, and more. Agents will be equipped to reuse your existing components and follow your documented usage guidelines when generating UI, helping ensure the generated UI is consistent with your existing design system. Then they can write stories so you can preview the generated UI and automatically run interaction tests (and accessibility checks) on those stories to validate their work. If any issues are found, the agent can fix them and re-run the tests to confirm they are resolved, creating a self-healing loop that helps ensure the quality of the generated UI without requiring you to intervene.
25
17
26
18
## Installation
@@ -31,7 +23,7 @@ Run this command to install and register the Storybook MCP addon:
31
23
32
24
<CodeSnippetspath="addon-mcp-add.md" />
33
25
34
-
After restarting your Storybook, you can access the MCP server at `http://localhost:6006/mcp` (your port may be different). When viewed in the browser, you'll see a page showing which tools are available and a link to the [manifest debugger](../manifests.mdx#debugging).
26
+
Now, when running Storybook's dev server, you can access the MCP server at `http://localhost:6006/mcp` (your port may be different). When viewed in the browser, you'll see a page showing which tools are available and a link to the [manifest debugger](../manifests.mdx#debugging).
35
27
36
28

37
29
@@ -41,7 +33,7 @@ Then run this command to configure your agent to use the MCP server:
41
33
42
34
<CodeSnippetspath="mcp-add.md" />
43
35
44
-
You may need to update the port number in the URL. You will be prompted for a name for your MCP server toolset (e.g. "my-project-sb-mcp"). This is the name you'll use when calling the tools from your agent, so choose something descriptive and unique to avoid confusion with other tools.
36
+
You may need to update the port number in the URL. You will be prompted for a name for your MCP server (e.g. "my-project-sb-mcp"). This is the name you'll use when calling the tools from your agent, so choose something descriptive and unique to avoid confusion with other tools.
45
37
46
38
[`mcp-add`](https://github.com/paoloricciuti/mcp-add) is a CLI tool designed to simplify adding MCP servers to various agents.
47
39
@@ -65,7 +57,7 @@ When working on UI components, always use the `your-project-sb-mcp` MCP tools to
65
57
Remember: A story name might not reflect the property name correctly, so always verify properties through documentation or example stories before using them.
66
58
```
67
59
68
-
Finally, test your agent's access to the MCP server by runninga prompt like "List all documented components". You should see a call to the `list-all-documentation` tool with a response listing components from your Storybook.
60
+
Finally, test your agent's access to the MCP server. First, make sure your Storybook is running, then run a prompt like "List all documented components". You should see a call to the [`list-all-documentation`](#list-all-documentation) tool with a response listing components from your Storybook.
Copy file name to clipboardExpand all lines: docs/ai/mcp/sharing.mdx
+3-11Lines changed: 3 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,18 @@
1
1
---
2
2
title: Sharing your MCP server
3
-
hideRendererSelector: true
4
3
sidebar:
5
4
order: 3
6
5
title: Sharing
7
6
---
8
7
9
-
<IfnotRenderer={['react']}>
10
-
11
-
<Calloutvariant="info">
8
+
<Calloutvariant="info"icon="🧪">
12
9
While they are in [preview](../../releases/features.mdx#preview), Storybook's AI capabilities (specifically, the [manifests](../manifests.mdx) and [MCP server](./overview.mdx)) are currently only supported for [React](?renderer=react) projects.
13
-
</Callout>
14
10
15
-
</If>
16
-
{/* End non-supported renderers */}
11
+
Additionally, the API may change in future releases. We welcome feedback and contributions to help improve this feature.
12
+
</Callout>
17
13
18
14
<Ifrenderer={['react']}>
19
15
20
-
<Calloutvariant="warning"icon="🧪">
21
-
This is a [**preview**](../../releases/features.mdx#preview) feature and (though unlikely) the API may change in future releases. We welcome feedback and contributions to help improve this feature.
22
-
</Callout>
23
-
24
16
Just as [publishing your Storybook](../../sharing/publish-storybook.mdx) can help your team work more effectively, sharing your MCP server can enable your team to share the benefits of AI-assisted development.
25
17
26
18
The MCP server is made of [development](./overview.mdx#development), [docs](./overview.mdx#docs), and [testing](./overview.mdx#testing) toolsets that an agent can call to interact with your Storybook. The development and testing toolsets are only relevant to the locally-running Storybook instance, but the docs toolset can be published and shared so that agents outside of your local environment can access the knowledge from your Storybook's [manifest](../manifests.mdx) to reference your components and documentation when generating UI.
0 commit comments