A comprehensive design system with Model Context Protocol (MCP) integration, featuring a React frontend with Storybook documentation and a Node.js backend that provides AI-powered component discovery and code generation capabilities.
This is a monorepo containing:
- Frontend: React-based design system with Storybook documentation
- Backend: MCP server for AI integration with component discovery and code generation
- Integration: Seamless connection between design system and AI tools
- Modern React Components: Button, Card, Input, and more
- Storybook Documentation: Interactive component playground
- Tailwind CSS: Utility-first styling
- TypeScript: Full type safety
- Hot Module Replacement: Fast development experience
- Component Discovery: AI-powered component search and listing
- Code Generation: Automatic JSX code generation with props
- Storybook Integration: Real-time scraping of component documentation
- Caching: Performance optimization with intelligent caching
- Multiple Tools: Comprehensive API for component interaction
- React 18 - UI library
- Vite - Build tool and dev server
- Storybook 7 - Component documentation
- Tailwind CSS 4 - Styling framework
- TypeScript - Type safety
- Node.js - Runtime environment
- Model Context Protocol (MCP) - AI integration protocol
- Express - Web framework (if needed)
- Cheerio - HTML parsing for Storybook scraping
- Node Cache - Performance caching
- Zod - Schema validation
Versatile button component with multiple variants:
- Variants: primary, secondary, outline, ghost
- Sizes: sm, md, lg
- States: normal, disabled
Flexible container component:
- Variants: default, elevated, outlined
- Padding: sm, md, lg
- Features: optional title and subtitle
Form input component with validation:
- Types: text, email, password, number, tel, url
- Sizes: sm, md, lg
- States: normal, error, disabled, required
- Features: label, help text, error message
- Node.js 18+
- pnpm (recommended) or npm
- Clone the repository
git clone <repository-url>
cd system-design-mcp- Install dependencies
# Install all dependencies (root + frontend + backend)
pnpm install:all
# Or install individually
pnpm install
pnpm --filter frontend install
pnpm --filter backend install# Start both frontend and backend concurrently
pnpm dev# Frontend only (Vite dev server)
pnpm dev:frontend
# Backend only (MCP server)
pnpm dev:backend
# Storybook only
pnpm dev:storybook- Frontend Application: http://localhost:5173
- Storybook Documentation: http://localhost:6006
- MCP Server: Runs via stdio (for AI integration)
The backend provides several AI-powered tools for component interaction:
Lists all available components in the design system.
Retrieves detailed information about a specific component including:
- Props and their types
- Default values
- Descriptions
- Available examples
Generates JSX code for a component with specific properties.
Searches components by functionality or keywords.
Retrieves usage examples for a specific component.
Verifies Storybook accessibility and status.
system-design-mcp/
βββ frontend/ # React design system
β βββ src/
β β βββ components/ # Reusable components
β β β βββ Button.tsx
β β β βββ Button.stories.tsx
β β β βββ Card.tsx
β β β βββ Card.stories.tsx
β β β βββ Input.tsx
β β β βββ Input.stories.tsx
β β β βββ index.ts
β β βββ App.tsx
β β βββ main.tsx
β β βββ index.css
β βββ .storybook/ # Storybook configuration
β βββ package.json
β βββ vite.config.ts
βββ backend/ # MCP server
β βββ src/
β β βββ mcp-server.ts # Main MCP server implementation
β βββ package.json
β βββ tsconfig.json
βββ package.json # Root package.json
βββ pnpm-workspace.yaml # Monorepo configuration
βββ README.md
- Create the component in
frontend/src/components/ - Create the story in
frontend/src/components/[Component].stories.tsx - Export the component in
frontend/src/components/index.ts - View in Storybook:
pnpm dev:storybook - View in app:
pnpm dev:frontend
- Develop component in
frontend/src/components/ - Create interactive stories for documentation
- Test component in Storybook
- MCP server automatically discovers new components
- AI tools can immediately access component information
The MCP server enables AI tools to:
- Discover Components: Automatically find all available components
- Understand Props: Get detailed prop information and types
- Generate Code: Create JSX code with proper props
- Search Components: Find components by functionality
- Access Examples: Get real usage examples from Storybook
// AI can ask: "Show me all button components"
// MCP responds with: Button component details, props, examples
// AI can ask: "Generate a primary button with 'Click me' text"
// MCP responds with: <Button variant="primary">Click me</Button>pnpm buildpnpm build:frontend
pnpm build:backendpnpm start# Run backend tests
pnpm testCreate a .env file in the backend directory:
STORYBOOK_URL=http://localhost:6006
STORYBOOK_API_URL=http://localhost:6006
CACHE_TIMEOUT=300- Fork the repository
- Create a feature branch
- Add your component with proper stories
- Test in Storybook
- Submit a pull request
MIT License - see LICENSE file for details
- Model Context Protocol Documentation
- Storybook Documentation
- Tailwind CSS Documentation
- React Documentation
Built with β€οΈ for modern design systems and AI integration