npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@systemgroupnet/addon-mcp-stencil

v0.1.1

Published

Help agents automatically write and test stories for your UI components

Readme

Storybook MCP Addon

This Storybook addon runs an MCP (Model Context Protocol) server to help develop UI components more efficiently.

It enables a workflow where for each UI component created, the agent will automatically generate and link to example stories. These stories let you visually verify the new UI in each of its key states, and provide documentation and component tests.

The addon provides tools to improve agents' UI development capabilities, retrieve story URLs, and access component documentation.

Getting Started

Installation and Setup

[!NOTE] This addon requires Storybook version 9.1.16 or higher.

Use Storybook's CLI to automatically install and configure the addon:

npx storybook add @storybook/addon-mcp

This command will install the addon and add it to your Storybook configuration automatically.

Start your Storybook development server:

npm run storybook

The MCP server will be available at <your_storybook_dev_server_origin>/mcp when Storybook is running.

Configuration

Addon Options

You can configure which toolsets are enabled by default in your .storybook/main.js:

// .storybook/main.js
export default {
	addons: [
		{
			name: '@storybook/addon-mcp',
			options: {
				toolsets: {
					dev: true, // Tools for story URL retrieval and UI building instructions (default: true)
					docs: true, // Tools for component manifest and documentation (default: true, requires experimental feature flag below 👇)
				},
				experimentalFormat: 'markdown', // Output format: 'markdown' (default) or 'xml'
			},
		},
	],
	features: {
		experimentalComponentsManifest: true, // Enable manifest generation for the docs toolset, only supported in React-based setups.
	},
};

Available Toolsets:

Disabling the Dev Tools is useful when you want to try out the same experience that your external component consumers will get, because they only get the Component Documentation Tools.

Configuring toolsets with headers

You can also configure the available toolsets when setting up the MCP Server in your MCP Client by setting the X-MCP-Toolsets header. The header is a comma-separated list of toolset names, X-MCP-Toolsets: dev,docs. Eg. to configure your client to only have the Component Documentation Tools, the .mcp.json-file could look like this (format depends on the exact client you're using):

{
	"storybook-mcp": {
		"url": "http://localhost:6006/mcp",
		"type": "http",
		"headers": {
			"X-MCP-Toolsets": "docs"
		}
	}
}

Configuring Your Agent

[!NOTE] This addon is primarily tested with Claude Code and GitHub Copilot. While it should work with other MCP clients, Claude Code is our main target for compatibility and testing.

Claude Code Setup

To use this addon with Claude Code, use the built-in MCP configuration command:

  1. Add the MCP server: Run the following command in your terminal:

    claude mcp add storybook-mcp --transport http http://localhost:6006/mcp --scope project
  2. Start Storybook: Make sure your Storybook development server is running:

    npm run storybook
  3. Connect Claude Code: Claude Code should automatically detect and connect to the MCP server when it's running. You can verify the connection by asking Claude to use Storybook-related tools.

  4. Configure Agent Behavior (Optional but Recommended): Add the following system or project prompt to ensure your agent uses the Storybook tools when appropriate:

Before doing any UI, frontend or React development, ALWAYS call the storybook MCP server to get further instructions.

Other MCP Clients

Install MCP Server

This addon should work with any MCP-compatible client that supports the tool capability and the streamable-http transport. Here are setup guides for other popular clients:

For clients not listed above, consult their documentation for MCP server configuration. The server configuration typically requires:

  • Server Type: http
  • URL: http://localhost:6006/mcp (adjust port if your Storybook runs on a different port)
  • ⚠️ Make sure your Storybook development server is running before your agent tries to connect.

Usage

This addon provides MCP tools that your agent can use. The goal is that the agent uses these tools automatically when doing UI development, but agents are unreliable and unpredictable, so sometimes you might need to explicitly tell it to use the tools.

If you are prompting from an IDE like VSCode or Cursor, be sure to use Agent mode and sonnet-4.5 or better.

Dev Tools

These tools are always available when the addon is installed:

1. UI Building Instructions (get_ui_building_instructions)

Provides agents with standardized instructions for UI component development within your project. This tool returns guidelines for:

  • Writing Storybook stories using CSF3 format
  • Component development best practices
  • Story linking requirements

The instructions ensure agents follow your project's conventions when creating or modifying UI components and their corresponding stories.

2. Get Story URLs (get_story_urls)

Allows agents to retrieve direct URLs to specific stories in your Storybook. The agent can request URLs for multiple stories by providing:

  • absoluteStoryPath: Absolute path to the story file
  • exportName: The export name of the story
  • explicitStoryName: Optional explicit story name

Example agent usage:

Prompt: I need to see the primary variant of the Button component

Agent calls tool, gets response:
http://localhost:6006/?path=/story/example-button--primary

Docs Tools (Experimental)

These additional tools are available when the experimental component manifest feature is enabled. They provide agents with detailed documentation about your UI components.

Requirements:

  • Storybook version 10.1.0 or higher (currently only available as prereleases, storybook@next)
  • React-based framework (react-vite, nextjs-vite, nextjs, react-webpack5)
  • Feature flag features.experimentalComponentsManifest set to true in .storybook/main.js

To enable:

// .storybook/main.js
export default {
	// ... other config
	features: {
		experimentalComponentsManifest: true,
	},
};

3. List All Components (list-all-components)

Returns a list of all available UI components in your component library. Useful for the LLM as discovery and understanding what components are available to use.

4. Get Component Documentation (get-component-documentation)

Retrieves detailed documentation for a specific component, including:

  • Component documentation
  • Usage examples

The agent provides a component ID to retrieve its documentation. To get documentation for multiple components, call this tool multiple times.

Contributing

We welcome contributions to improve Storybook's agent integration, within or outside of this addon! Here's how you can help:

  1. Ideas and feature requests: If you have ideas for what else we could do to improve the Storybook experience when using agents, please start a discussion in this repository.

  2. Report Issues: If you find bugs, please open an issue on our GitHub repository, but keep in mind that this is currently highly experimental, explorative and probably filled with bugs.

  3. Development:

See the monorepo readme.