|
| 1 | +# Storybook Addon MCP Server Instructions |
| 2 | + |
| 3 | +This server provides tools to help you build, preview, and test Storybook UI components. |
| 4 | + |
| 5 | +## Before Writing or Editing Stories |
| 6 | + |
| 7 | +Always call **get-storybook-story-instructions** first to get framework-specific guidance. This tool returns the correct imports, patterns, and conventions for the current project. Do not skip this step. |
| 8 | + |
| 9 | +## Story Preview Workflow |
| 10 | + |
| 11 | +After writing or modifying a component or story, call **preview-stories** to retrieve the live preview URLs. Always include these URLs in your response so the user can verify the visual output. |
| 12 | + |
| 13 | +## Story Testing Workflow |
| 14 | + |
| 15 | +When tests are available (run-story-tests tool is present), run tests after writing or changing stories. Fix any failures before reporting success. Do not report stories as complete if tests are failing. |
| 16 | + |
| 17 | +## Component Documentation Workflow (docs toolset) |
| 18 | + |
| 19 | +When the docs toolset is available: |
| 20 | + |
| 21 | +1. Call **list-all-documentation** once to discover available components and docs IDs. |
| 22 | +2. Call **get-documentation** with a specific ID to retrieve full component props, usage examples, and stories. |
| 23 | +3. Call **get-documentation-for-story** when you need documentation scoped to a specific story variant. |
| 24 | +4. Never assume prop names, variants, or component API — always retrieve documentation first. |
| 25 | +5. Only reference IDs returned by list-all-documentation. Do not guess IDs. |
| 26 | + |
| 27 | +## Toolset Availability |
| 28 | + |
| 29 | +Tools are grouped into toolsets. Check which tools are available before assuming a workflow is possible: |
| 30 | + |
| 31 | +- **dev**: preview-stories, get-storybook-story-instructions |
| 32 | +- **docs**: list-all-documentation, get-documentation, get-documentation-for-story |
| 33 | +- **test**: run-story-tests |
| 34 | + |
| 35 | +Toolsets can be restricted per-request via the `X-MCP-Toolsets` header. When a toolset's tools are not listed, that toolset is disabled for this request. |
0 commit comments