You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Model Context Protocol (MCP) server that extracts component information from Storybook design systems. This server connects to a running Storybook instance and extracts HTML, styles, and component metadata directly from the Storybook iframe.
3
+
A Model Context Protocol (MCP) server that extracts component information from Storybook design systems. Connects to Storybook instances (including https://storybook.js.org distributions) and extracts HTML, styles, and component metadata.
4
+
5
+
## Key Dependencies
6
+
7
+
-**Puppeteer**: Uses headless Chrome for dynamic JavaScript component rendering
8
+
-**Chrome/Chromium**: Required for Puppeteer (automatically handled in Docker)
9
+
- Works with built Storybook distributions from https://storybook.js.org
-**Dynamic Content Support**: Uses happy-dom to execute JavaScript and render dynamic content
295
-
-**Smart Caching**: Caches responses for 5 minutes to improve performance
296
-
-**Retry Logic**: Automatically retries failed requests up to 3 times
297
-
-**Timeout Protection**: 10-second timeout on all network requests
298
-
-**Better Error Messages**: Provides helpful suggestions when connections fail
299
-
300
-
It extracts:
301
-
- Component HTML structure (including dynamically rendered content)
302
-
- CSS classes and inline styles
303
-
- Component props and API documentation
304
-
- Component dependencies and relationships
305
-
- Design system tokens and theme information
306
-
- External CSS files and design tokens from Storybook assets
209
+
Connects to Storybook via `/index.json` and `/iframe.html` endpoints. Uses Puppeteer with headless Chrome for dynamic JavaScript rendering. Extracts component HTML, styles, props, dependencies, and design tokens with smart caching and timeout protection.
307
210
308
211
## Troubleshooting
309
212
310
-
### Common Issues
311
-
312
-
**Empty results from list_components or search_components:**
313
-
- Ensure your Storybook is running and accessible at the configured URL
314
-
- Check that `STORYBOOK_URL` environment variable is set correctly
315
-
- Try accessing `/index.json` or `/stories.json` directly in your browser
316
-
- Verify your Storybook has stories configured and published
317
-
- Check the debug information returned in the tool response
318
-
319
-
**"Found 0 components" with category filtering:**
320
-
- Use `category: "all"` or omit the category parameter to see all components first
321
-
- Check available categories from the initial `list_components` call
322
-
- Category names are case-sensitive and must match exactly
323
-
324
-
**Wildcard search not working:**
325
-
- Use `query: "*"` (with quotes) to list all components in search_components
326
-
- Ensure the query parameter is provided as a string
327
-
328
-
**Component HTML extraction fails:**
329
-
- Ensure you're using the exact story ID format: "component-name--story-name"
330
-
- Use `get_component_variants` first to find valid story IDs
331
-
- Check that the story exists and is published in Storybook
332
-
333
-
**Connection issues:**
334
-
- Verify Storybook is running (typically on port 6006)
335
-
- Check CORS configuration in your Storybook
336
-
- Ensure network connectivity to the Storybook URL
337
-
- Try a different URL format (with/without trailing slash)
213
+
- Ensure Storybook is running and `STORYBOOK_URL` is correct
214
+
- Use exact story ID format: "component-name--story-name"
215
+
- Try `list_components` first to see available components
216
+
- Check `/index.json` endpoint directly in browser
217
+
- See [DEVELOPMENT.md](./DEVELOPMENT.md) for detailed troubleshooting
338
218
339
219
## Requirements
340
220
341
221
- Node.js 18+
222
+
- Chrome/Chromium (for Puppeteer)
342
223
- Running Storybook instance
343
-
- Network access to Storybook URL
344
224
345
225
## Development
346
226
347
-
```bash
348
-
# Install dependencies
349
-
npm install
350
-
351
-
# Run TypeScript checks
352
-
npm run typecheck
353
-
354
-
# Run linting
355
-
npm run lint
356
-
357
-
# Build for production
358
-
npm run build
359
-
360
-
# Clean build files
361
-
npm run clean
362
-
```
227
+
See [DEVELOPMENT.md](./DEVELOPMENT.md) for detailed development instructions.
0 commit comments