This file helps AI agents and tools work with the Wonder Blocks design system, including the Storybook MCP server.
If you want to use the Wonder Blocks Storybook MCP from another project (e.g. Cursor, Claude Desktop), you run Wonder Blocks locally and point your MCP client at it.
-
Clone the Wonder Blocks repo (if you haven’t already):
git clone git@github.com:Khan/wonder-blocks.git cd wonder-blocks -
Install dependencies and start Storybook (the MCP server runs inside Storybook):
pnpm install pnpm start
Keep this process running. Storybook (and the MCP) will be available at
http://localhost:6061. -
Configure your MCP client to use the local MCP endpoint. Add a server entry that uses the HTTP transport and the URL below.
Example
mcp.json(Cursor and other clients that support HTTP):{ "mcpServers": { "wonder-blocks": { "url": "http://localhost:6061/mcp" } } }Use
http://localhost:6061/mcpas the MCP server URL. No API keys or auth are required for local use.
Note: The MCP is only available while Storybook is running (pnpm start). If you stop Storybook, your MCP client will lose the connection until you start it again.
Wonder Blocks uses @storybook/addon-mcp so agents can discover components, list stories, and use docs tooling.
- The MCP server runs inside the Storybook dev server.
- Start Storybook with:
pnpm start(orpnpm start:storybook). - Storybook (and the MCP endpoint) are only available while that process is running.
| Environment | Storybook UI | MCP endpoint |
|---|---|---|
| Local dev | http://localhost:6061 | http://localhost:6061/mcp |
Note: This repo uses port 6061 (not the default 6006). Use the URL above when connecting an MCP client (e.g. Cursor, Claude Desktop).
In .storybook/main.ts:
- addon-mcp is enabled with
toolsets: { dev: true, docs: true }. - experimentalComponentsManifest is enabled so the addon can expose component metadata.
Typical MCP tools you can use (names may vary by addon version):
- List components / list stories
- Get story details (args, parameters)
- Docs-related tools from the
docstoolset
For full setup (clone, run locally, configure mcp.json), see Installing the MCP (consumer setup) above. In short: run pnpm start in the Wonder Blocks repo, then add http://localhost:6061/mcp to your MCP client config (HTTP transport, no auth for local). If your client expects a different transport (e.g. stdio), see the addon-mcp docs; this repo only runs the in-Storybook HTTP server.
- Packages:
packages/wonder-blocks-*/– each package hassrc/, exports insrc/index.ts. - Stories & docs:
__docs__/– all Storybook stories and MDX live here, grouped by package (e.g.__docs__/wonder-blocks-button/). - Conventions: See
CLAUDE.mdand.cursor/rules/for coding standards, component patterns, and testing. Usepnpm lintandpnpm typecheckbefore submitting.
| Command | Purpose |
|---|---|
pnpm install |
Install dependencies |
pnpm start |
Start Storybook (and MCP) on 6061 |
pnpm build |
Build all packages |
pnpm lint |
Lint |
pnpm typecheck |
Type check |
pnpm test |
Run Jest tests |
pnpm test:storybook |
Run Storybook/Vitest tests |
- Stories: Use consistent
titlehierarchy (e.g.Packages / Button / Button) andargTypesso MCP and autodocs can infer props. - JSDoc: Document component and prop types; the docs toolset and autodocs rely on this.
- Accessibility: Document a11y in MDX (e.g.
*.accessibility.mdx) so agents can reason about roles and behavior.