MCP server API
Storybook's AI capabilities are in preview. The API may change in future releases. We welcome feedback and contributions to help improve this feature.
@storybook/addon-mcp options
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:
// Replace your-framework with the framework you are using (e.g., react-vite, angular-vite, vue3-vite)
import { defineMain } from '@storybook/your-framework/node';
export default defineMain({
framework: '@storybook/your-framework',
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
// ... your existing addons
{
name: '@storybook/addon-mcp',
options: {
toolsets: {
dev: false,
},
},
},
],
});toolsets
Type:
{
dev?: boolean;
docs?: boolean;
test?: boolean;
}Default:
{
dev: true,
docs: true,
test: true,
}Configuration object to toggle which toolsets are enabled in the MCP server. By default, all toolsets are enabled.
dev
Type: boolean
Default: true
The development toolset includes the stories-changed, get-storybook-story-instructions, stories-preview, stories-find-by-component, and review-create tools. stories-find-by-component requires a builder that supports the module graph.
docs
Type: boolean
Default: true
The docs toolset includes the docs-show, docs-show-story, and docs-list tools when a components manifest is generated for your framework.
test
Type: boolean
Default: true
The testing toolset includes the test-run tool when @storybook/addon-vitest is installed and enabled.
More AI resources
