@storybook/mcp weekly downloads statistics
By storybook (2 listings) · npm · MCP servers
MCP server that serves knowledge about your components based on your Storybook stories and documentation
@storybook/mcp has 1,130,743 recorded weekly downloads on npm, a decrease of 45.0% over the past 30 days, ranking #194 of 2,322 tracked listings.
About @storybook/mcp
Storybook MCP
Reusable MCP package for Storybook component and docs knowledge.
Learn more about Storybook at storybook.js.org.
Self-hosting @storybook/mcp
This package is a library: the tarball ships one module and no executable. It declares no bin,
starts no process, and has no CLI. You register its tools on an MCP server you own, using the
snippets below. If you want a running Storybook MCP server with no code at all, use the dev server
instead — storybook dev serves one at /mcp through @storybook/addon-mcp.
Prerequisites
- Node.js 20+
- A manifests source containing:
components.json(required)docs.json(optional)
Example implementation
The Storybook repository has a local HTTP server built on this package,
serve.ts, that loads
manifests from a directory or URL. It is a development harness and is not part of the published
package.
The snippets below cover the common self-hosting patterns.
Minimal implementation
import { createStorybookMcpHandler } from '@storybook/mcp';
const storybookMcpHandler = await createStorybookMcpHandler();
export async function handleRequest(request: Request): Promise<Response> {
if (new URL(request.url).pathname === '/mcp') {
return storybookMcpHandler(request);
}
return new Response('Not found', { status: 404 });
}
With custom manifest source
Use manifestProvider when your manifests are not available from the same origin/path layout:
const storybookMcpHandler = await createStorybookMcpHandler({
manifestProvider: async (_request, path) => {
return asyncReadManifestFromSomewhere(path);
},
});
API reference
createStorybookMcpHandler
Type:
(options?: StorybookMcpHandlerOptions) => Promise<Handler>;
type Handler = (req: Request, context?: StorybookContext) => Promise<Response>;
Creates and configures an MCP HTTP handler with all built-in docs tools registered.
Parameters
options
Type: StorybookMcpHandlerOptions
Default: {}
Server-level configuration. The handler uses this at creation time and as a fallback for per-request context.
Returns
Type: Promise<Handler>
A fetch-compatible request handler for your /mcp endpoint.
Behavior
- Registers these MCP tools:
- Uses HTTP transport from
@tmcp/transport-http. - For each request, the handler always passes the current
Requestascontext.request. - Per-request
contextoverrides handler-leveloptionsfor:
Note:
onSessionInitializecan only be set at handler creation time (inoptions).
Example
import { createStorybookMcpHandler } from '@storybook/mcp';
const mcp = await createStorybookMcpHandler({
manifestProvider: async (_request, path) => {
return await fetchManifest(path);
},
});
export async function handleRequest(request: Request) {
if (new URL(request.url).pathname !== '/mcp') {
return new Response('Not found', { status: 404 });
}
return mcp(request);
}
Handler options and request context
@storybook/mcp uses the same core fields in two places:
- Handler creation (
createStorybookMcpHandler(options)) - Per-request override (
handler(request, context))
Type:
type StorybookContext = {
request?: Request;
manifestProvider?: (
request: Request | undefined,
path: string,
source?: Source,
) => Promise<string>;
sources?: Source[];
onListAllDocumentation?: (params: {
context: StorybookContext;
manifests: AllManifests;
resultText: string;
sources?: SourceManifests[];
}) => void | Promise<void>;
onGetDocumentation?: (
params:
| {
context: StorybookContext;
input: { id: string; storybookId?: string };
foundDocumentation: ComponentManifest | Doc;
resultText: string;
}
| {
context: StorybookContext;
input: { id: string; storybookId?: string };
},
) => void | Promise<void>;
};
type StorybookMcpHandlerOptions = StorybookContext & {
onSessionInitialize?: (initializeRequestParams: InitializeRequestParams) => void | Promise<void>;
};
[!NOTE]
onSessionInitializeis only used when provided at handler creation time (createStorybookMcpHandler(options)). It is ignored in per-requestcontext.
InitializeRequestParamsis thetmcpinitialize payload type, and its exact structure may change in patch versions. Prefer treating it as an opaque protocol payload unless you need specific fields.
manifestProvider
Type:
(request: Request | undefined, path: string, source?: Source) => Promise<string>;
Primary extension point for production setups.
Use this when manifests are not available at the default same-origin paths. Your function returns the raw JSON string for each requested manifest path.
For a real customization example (switching between HTTP and filesystem-backed manifest loading), see the Example implementation section above.
Manifest paths requested by built-in tools:
./manifests/components.json(required)./manifests/docs.json(optional)
request
Type: Request
The incoming HTTP request for the current call, as a Web Fetch API (WHATWG) Request.…
Description from the npm listing.
- mcp
- storybook
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (544)Similar npm MCP servers plugins
All 20 @storybook/mcp alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@storybook/mcp. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.