Introduction
Connect and interact with the Thrive Design System using the Model Context Protocol (MCP) Server
Introduction
Connect and interact with the Thrive Design System using the Model Context Protocol (MCP) Server
The Thrive Design System includes a Model Context Protocol (MCP) Server that enables AI assistants, development tools, and external applications to interact with our design system. This powerful integration layer allows you to search components, fetch documentation, generate code examples, and access design tokens programmatically.
What is MCP?
The Model Context Protocol is an open protocol for connecting AI assistants and applications to external data sources. It allows seamless integration between AI tools and your design system.
Search across all components in the design system with semantic understanding. Find what you need based on functionality, not just keyword matching.
Fetch comprehensive documentation for any component, including props, examples, usage guidelines, and best practices.
Access all design tokens including colors, typography scales, spacing values, and semantic tokens.
Generate code examples and integration snippets for components tailored to your specific use case.
Direct links to interactive Storybook examples for visual exploration and testing.
The MCP Server is included with the design system. To enable it:
The server configuration can be found in the .mcp directory of the design system docs:
cd apps/design-system-docsEdit your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Add the following configuration:
{
"mcpServers": {
"thrive-design-system": {
"command": "node",
"args": [
".mcp/server/index.js"
],
"cwd": "/path/to/thrive-campaign/apps/design-system-docs"
}
}
}Close and reopen Claude Desktop to load the new MCP server configuration.
Once set up, you can verify the MCP server is working by asking Claude:
Search for button components in the Thrive design systemOr:
Show me the documentation for the Avatar componentsearch_componentsSearch for components in the design system.
Parameters:
query (string): Search query describing the component you needmaxResults (number, optional): Maximum number of results to return (default: 5)Example:
Search for components related to data tables and sortingget_component_docsFetch complete documentation for a specific component.
Parameters:
componentName (string): Name of the component (e.g., "Button", "Avatar", "Card")sections (array, optional): Specific sections to retrieve (e.g., ["props", "examples", "guidelines"])Example:
Get the documentation for Button component, focusing on props and examplesget_design_tokensRetrieve design tokens by category.
Parameters:
category (string, optional): Token category ("colors", "typography", "spacing", "shadows", "all")format (string, optional): Output format ("css", "json", "typescript")Example:
Get all color design tokens in CSS formatgenerate_component_exampleGenerate a code example for using a component.
Parameters:
componentName (string): Name of the componentuseCase (string): Description of the specific use caseincludeImports (boolean): Whether to include import statementsExample:
Generate an example for the Dialog component showing a confirmation dialog for deleting an itemget_storybook_urlGet the Storybook URL for a component with optional story specification.
Parameters:
componentName (string): Name of the componentstoryName (string, optional): Specific story to link toExample:
Get the Storybook URL for Button component showing all variantsScenario: You're building a new feature and need to quickly find and integrate a component.
"Search for form input components with validation support"The MCP server will:
Scenario: You need to check the exact props for a component you're using.
"Show me all the props for the Avatar component, especially size and status options"You'll get:
Scenario: You need to use the correct color token in your CSS.
"Get all primary color design tokens in CSS custom property format"Results include:
Scenario: You need a specific component configuration quickly.
"Generate an example of a DataTable with sorting, filtering, and row selection"The generated code will:
The primary use case is with Claude Desktop. Once configured, you can ask natural language questions:
Examples:
"What components do I need to build a user settings page with a profile avatar, notification preferences, and save button?""Show me examples of the Dialog component being used for destructive confirmations""Generate a Card component with header, footer, and action buttons following the design system patterns"The MCP server can be integrated with other tools that support the Model Context Protocol:
Include context about your use case to get more relevant results. Instead of "show me buttons," say "show me buttons for a form submission with loading state."
For complex features, break down your request into smaller, focused queries. Start broad, then narrow down.
Always review and test generated code examples. They're starting points that may need customization for your specific needs.
Not all components may be available in the current version. Check component status and availability.
Always check the Storybook links to see components in action. Visual exploration catches issues that documentation might miss.
When generating code, ensure accessibility is maintained. The MCP server includes accessibility info, but always verify ARIA attributes and keyboard navigation.
Problem: Claude Desktop can't connect to the MCP server.
Solutions:
claude_desktop_config.json is correct.mcp/server/index.js file existsProblem: Queries return no results.
Solutions:
Problem: Documentation or examples seem outdated.
Solutions:
For programmatic access to the MCP server, see the API documentation in .mcp/API.md.
For issues or questions about the MCP server:
Ready to Get Started?
Once configured, the MCP server provides instant access to your entire design system from Claude or any MCP-compatible tool. Start with simple queries and build up to complex, multi-component features.