Skip to content

Commit 7eecfa7

Browse files
committed
Address feedback
- 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
1 parent 8335dc0 commit 7eecfa7

7 files changed

Lines changed: 38 additions & 89 deletions

File tree

docs/_snippets/mcp-add.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
```shell renderer="common" language="js" packageManager="npm"
2-
npx mcp-add \
3-
--type http \
4-
--url "http://localhost:6006/mcp" \
5-
--scope project
2+
npx mcp-add --type http --url "http://localhost:6006/mcp" --scope project
63
```
74

85
```shell renderer="common" language="js" packageManager="pnpm"
9-
pnpm exec mcp-add \
10-
--type http \
11-
--url "http://localhost:6006/mcp" \
12-
--scope project
6+
pnpm exec mcp-add --type http --url "http://localhost:6006/mcp" --scope project
137
```
148

159
```shell renderer="common" language="js" packageManager="yarn"
16-
yarn exec mcp-add \
17-
--type http \
18-
--url "http://localhost:6006/mcp" \
19-
--scope project
10+
yarn exec mcp-add --type http --url "http://localhost:6006/mcp" --scope project
2011
```

docs/ai/best-practices.mdx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
11
---
22
title: Best practices for using Storybook with AI
3-
hideRendererSelector: true
43
sidebar:
54
order: 2
65
title: Best practices
76
---
8-
9-
<If notRenderer={['react']}>
107

11-
<Callout variant="info">
8+
<Callout variant="info" icon="🧪">
129
The best practices here relate to the [generated manifests](./manifests.mdx), which are currently only supported for [React](?renderer=react) projects.
13-
</Callout>
1410

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>
1713

1814
<If renderer={['react']}>
1915

20-
<Callout variant="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-
2416
Use Storybook together with an AI agent effectively by following these best practices.
2517

2618
## Writing effective stories

docs/ai/index.mdx

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,50 @@
11
---
22
title: Using Storybook with AI
3-
hideRendererSelector: true
43
sidebar:
54
order: 5
65
title: AI
76
---
8-
9-
<If notRenderer={['react']}>
107

11-
<Callout variant="info">
8+
<Callout variant="info" icon="🧪">
129
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>
1410

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>
1713

1814
<If renderer={['react']}>
1915

20-
<Callout variant="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-
2416
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.
2517

2618
## Get started
2719

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:
2923

3024
<CodeSnippets path="addon-mcp-add.md" />
3125

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).
3327

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

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:
3733

3834
<CodeSnippets path="mcp-add.md" />
3935

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.
4137

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.
4339

4440
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.
4541

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.
4745

4846
<details>
49-
<summary>AGENTS.md</summary>
47+
<summary>Example instructions for AGENTS.md</summary>
5048

5149
```md title="AGENTS.md"
5250
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
6462

6563
</details>
6664

67-
Finally, test your agent's access to the MCP server by running a 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.
6866

6967
## Key concepts
7068

docs/ai/manifests.mdx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
11
---
22
title: Manifests
3-
hideRendererSelector: true
43
sidebar:
54
order: 3
65
---
76

8-
<If notRenderer={['react']}>
9-
10-
<Callout variant="info">
7+
<Callout variant="info" icon="🧪">
118
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>
139

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>
1612

1713
<If renderer={['react']}>
1814

19-
<Callout variant="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-
2315
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.
2416

2517
There are two types of manifests generated by Storybook: components and docs.

docs/ai/mcp/api.mdx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
11
---
22
title: MCP server API
3-
hideRendererSelector: true
43
sidebar:
54
order: 2
65
title: API
76
---
8-
9-
<If notRenderer={['react']}>
107

11-
<Callout variant="info">
8+
<Callout variant="info" icon="🧪">
129
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>
1410

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>
1713

1814
<If renderer={['react']}>
1915

20-
<Callout variant="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-
2416
## `@storybook/addon-mcp` options
2517

2618
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:

docs/ai/mcp/overview.mdx

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
11
---
22
title: MCP server
3-
hideRendererSelector: true
43
sidebar:
54
order: 1
65
title: Overview
76
---
87

9-
<If notRenderer={['react']}>
10-
11-
<Callout variant="info">
8+
<Callout variant="info" icon="🧪">
129
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>
1410

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>
1713

1814
<If renderer={['react']}>
1915

20-
<Callout variant="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-
2416
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.
2517

2618
## Installation
@@ -31,7 +23,7 @@ Run this command to install and register the Storybook MCP addon:
3123

3224
<CodeSnippets path="addon-mcp-add.md" />
3325

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).
3527

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

@@ -41,7 +33,7 @@ Then run this command to configure your agent to use the MCP server:
4133

4234
<CodeSnippets path="mcp-add.md" />
4335

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.
4537

4638
[`mcp-add`](https://github.com/paoloricciuti/mcp-add) is a CLI tool designed to simplify adding MCP servers to various agents.
4739

@@ -65,7 +57,7 @@ When working on UI components, always use the `your-project-sb-mcp` MCP tools to
6557
Remember: A story name might not reflect the property name correctly, so always verify properties through documentation or example stories before using them.
6658
```
6759

68-
Finally, test your agent's access to the MCP server by running a 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.
6961

7062
## Usage
7163

docs/ai/mcp/sharing.mdx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
11
---
22
title: Sharing your MCP server
3-
hideRendererSelector: true
43
sidebar:
54
order: 3
65
title: Sharing
76
---
87

9-
<If notRenderer={['react']}>
10-
11-
<Callout variant="info">
8+
<Callout variant="info" icon="🧪">
129
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>
1410

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>
1713

1814
<If renderer={['react']}>
1915

20-
<Callout variant="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-
2416
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.
2517

2618
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

Comments
 (0)