@classic-homes/theme-mcp 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,186 @@
1
+ # @classic-homes/theme-mcp
2
+
3
+ MCP (Model Context Protocol) server for the Classic Theme design system. This package enables AI assistants like Claude to understand and correctly use Classic Theme components, design tokens, layout patterns, and validation schemas.
4
+
5
+ ## Why Use This?
6
+
7
+ When AI assistants have access to the MCP server, they can:
8
+
9
+ - **Generate correct component code** with proper props and variants
10
+ - **Follow design system patterns** for layouts and forms
11
+ - **Use the right design tokens** for colors, spacing, and typography
12
+ - **Validate usage** to catch errors before runtime
13
+ - **Speed up development** by eliminating guesswork
14
+
15
+ ## Quick Start
16
+
17
+ ### With npx (no installation)
18
+
19
+ ```bash
20
+ npx @classic-homes/theme-mcp
21
+ ```
22
+
23
+ ### Install globally
24
+
25
+ ```bash
26
+ npm install -g @classic-homes/theme-mcp
27
+ classic-theme-mcp
28
+ ```
29
+
30
+ ### Install in a project
31
+
32
+ ```bash
33
+ npm install --save-dev @classic-homes/theme-mcp
34
+ ```
35
+
36
+ ## Configure Claude Code
37
+
38
+ Add to your `~/.claude/settings.json`:
39
+
40
+ ```json
41
+ {
42
+ "mcpServers": {
43
+ "classic-theme": {
44
+ "command": "npx",
45
+ "args": ["@classic-homes/theme-mcp"]
46
+ }
47
+ }
48
+ }
49
+ ```
50
+
51
+ Or for a local installation:
52
+
53
+ ```json
54
+ {
55
+ "mcpServers": {
56
+ "classic-theme": {
57
+ "command": "node",
58
+ "args": ["./node_modules/@classic-homes/theme-mcp/dist/cli.js"]
59
+ }
60
+ }
61
+ }
62
+ ```
63
+
64
+ Restart Claude Code after updating the configuration.
65
+
66
+ ## What's Included
67
+
68
+ ### Resources (Read-Only Data)
69
+
70
+ | Resource | Description |
71
+ | ----------------------------- | -------------------------------------------------- |
72
+ | `components://catalog` | All 45+ components with props, variants, examples |
73
+ | `components://list` | Component names and categories |
74
+ | `components://{name}` | Individual component (e.g., `components://Button`) |
75
+ | `components://category/{cat}` | Filter by category |
76
+ | `tokens://colors` | Brand and semantic color palette |
77
+ | `tokens://spacing` | Spacing scale (0-96) |
78
+ | `tokens://typography` | Font families, sizes, weights |
79
+ | `patterns://layouts` | Dashboard, public, auth, error layouts |
80
+ | `patterns://forms` | Login, registration, contact forms |
81
+ | `schemas://auth` | Auth validation schemas |
82
+ | `schemas://common` | Common validation schemas |
83
+
84
+ ### Tools (Queryable Functions)
85
+
86
+ | Tool | Description |
87
+ | -------------------------- | ---------------------------------------------- |
88
+ | `search_components` | Find components by name/category/functionality |
89
+ | `get_component_props` | Get detailed props for a component |
90
+ | `suggest_pattern` | Get recommended pattern for a use case |
91
+ | `validate_component_usage` | Check if usage follows guidelines |
92
+
93
+ ### Prompts (Templates)
94
+
95
+ | Prompt | Description |
96
+ | ----------------- | -------------------------------- |
97
+ | `build_form` | Generate form with validation |
98
+ | `layout_page` | Generate page layout |
99
+ | `component_usage` | Generate component usage example |
100
+
101
+ ## Example Interactions
102
+
103
+ ### Ask Claude to create a dashboard
104
+
105
+ ```
106
+ "Create a dashboard page with sidebar navigation and a data table"
107
+ ```
108
+
109
+ Claude will use the MCP to look up `DashboardLayout` props, `DataTable` configuration, and generate correct TypeScript code.
110
+
111
+ ### Ask about component variants
112
+
113
+ ```
114
+ "What variants does the Alert component have?"
115
+ ```
116
+
117
+ Claude queries `get_component_props` and returns: default, destructive, success, warning, info.
118
+
119
+ ### Generate a form
120
+
121
+ ```
122
+ "Create a contact form with name, email, and message fields"
123
+ ```
124
+
125
+ Claude uses the `build_form` prompt to generate a form with `FormField` components, Zod validation, and proper error handling.
126
+
127
+ ## Component Categories
128
+
129
+ - **core**: Button, Input, Card, Badge, Label, etc.
130
+ - **form**: FormField, Select, Checkbox, RadioGroup, Slider, etc.
131
+ - **layout**: DashboardLayout, PublicLayout, AuthLayout, ErrorLayout
132
+ - **feedback**: Toast, Spinner, Skeleton, Alert
133
+ - **data**: DataTable, Tabs
134
+ - **overlay**: Dialog, AlertDialog, Tooltip, DropdownMenu
135
+ - **navigation**: Sidebar, Header, Footer, QuickLinks
136
+ - **branding**: LogoMain, LoadingLogo
137
+
138
+ ## For Package Maintainers
139
+
140
+ ### Regenerate Catalog
141
+
142
+ When Classic Theme components are updated:
143
+
144
+ ```bash
145
+ npm run generate
146
+ npm run build
147
+ ```
148
+
149
+ ### Build
150
+
151
+ ```bash
152
+ npm run build # Generate catalog + build
153
+ npm run build:fast # Build only (skip generation)
154
+ ```
155
+
156
+ ### Test Locally
157
+
158
+ ```bash
159
+ # Run the server
160
+ npm run start
161
+
162
+ # Test with MCP Inspector
163
+ npx @modelcontextprotocol/inspector node dist/cli.js
164
+ ```
165
+
166
+ ## Requirements
167
+
168
+ - Node.js 18 or later
169
+ - Classic Theme packages installed in your project (for full functionality)
170
+
171
+ ## Related Packages
172
+
173
+ - `@classic-homes/theme-svelte` - Svelte component library
174
+ - `@classic-homes/theme-react` - React component library
175
+ - `@classic-homes/theme-tokens` - Design tokens
176
+ - `@classic-homes/theme-tailwind-preset` - Tailwind configuration
177
+
178
+ ## Documentation
179
+
180
+ - [AI Integration Guide](https://theme.classichomes.com/svelte/docs/getting-started/ai-integration)
181
+ - [Component Documentation](https://theme.classichomes.com/svelte/docs/components/button)
182
+ - [Getting Started](https://theme.classichomes.com/svelte/docs/getting-started/installation)
183
+
184
+ ## License
185
+
186
+ MIT
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node