Transform React design systems into AI-ready registries - Extract, validate, and distribute components with full AI compatibility.
DCP is the universal protocol for design system interoperability. Currently production-ready for React/TypeScript codebases, with support for other frameworks coming soon.
π― What's Ready β | π§ What's Coming β
- β React/TypeScript Extraction: Enterprise-grade component extraction with hybrid Babel + TypeScript analysis
- β Multi-Source Token Extraction: CSS variables, Tailwind, Radix UI, CSS Modules
- β Registry Generation: DCP schema-compliant registries with ShadCN compatibility
- β MCP Integration: Full Model Context Protocol server for AI agent integration (Claude Desktop, ChatGPT)
- β Component Packs: Self-contained, distributable packages with zero-fetch installation
- β CLI Toolkit: 30+ commands for extraction, validation, mutation, and distribution
- β REST API: Express-based API server with OpenAPI specification
- β Watch Mode: Hot reload with WebSocket support for live updates
# Install DCP Toolkit
npm install -g @dcp/toolkit
# Extract components from React codebase
dcp extract ./src/components --out ./registry
# Validate the registry
dcp validate-registry ./registry/registry.json
# Start API server
dcp api --port 3000 --registry ./registry
# Export for AI agents (MCP format)
dcp export-mcp ./registry/registry.json --optimize-for claude# Extract from a React/TypeScript codebase
dcp extract ./src/components --auto-detect-tokens --out ./registry
# This generates:
# βββ registry/
# β βββ components/
# β β βββ Button.dcp.json # Button component
# β β βββ Card.dcp.json # Card component
# β β βββ ...
# β βββ tokens/
# β β βββ colors.json # Color tokens
# β β βββ spacing.json # Spacing tokens
# β β βββ ...
# β βββ registry.json # Main registry fileNEW in v3.1.0: Production-ready component browser with search, filters, and AI integration.
# Build packs with Browse UI
dcp registry build-packs ./registry/registry.json --out ./dist/packs
# Serve with visual browser
dcp registry serve ./dist/packs --port 7401
# Open http://localhost:7401 in your browser- Visual Component Grid - Browse all components with descriptions and metadata
- Smart Search - Find components by name, description, or props
- Facet Filters - Filter by namespace, type, or category
- Copy Install Commands - One-click copy for npm, pnpm, yarn, or bun
- Shareable Links - Deep link to specific components (
#ui/button) - AI Prompts - Copy-ready prompts for AI tools (Claude, ChatGPT)
- Staleness Indicator - See when registry was last updated
- Dark Theme - Beautiful, accessible UI with keyboard navigation
- Mobile Responsive - Works on all devices
Designers: Find components in seconds, share links in Figma comments
PMs: Copy shareable links for Slack/Jira, see freshness indicators
Engineers: Copy exact install commands for your package manager
AI Users: Bridge to AI tools without learning MCP
DCP evolves ShadCN's pioneering "copy, don't install" pattern with enterprise features:
# Install from any registry (zero-fetch, single HTTP request)
dcp registry add "https://demo.dcp.dev/r/ui/button"
# Install specific version
dcp registry add "http://localhost:7401/r/ui/[email protected]"
# Install from local packs (no network needed)
dcp registry add "./dist/packs/r/ui/avatar"
# Install from private registry with auth
dcp registry add "https://internal.company.com/r/ui/button" --token secret# 1. Extract your design system
dcp extract ./src/components --out ./registry
# 2. Build distributable packs (includes Browse UI)
dcp registry build-packs ./registry/registry.json --out ./dist/packs
# 3. Serve with visual browser
dcp registry serve ./dist/packs --port 7401
# 4. Browse at http://localhost:7401 or install directly
dcp registry add "http://localhost:7401/r/ui/button" --verboseπ ShadCN vs DCP Comparison β - See how DCP builds on ShadCN's foundation
π¦ Component Packs Guide β - Full distribution & installation docs
- Props with full TypeScript type information
- Variants (CVA support, object literals)
- Composition patterns (slots, subcomponents)
- JSDoc comments and descriptions
- Component families (Dialog β DialogHeader, etc.)
- Barrel file recursion (follows re-exports)
- CSS custom properties (
--variable-name) - Tailwind CSS classes β tokens (JSON configs)
- CSS Modules (co-located
.cssfiles) - Radix UI tokens (JSON format)
- Multi-source token merging and normalization
- Component confidence scores
- Source tracking (AST analysis, TypeScript)
- Token usage mapping
- Theme context awareness
- Extraction timestamps
| Command | Description | Status | Example |
|---|---|---|---|
extract |
Extract components from source | β Ready | dcp extract ./src --out ./registry |
validate |
Validate registry/project | β Ready | dcp validate-registry registry.json |
build |
Build registry from config | β Ready | dcp build --config dcp.config.json |
query |
Query registry with selectors | β Ready | dcp query "components where name = 'Button'" |
mutate |
Apply JSON Patch mutations | β Ready | dcp mutate registry.json patch.json output.json |
watch |
Watch mode with hot reload | β Ready | dcp watch ./src --ws 7070 |
api |
Start REST API server | β Ready | dcp api --port 3000 |
export-mcp |
Export for AI agents | β Ready | dcp export-mcp registry.json --optimize-for claude |
# Start MCP server for Claude Desktop
dcp-mcp --stdio
# Or HTTP mode for remote clients
dcp-mcp-http --port 3000
# Export registry for AI consumption
dcp export-mcp registry.json --optimize-for claude# Generate ShadCN-compatible registry
dcp registry generate ./src/components --format shadcn --out ./shadcn-registry# Install Storybook addon
npm install --save-dev @dcp/storybook-addon-registry
# Start watch mode with WebSocket
dcp watch ./src --ws 7070
# Add to Storybook config - see docs for details# Start API server
dcp api --port 3000 --registry ./registry
# Access endpoints
curl http://localhost:3000/api/v1/registry
curl http://localhost:3000/docs # Swagger UIDCP-Transformer/
βββ packages/
β βββ dcp-toolkit/ # Main CLI and extraction engine
β βββ dcp-validator/ # Registry validation tools
β βββ storybook-addon-registry/ # Storybook integration
βββ registry/ # Canonical DCP registry
β βββ components/ui/ # Individual UI components
β βββ components/blocks/ # Compound components
β βββ themes/ # Design token definitions
β βββ manifest.json # Registry manifest
βββ tests/
β βββ fixtures/ # Test design systems
β β βββ baseweb/ # Uber's Base Web
β β βββ fluentui/ # Microsoft Fluent UI
β β βββ shadcn/ # ShadCN UI examples
β βββ snapshots/ # Test output snapshots
βββ docs/ # Protocol documentation
DCP has been tested with real production design systems:
- π Uber Base Web - Complex React components with theming β
- π’ Microsoft Fluent UI - Large-scale enterprise components β
- β‘ ShadCN UI - Modern utility-first components β
- π¨ Custom Systems - React/TypeScript component libraries β
Performance: Successfully extracted 121+ components, handles 1000+ line components, processes deep barrel files (10+ levels)
{
"$schema": "https://dcp.dev/schemas/registry.schema.json",
"name": "my-component",
"type": "registry:ui",
"title": "My Component",
"description": "A reusable UI component",
"files": [
{
"path": "components/ui/my-component.tsx",
"type": "registry:component",
"content": "/* inline content for zero-fetch installs */"
}
],
"cssVars": {
"light": { "background": "hsl(0 0% 100%)" },
"dark": { "background": "hsl(222.2 84% 4.9%)" }
},
"meta": {
"confidence": 0.95,
"source": "ast-analysis"
}
}registry:ui- Individual UI componentsregistry:block- Compound components and layoutsregistry:theme- Design token collectionsregistry:hook- React hooks and utilitiesregistry:style- CSS and styling files
DCP provides full Model Context Protocol (MCP) integration for AI agents:
Available Now:
- β MCP Server (stdio + HTTP modes)
- β Component/token query tools
- β Registry resource access
- β Hot reload support
- β Claude Desktop integration
- β ChatGPT/remote MCP support
MCP Tools Available:
query_registry- Query components and tokensget_component- Get component detailsget_token- Get token detailsvalidate_registry- Validate registry structureextract_components- Extract from source
- What's Ready - Production-ready features with examples
- What's Coming - Roadmap and incomplete features
- ShadCN vs DCP - How DCP evolves ShadCN's patterns
- Component Packs - Distribution & installation guide
- API Quickstart - API usage guide
- Extraction Capabilities - Detailed extraction guide
- MCP Integration - AI agent integration
- Claude Desktop Setup - MCP server configuration
# Clone repository
git clone https://github.com/stevewitmer/dcp-transformer
cd dcp-transformer
# Install dependencies
npm install
# Run tests
npm test
# Build packages
npm run buildPrimary Position: "The OpenAPI for Design Systems"
- Protocol-first approach with standardized schemas
- Ecosystem compatibility (ShadCN, Storybook, AI agents)
- Enterprise-ready validation and safety features
Key Differentiators:
- β Extracts ANY React library (not just a component library)
- β AI-ready metadata via MCP protocol
- β Zero-fetch installation for component distribution
- β Production-tested with real design systems
Perfect For:
- Design system maintainers (React/TypeScript)
- AI/LLM integration teams
- Component library authors
- Design tooling companies
- GitHub: stevewitmer/dcp-transformer
- Issues: Report bugs or request features
- Discussions: Join the conversation
Currently in development or planned:
β οΈ Vue.js Adaptor - Vue SFC template parsing (Q3 2025)β οΈ Svelte Adaptor - Svelte component extraction (Q3 2025)β οΈ CSS-in-JS Full Extraction - styled-components, emotion (Q2 2025)β οΈ Agent Mode LLM Integration - OpenAI/Claude API (Q2 2025)β οΈ Visual Diff/Preview - Screenshot comparison (Q3 2025)β οΈ Registry Federation - Multi-registry composition (Q4 2025)
See: What's Coming β for detailed roadmap and timelines
MIT License - see LICENSE for details.
Protocol Spec β’ Documentation β’ Examples β’ Contributing
Made with β€οΈ for the design systems community