MCP server API
@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:
.storybook/main.ts
// Replace your-framework with the framework you are using (e.g., react-vite, vue3-vite, angular, etc.)
import type { StorybookConfig } from '@storybook/your-framework';
const config: StorybookConfig = {
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,
},
},
},
],
};
export default config;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 get-storybook-story-instructions and preview-stories tools.
docs
Type: boolean
Default: true
The docs toolset includes the get-documentation, get-documentation-for-story, and list-all-documentation tools.
test
Type: boolean
Default: true
The testing toolset includes the run-story-tests tool.
More AI resources
