mcp-design-system-extractor

v1.3.0
io.github.freema/mcp-design-system-extractor Checked 15 hours ago Published 25 days ago

MCP server for Storybook design systems — extract component HTML, styles and metadata.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_components

List all UI components available in your design system/Storybook. Returns components like modals, dialogs, buttons, forms, cards, etc. with their names, categories, and variant count. Use this to explore what components are available for building UI features. Use category="all" or omit category parameter to list all components. Supports pagination to handle large component libraries.

ParameterTypeDescription
categorystringFilter components by category path (e.g., "Components/Buttons", "Layout"). Use "all" or omit to list all components.
compactbooleanIf true (default), returns compact format with only id, name, title, and variantCount. If false, returns full component data including all stories.
pagenumberPage number (1-based). Default is 1.
pageSizenumberNumber of components per page (1-100). Default is 20.

get_component_html

Extract HTML from a component. Default is async (returns job_id, poll with job_status). Set async=false for sync mode. Use variantsOnly=true to get variant list.

ParameterTypeDescription
componentId *stringThe story ID in format "component-name--story-name" (e.g., "button--primary") or component ID (e.g., "button") when using variantsOnly.
asyncbooleanIf true (default), returns job_id immediately - use job_status to poll for results. If false, waits for result synchronously.
includeStylesbooleanWhether to include extracted CSS styles in the response. Storybook boilerplate CSS is filtered out. Default: false.
timeoutnumberCustom timeout in milliseconds (5000-60000). Only used in sync mode (async=false). Default is 15000ms.
variantsOnlybooleanIf true, returns only the list of available variants/stories for the component (synchronous). Use component ID without story suffix.

search_components

Search design system components by name, title, category, or purpose. Find UI components like modals, dialogs, buttons, forms, cards, etc. Supports text search (query) and semantic search by purpose. Available purposes: "form inputs", "navigation", "feedback", "data display", "layout", "buttons", "progress", "media". Supports pagination for large result sets.

ParameterTypeDescription
pagenumberPage number (1-based). Default is 1.
pageSizenumberNumber of components per page (1-100). Default is 20.
purposestringSemantic search by purpose. Available: "form inputs", "navigation", "feedback", "data display", "layout", "buttons", "progress", "media". Can be combined with query.
querystringText search query (e.g., "button", "form", "nav"). Use "*" to list all. Case-insensitive partial matching. Optional if purpose is provided.
searchInstringWhere to search: "name" (component name only), "title" (full path), "category" (grouping), or "all" (search everywhere, default)

get_component_dependencies

Analyze rendered HTML to find which other components a given component internally uses by detecting React components, web components, and CSS class patterns

ParameterTypeDescription
componentId *stringThe story ID of the component (e.g., "example-button--primary")

get_theme_info

Get design system theme information (colors, spacing, typography, breakpoints)

ParameterTypeDescription
includeAllbooleanWhether to include all CSS custom properties found (default: false)

get_external_css

Extract design tokens from CSS files. DEFAULT BEHAVIOR: Returns ONLY tokens and file statistics (small response ~1-3K tokens). Does NOT return CSS content by default to avoid token limits. For full CSS content, explicitly set includeFullCSS=true and maxContentSize. Perfect for analyzing design system tokens without hitting response size limits.

ParameterTypeDescription
cssUrl *stringURL of CSS file to analyze. IMPORTANT: Tool returns only design tokens by default (not CSS content) to avoid response size limits.
extractTokensbooleanExtract design tokens (colors, spacing, typography, etc.). Default: true. This is the main purpose of this tool.
includeFullCSSbooleanOPTIONAL: Set to true ONLY if you need the actual CSS content. WARNING: Large CSS files may hit token limits. Default: false (recommended).
maxContentSizenumberOPTIONAL: Max CSS content characters when includeFullCSS=true. Default: 10000. Larger files will be truncated.

job_status

Check the status of an async job. Returns status, progress, and result when completed. Poll this endpoint to get results from get_component_html.

ParameterTypeDescription
job_id *stringThe job ID returned from get_component_html

job_cancel

Cancel a queued or running job. Returns whether the cancellation was successful.

ParameterTypeDescription
job_id *stringThe job ID to cancel

job_list

List all jobs with their status. Shows what each job is processing and whether it is still running.

ParameterTypeDescription
statusstringFilter by status: "all" (default), "active" (queued/running), "completed" (completed/failed/cancelled)