@framingui/mcp-server 0.6.19 โ†’ 0.6.20

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.
Files changed (44) hide show
  1. package/README.md +79 -990
  2. package/dist/cli/agent-md-templates.d.ts +0 -12
  3. package/dist/cli/agent-md-templates.d.ts.map +1 -1
  4. package/dist/cli/agent-md-templates.js +73 -255
  5. package/dist/cli/agent-md-templates.js.map +1 -1
  6. package/dist/cli/guide-template.d.ts +0 -7
  7. package/dist/cli/guide-template.d.ts.map +1 -1
  8. package/dist/cli/guide-template.js +58 -157
  9. package/dist/cli/guide-template.js.map +1 -1
  10. package/dist/cli/index.d.ts +1 -1
  11. package/dist/cli/index.js +3 -47
  12. package/dist/cli/index.js.map +1 -1
  13. package/dist/cli/init.d.ts +18 -2
  14. package/dist/cli/init.d.ts.map +1 -1
  15. package/dist/cli/init.js +278 -108
  16. package/dist/cli/init.js.map +1 -1
  17. package/dist/index.js +39 -35
  18. package/dist/index.js.map +1 -1
  19. package/dist/prompts/getting-started.d.ts.map +1 -1
  20. package/dist/prompts/getting-started.js +6 -29
  21. package/dist/prompts/getting-started.js.map +1 -1
  22. package/dist/prompts/screen-workflow.d.ts +1 -4
  23. package/dist/prompts/screen-workflow.d.ts.map +1 -1
  24. package/dist/prompts/screen-workflow.js +84 -234
  25. package/dist/prompts/screen-workflow.js.map +1 -1
  26. package/dist/schemas/mcp-schemas.d.ts +212 -449
  27. package/dist/schemas/mcp-schemas.d.ts.map +1 -1
  28. package/dist/schemas/mcp-schemas.js +15 -69
  29. package/dist/schemas/mcp-schemas.js.map +1 -1
  30. package/dist/tools/get-screen-generation-context.d.ts.map +1 -1
  31. package/dist/tools/get-screen-generation-context.js +74 -117
  32. package/dist/tools/get-screen-generation-context.js.map +1 -1
  33. package/dist/tools/preview-component.js +1 -1
  34. package/dist/tools/preview-component.js.map +1 -1
  35. package/dist/tools/preview-screen-template.d.ts.map +1 -1
  36. package/dist/tools/preview-screen-template.js +0 -1
  37. package/dist/tools/preview-screen-template.js.map +1 -1
  38. package/dist/tools/validate-environment.d.ts.map +1 -1
  39. package/dist/tools/validate-environment.js +1 -84
  40. package/dist/tools/validate-environment.js.map +1 -1
  41. package/dist/tools/validate-screen-definition.d.ts.map +1 -1
  42. package/dist/tools/validate-screen-definition.js +0 -6
  43. package/dist/tools/validate-screen-definition.js.map +1 -1
  44. package/package.json +6 -6
package/README.md CHANGED
@@ -1,136 +1,40 @@
1
1
  # @framingui/mcp-server
2
2
 
3
- Framingui MCP Server v2.0.0 - stdio-based MCP protocol implementation for Claude Code.
3
+ MCP server for building production UI through FramingUI.
4
4
 
5
- ## Overview
5
+ `@framingui/mcp-server` gives AI coding agents a real UI contract: components, themes, layout tokens, templates, validation, and environment checks.
6
6
 
7
- MCP (Model Context Protocol) server enabling AI-driven blueprint generation, theme preview, and production code export for the Framingui design system.
7
+ ## Install
8
8
 
9
- Consumer install and upgrade steps live in [docs/packages/install-update.md](../../docs/packages/install-update.md).
10
-
11
- ## Features
12
-
13
- - **๐Ÿค– stdio MCP Protocol**: Claude Code native tool registration via JSON-RPC 2.0 (16 tools)
14
- - **๐ŸŽจ Theme Preview**: 6 built-in OKLCH-based themes with CSS variable generation
15
- - **๐Ÿ“‹ Blueprint Generation**: Natural language โ†’ Blueprint JSON with validation
16
- - **๐Ÿ’พ Data-Only Output**: No file system writes, Claude Code handles file operations
17
- - **๐Ÿš€ Production Export**: JSX, TSX, Vue code generation
18
- - **๐Ÿ—๏ธ Screen Generation** (SPEC-LAYOUT-002): JSON screen definition โ†’ Production code
19
- - **โœ… Screen Validation**: Validate screen definitions with helpful error suggestions
20
- - **๐Ÿท๏ธ Layout Tokens**: List shell, page, and section tokens from SPEC-LAYOUT-001
21
- - **๐Ÿงฉ Component Discovery** (SPEC-MCP-003): Browse 30+ UI components with props and examples
22
- - **๐Ÿ“„ Template Discovery** (SPEC-MCP-003): Explore 13 screen templates with customization boundaries
23
- - **๐Ÿ”’ Secure Design**: No previewUrl/filePath exposure, input validation, path traversal protection
24
-
25
- ## Installation
9
+ Use the CLI without a local install:
26
10
 
27
11
  ```bash
28
- pnpm install
12
+ npx -y @framingui/mcp-server@latest
29
13
  ```
30
14
 
31
- ## Authentication (Phase 4.1)
32
-
33
- The MCP server supports optional API key authentication to enable access to premium themes.
34
-
35
- ### Environment Variables
15
+ Recommended project setup:
36
16
 
37
17
  ```bash
38
- # Required for premium theme access
39
- FRAMINGUI_API_KEY=tk_live_xxx...
40
-
41
- # Optional: API endpoint (defaults to https://framingui.com)
42
- FRAMINGUI_API_URL=https://framingui.com # or http://localhost:3000 for dev
18
+ npx -y @framingui/mcp-server@latest init
43
19
  ```
44
20
 
45
- ### Theme Access
46
-
47
- **All Themes** (Requires valid API key and license):
48
-
49
- - `classic-magazine` - Classic magazine style
50
- - `dark-boldness` - Fitness & wellness
51
- - `minimal-workspace` - Minimal workspace
52
- - `neutral-workspace` - Neutral humanism
53
- - `pebble` - Round minimal
54
- - `square-minimalism` - Square minimalism
55
-
56
- **Note:** All 6 themes require authentication. No free themes are available.
57
-
58
- ### Authentication Behavior
59
-
60
- **Without API Key**:
61
-
62
- - Server starts normally
63
- - All theme access attempts return authentication error
64
- - Tools function but theme-related operations require auth
65
-
66
- **With Valid API Key**:
67
-
68
- - Server verifies key on startup (cached for 5 minutes)
69
- - Licensed themes become accessible
70
- - Unlicensed themes return license error
71
-
72
- **With Invalid API Key**:
73
-
74
- - Server logs error but continues running
75
- - Falls back to no theme access
76
- - Does not crash the server
77
-
78
- ## Quick Start: `init` Command
79
-
80
- ํ”„๋กœ์ ํŠธ์— FramingUI๋ฅผ ํ•œ ์ค„๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
21
+ Authenticate:
81
22
 
82
23
  ```bash
83
- npx @framingui/mcp-server init
24
+ npx -y @framingui/mcp-server@latest login
84
25
  ```
85
26
 
86
- ์ž๋™์œผ๋กœ ์ˆ˜ํ–‰๋˜๋Š” ์ž‘์—…:
87
-
88
- 1. **ํ”„๋กœ์ ํŠธ ๊ฐ์ง€** - Next.js / Vite ์ž๋™ ์ธ์‹
89
- 2. **ํŒจํ‚ค์ง€ ์„ค์น˜** - `@framingui/ui`, `tailwindcss-animate` (ํŒจํ‚ค์ง€ ๋งค๋‹ˆ์ € ์ž๋™ ๊ฐ์ง€: pnpm/yarn/bun/npm)
90
- 3. **Tailwind CSS ์„ค์ •** - `tailwind.config.ts`์— content ๊ฒฝ๋กœ ๋ฐ animate ํ”Œ๋Ÿฌ๊ทธ์ธ ์ถ”๊ฐ€
91
- 4. **CSS ํ† ํฐ ์ž„ํฌํŠธ** - `globals.css`์— `@import '@framingui/ui/styles'` ์ถ”๊ฐ€
92
- 5. **MCP ์—ฐ๊ฒฐ** - `.mcp.json`์— framingui ์„œ๋ฒ„ ๋“ฑ๋ก (ํ”„๋กœ์ ํŠธ ๋ฃจํŠธ)
93
- 6. **๊ฐ€์ด๋“œ ์ƒ์„ฑ** - `FRAMINGUI-GUIDE.md` ํ”„๋กœ์ ํŠธ ๋ฃจํŠธ์— ์ƒ์„ฑ
94
- 7. **AI ์—์ด์ „ํŠธ ๊ฐ€์ด๋“œ** - `CLAUDE.md` ๋ฐ `AGENTS.md`์— Framingui ์›Œํฌํ”Œ๋กœ์šฐ ์„น์…˜ ์ถ”๊ฐ€
95
- 8. **์™„๋ฃŒ ์•ˆ๋‚ด** - ์ธ์ฆ ํ•„์š”์„ฑ ๋ฐ ๋‹ค์Œ ๋‹จ๊ณ„ ์•ˆ๋‚ด
96
-
97
- ์„ค์ • ์™„๋ฃŒ ํ›„ Claude Code๋ฅผ ์žฌ์‹œ์ž‘ํ•˜๋ฉด, AI์—๊ฒŒ "๋กœ๊ทธ์ธ ํ™”๋ฉด ๋งŒ๋“ค์–ด์ค˜"์™€ ๊ฐ™์ด ์ž์—ฐ์–ด๋กœ ํ™”๋ฉด ์ƒ์„ฑ์„ ์š”์ฒญํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
98
-
99
- ### CLI Commands
100
-
101
- | Command | Description |
102
- | ------------------------------------------ | ------------------------ |
103
- | `npx -y @framingui/mcp-server@latest` | MCP stdio ์„œ๋ฒ„ ์‹œ์ž‘ |
104
- | `npx -y @framingui/mcp-server@latest init` | ํ”„๋กœ์ ํŠธ ์ดˆ๊ธฐ ์„ค์ • |
105
- | `framingui-mcp help` | CLI ๋„์›€๋ง |
106
- | `framingui-mcp commands --format json` | command adapter export |
107
- | `framingui-mcp login` | ๋ธŒ๋ผ์šฐ์ € OAuth ๋กœ๊ทธ์ธ |
108
- | `framingui-mcp logout` | ๋กœ๊ทธ์•„์›ƒ |
109
- | `framingui-mcp status` | ์ธ์ฆ ์ƒํƒœ ํ™•์ธ |
110
- | `framingui-mcp update --check` | ํŒจํ‚ค์ง€ ์—…๋ฐ์ดํŠธ ์ ๊ฒ€ |
111
- | `framingui-mcp server` | MCP stdio ์„œ๋ฒ„ ๋ช…์‹œ ์‹œ์ž‘ |
112
-
113
- ## Development Quick Start
114
-
115
- ### 1. Build the Server
116
-
117
- ```bash
118
- pnpm install
119
- pnpm build
120
- ```
121
-
122
- ### 2. Test with MCP Inspector
27
+ ## CLI Commands
123
28
 
124
29
  ```bash
125
- pnpm inspect
126
- # Opens browser at http://localhost:6274
30
+ npx -y @framingui/mcp-server@latest init
31
+ npx -y @framingui/mcp-server@latest login
32
+ npx -y @framingui/mcp-server@latest logout
33
+ npx -y @framingui/mcp-server@latest status
34
+ npx -y @framingui/mcp-server@latest
127
35
  ```
128
36
 
129
- ### 3. Integrate with Claude Code
130
-
131
- See [Package Guide](../../docs/packages/mcp-server.md) for complete setup instructions.
132
-
133
- **Quick Config** (ํ”„๋กœ์ ํŠธ ๋ฃจํŠธ `.mcp.json`):
37
+ ## MCP Config
134
38
 
135
39
  ```json
136
40
  {
@@ -144,905 +48,90 @@ See [Package Guide](../../docs/packages/mcp-server.md) for complete setup instru
144
48
  }
145
49
  ```
146
50
 
147
- ## MCP Tools
148
-
149
- ### 1. Generate Blueprint
150
-
151
- **Tool**: `generate-blueprint`
152
-
153
- **Description**: Legacy helper for generating a UI blueprint from natural language description. New screen workflows should prefer `get-screen-generation-context` plus `validate-screen-definition`.
154
-
155
- **Input**:
156
-
157
- ```json
158
- {
159
- "description": "User profile dashboard with avatar, bio, settings link",
160
- "layout": "sidebar-left",
161
- "themeId": "calm-wellness",
162
- "componentHints": ["Card", "Avatar", "Button"]
163
- }
164
- ```
165
-
166
- **Output** (Data-Only, v2.0.0):
167
-
168
- ```json
169
- {
170
- "success": true,
171
- "blueprint": {
172
- "id": "bp-1738123456789-abc123",
173
- "name": "User profile dashboard",
174
- "themeId": "calm-wellness",
175
- "layout": "sidebar-left",
176
- "components": [...],
177
- "timestamp": 1738123456789
178
- }
179
- }
180
- ```
181
-
182
- **Note**: `previewUrl` field removed in v2.0.0 (use SPEC-PLAYGROUND-001 for visual preview)
183
-
184
- ### 2. Preview Theme
185
-
186
- **Tool**: `preview-theme`
187
-
188
- **Description**: Preview a Framingui theme and retrieve its design tokens
189
-
190
- **Input**:
191
-
192
- ```json
193
- {
194
- "themeId": "premium-editorial"
195
- }
196
- ```
197
-
198
- **Output** (Data-Only, v2.0.0):
199
-
200
- ```json
201
- {
202
- "success": true,
203
- "theme": {
204
- "id": "premium-editorial",
205
- "name": "Premium Editorial",
206
- "description": "Elegant magazine-style UI",
207
- "cssVariables": {
208
- "--color-primary": "oklch(0.2 0 0)",
209
- "--color-secondary": "oklch(0.98 0 0)",
210
- "--font-family": "Georgia",
211
- "--border-radius": "0"
212
- }
213
- }
214
- }
215
- ```
216
-
217
- **Note**: `previewUrl` field removed in v2.0.0
218
-
219
- ### 3. Export Screen
220
-
221
- **Tool**: `export-screen`
222
-
223
- **Description**: Export a blueprint to production-ready code (TSX/JSX/Vue)
224
-
225
- **Input** (v2.0.0: accepts blueprint object):
226
-
227
- ```json
228
- {
229
- "blueprint": {
230
- "id": "bp-1738123456789-abc123",
231
- "name": "User Dashboard",
232
- "themeId": "calm-wellness",
233
- "layout": "sidebar-left",
234
- "components": [],
235
- "timestamp": 1738123456789
236
- },
237
- "format": "tsx"
238
- }
239
- ```
240
-
241
- **Output** (Data-Only, v2.0.0):
242
-
243
- ```json
244
- {
245
- "success": true,
246
- "code": "import React from 'react';\n\nexport default function UserDashboard() { ... }"
247
- }
248
- ```
249
-
250
- **Note**: `filePath` field removed in v2.0.0. Claude Code handles file writes.
251
-
252
- ### 4. List Themes
253
-
254
- **Tool**: `list-themes`
255
-
256
- **Description**: List the themes accessible to the current authenticated session
257
-
258
- **Input**:
259
-
260
- ```json
261
- {}
262
- ```
263
-
264
- **Output**:
265
-
266
- ```json
267
- {
268
- "success": true,
269
- "themes": [
270
- {
271
- "id": "calm-wellness",
272
- "name": "Calm Wellness",
273
- "description": "Serene wellness applications",
274
- "brandTone": "calm",
275
- "schemaVersion": "2.1"
276
- }
277
- ],
278
- "count": 13
279
- }
280
- ```
281
-
282
- ## Screen Generation Tools (SPEC-LAYOUT-002 Phase 4)
283
-
284
- ### 5. Generate Screen
285
-
286
- **Tool**: `generate_screen`
287
-
288
- **Description**: Optional helper to generate production-ready code from a validated JSON screen definition
289
-
290
- **Input**:
291
-
292
- ```json
293
- {
294
- "screenDefinition": {
295
- "id": "user-dashboard",
296
- "shell": "shell.web.dashboard",
297
- "page": "page.dashboard",
298
- "sections": [
299
- {
300
- "id": "header",
301
- "token": "section.container",
302
- "components": [
303
- {
304
- "type": "Heading",
305
- "props": { "level": 1, "children": "Dashboard" }
306
- }
307
- ]
308
- }
309
- ]
310
- },
311
- "outputFormat": "react",
312
- "options": {
313
- "typescript": true,
314
- "cssFramework": "styled-components"
315
- }
316
- }
317
- ```
318
-
319
- **Output**:
320
-
321
- ```json
322
- {
323
- "success": true,
324
- "code": "import React from 'react';\nimport styled from 'styled-components';\n\n...",
325
- "cssVariables": ":root { --shell-header-height: 64px; ... }"
326
- }
327
- ```
328
-
329
- **Output Formats**:
330
-
331
- - `css-in-js`: Styled-components or Emotion
332
- - `tailwind`: Tailwind CSS classes
333
- - `react`: Pure React component with CSS variables
334
-
335
- ### 6. Validate Screen
336
-
337
- **Tool**: `validate_screen`
338
-
339
- **Description**: Validate JSON screen definition with helpful feedback
340
-
341
- **Input**:
342
-
343
- ```json
344
- {
345
- "screenDefinition": {
346
- "id": "test-screen",
347
- "shell": "shell.web.app",
348
- "page": "page.detail",
349
- "sections": []
350
- },
351
- "strictMode": false
352
- }
353
- ```
354
-
355
- **Output**:
356
-
357
- ```json
358
- {
359
- "success": true,
360
- "valid": true,
361
- "errors": [],
362
- "warnings": ["Optional field 'meta' not provided"],
363
- "suggestions": [
364
- {
365
- "field": "shell",
366
- "message": "Shell token must match pattern",
367
- "suggestion": "Use format: shell.{platform}.{name}"
368
- }
369
- ]
370
- }
371
- ```
372
-
373
- ### 7. List Tokens
374
-
375
- **Tool**: `list_tokens`
376
-
377
- **Description**: List available layout tokens from SPEC-LAYOUT-001
378
-
379
- **Input**:
380
-
381
- ```json
382
- {
383
- "tokenType": "shell",
384
- "filter": "dashboard"
385
- }
386
- ```
387
-
388
- **Output**:
389
-
390
- ```json
391
- {
392
- "success": true,
393
- "shells": [
394
- {
395
- "id": "shell.web.dashboard",
396
- "name": "Web Dashboard Shell",
397
- "description": "Dashboard application shell with header and sidebar",
398
- "platform": "web"
399
- }
400
- ],
401
- "metadata": {
402
- "total": 1,
403
- "filtered": 1
404
- }
405
- }
406
- ```
407
-
408
- **Token Types**:
409
-
410
- - `shell`: Shell layout tokens (shell.web._, shell.mobile._)
411
- - `page`: Page layout tokens (page.dashboard, page.detail, etc.)
412
- - `section`: Section pattern tokens (section.grid-4, section.hero, etc.)
413
- - `all`: All token types
414
-
415
- ## Component & Template Discovery Tools (SPEC-MCP-003)
416
-
417
- ### 8. List Components
418
-
419
- **Tool**: `list-components`
420
-
421
- **Description**: List all available UI components from @framingui component catalog
422
-
423
- **Input**:
424
-
425
- ```json
426
- {
427
- "category": "core",
428
- "search": "button"
429
- }
430
- ```
431
-
432
- **Parameters**:
433
-
434
- - `category` (optional): Filter by category - `'core' | 'complex' | 'advanced' | 'all'` (default: `'all'`)
435
- - `search` (optional): Search components by name or description
436
-
437
- **Output**:
438
-
439
- ```json
440
- {
441
- "success": true,
442
- "components": [
443
- {
444
- "id": "button",
445
- "name": "Button",
446
- "category": "core",
447
- "description": "Interactive button with variants",
448
- "variantsCount": 6,
449
- "hasSubComponents": false,
450
- "tier": 1
451
- }
452
- ],
453
- "count": 15,
454
- "categories": {
455
- "core": 15,
456
- "complex": 10,
457
- "advanced": 5
458
- }
459
- }
460
- ```
461
-
462
- **Component Categories**:
463
-
464
- - **core** (Tier 1): Button, Input, Label, Card, Badge, Avatar, Separator, Checkbox, RadioGroup, Switch, Textarea, Skeleton, ScrollArea, Form, Select
465
- - **complex** (Tier 2): Dialog, DropdownMenu, Table, Tabs, Toast, Tooltip, Popover, Sheet, AlertDialog, Progress
466
- - **advanced** (Tier 3): Sidebar, NavigationMenu, Breadcrumb, Command, Calendar
467
-
468
- **Total Components**: 30+
469
-
470
- ### 9. Preview Component
471
-
472
- **Tool**: `preview-component`
473
-
474
- **Description**: Get detailed information about a specific UI component including props, variants, sub-components, and usage examples
475
-
476
- **Input**:
477
-
478
- ```json
479
- {
480
- "componentId": "button",
481
- "includeExamples": true,
482
- "includeDependencies": true
483
- }
484
- ```
485
-
486
- **Parameters**:
487
-
488
- - `componentId` (required): Component ID (lowercase with hyphens, e.g., `'button'`, `'card'`, `'dialog'`)
489
- - `includeExamples` (optional): Include usage examples (default: `true`)
490
- - `includeDependencies` (optional): Include dependency information (default: `true`)
491
-
492
- **Output**:
493
-
494
- ```json
495
- {
496
- "success": true,
497
- "component": {
498
- "id": "button",
499
- "name": "Button",
500
- "category": "core",
501
- "description": "Interactive button with variants",
502
- "tier": 1,
503
- "props": [
504
- {
505
- "name": "variant",
506
- "type": "'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link'",
507
- "required": false,
508
- "defaultValue": "'default'",
509
- "description": "Visual style variant"
510
- },
511
- {
512
- "name": "size",
513
- "type": "'default' | 'sm' | 'lg' | 'icon'",
514
- "required": false,
515
- "defaultValue": "'default'",
516
- "description": "Button size"
517
- }
518
- ],
519
- "variants": [
520
- {
521
- "name": "variant",
522
- "value": "default",
523
- "description": "Default blue button"
524
- },
525
- {
526
- "name": "variant",
527
- "value": "destructive",
528
- "description": "Red destructive action"
529
- }
530
- ],
531
- "importStatement": "import { Button } from '@framingui';",
532
- "dependencies": {
533
- "internal": [],
534
- "external": ["@radix-ui/react-slot"]
535
- },
536
- "examples": [
537
- {
538
- "title": "Basic Usage",
539
- "code": "import { Button } from '@framingui';\n\n<Button variant=\"default\">Click me</Button>",
540
- "description": "Simple button with default variant"
541
- }
542
- ],
543
- "accessibility": "Supports keyboard navigation and ARIA attributes"
544
- }
545
- }
546
- ```
547
-
548
- **Error Handling**: When component not found, returns error with list of available components
549
-
550
- ### 10. List Screen Templates
551
-
552
- **Tool**: `list-screen-templates`
553
-
554
- **Description**: List all available screen templates from the Framingui template registry
555
-
556
- **Input**:
557
-
558
- ```json
559
- {
560
- "category": "auth",
561
- "search": "login"
562
- }
563
- ```
564
-
565
- **Parameters**:
566
-
567
- - `category` (optional): Filter by category - `'auth' | 'dashboard' | 'form' | 'marketing' | 'feedback' | 'all'` (default: `'all'`)
568
- - `search` (optional): Search templates by name or description
569
-
570
- **Output**:
571
-
572
- ```json
573
- {
574
- "success": true,
575
- "templates": [
576
- {
577
- "id": "auth.login",
578
- "name": "Login",
579
- "category": "auth",
580
- "description": "User authentication login screen",
581
- "requiredComponentsCount": 5,
582
- "layoutType": "centered",
583
- "version": "1.0.0",
584
- "tags": ["authentication", "form"]
585
- }
586
- ],
587
- "count": 4,
588
- "categories": {
589
- "auth": 4,
590
- "dashboard": 1,
591
- "form": 0,
592
- "marketing": 3,
593
- "feedback": 5
594
- }
595
- }
596
- ```
597
-
598
- **Template Categories**:
599
-
600
- - **auth**: login, signup, forgot-password, verification
601
- - **marketing**: landing, preferences, profile
602
- - **feedback**: loading, error, empty, confirmation, success
603
- - **dashboard**: overview
604
-
605
- **Total Templates**: 13
606
-
607
- ## MCP Prompts (Universal Guidance)
608
-
609
- The MCP server provides 9 built-in prompts that work across all MCP clients:
51
+ ## Production Screen Workflow
610
52
 
611
- ### 1. getting-started
53
+ Use the guarded workflow for production work:
612
54
 
613
- **Purpose**: Complete onboarding guide for FramingUI
55
+ 1. `preview-theme` when theme recipes or defaults matter
56
+ 2. `get-screen-generation-context`
57
+ 3. `preview-component` for component ambiguity
58
+ 4. `list-icon-libraries` before adding icons
59
+ 5. `validate-screen-definition`
60
+ 6. write React code directly from the validated definition
61
+ 7. `validate-environment` with `sourceFiles` for dependency, style-contract, and code-audit checks
614
62
 
615
- **Content**:
63
+ ### Style Contract Rule
616
64
 
617
- - Authentication setup (framingui-mcp login)
618
- - Theme exploration workflow
619
- - Component availability checking
620
- - style-contract preflight plus 4-step screen generation workflow
621
- - Common mistakes and troubleshooting
65
+ Choose one contract before relying on FramingUI defaults:
622
66
 
623
- **When to use**: First-time users, onboarding, workflow overview
67
+ - `host-utility`: keep explicit utility styling
68
+ - `framingui-native`: import `@framingui/ui/styles` and use FramingUI variables/variants
69
+ - `migrate`: stop and decide the migration path first
624
70
 
625
- ### 2. screen-workflow
71
+ ## Slash Commands
626
72
 
627
- **Purpose**: Production workflow with style-contract preflight
73
+ FramingUI exposes guidance for:
628
74
 
629
- **Content**:
75
+ - `/screen`
76
+ - `/draft`
77
+ - `/section`
78
+ - `/responsive`
79
+ - `/a11y`
80
+ - `/theme-swap`
81
+ - `/doctor`
82
+ - `/install-check`
83
+ - `/export`
84
+ - `/update`
630
85
 
631
- - Step 0: detect the target style contract
632
- - Step 1/4: get-screen-generation-context
633
- - Step 2/4: validate-screen-definition
634
- - Step 3/4: write React code directly from the validated definition
635
- - Step 4/4: validate-environment
636
- - Complete examples and troubleshooting
86
+ ## Main MCP Tools
637
87
 
638
- **When to use**: Production screen generation and `/screen`, `/section`, `/draft` style workflows
88
+ ### Discovery
639
89
 
640
- ### 3. responsive-workflow
90
+ - `list-themes`
91
+ - `preview-theme`
92
+ - `list-components`
93
+ - `preview-component`
94
+ - `list-screen-templates`
95
+ - `preview-screen-template`
96
+ - `list_tokens`
97
+ - `list-icon-libraries`
98
+ - `preview-icon-library`
641
99
 
642
- **Purpose**: Responsive optimization workflow behind `/responsive`
100
+ ### Production Workflow
643
101
 
644
- ### 4. a11y-workflow
102
+ - `get-screen-generation-context`
103
+ - `validate-screen-definition`
104
+ - `validate-environment`
105
+ - `generate_screen` (optional helper)
645
106
 
646
- **Purpose**: Accessibility audit workflow behind `/a11y`
107
+ ### Legacy Helpers
647
108
 
648
- ### 5. theme-swap-workflow
109
+ - `generate-blueprint`
110
+ - `export-screen`
111
+ - `validate_screen`
649
112
 
650
- **Purpose**: Theme application workflow behind `/theme-swap`
113
+ ## What `init` Updates
651
114
 
652
- ### 6. doctor-workflow
115
+ `init` can:
653
116
 
654
- **Purpose**: Environment diagnosis workflow behind `/doctor` and `/install-check`, including style contract mismatch checks
117
+ - install the FramingUI screen-generation runtime and peer dependencies in one pass
118
+ - configure Tailwind content paths and `tailwindcss-animate`
119
+ - add `@import '@framingui/ui/styles';` to a detected global stylesheet
120
+ - verify the package install, Tailwind config, and stylesheet import before finishing
121
+ - create `.mcp.json`
122
+ - generate `FRAMINGUI-GUIDE.md`
123
+ - append FramingUI sections to `CLAUDE.md` and `AGENTS.md`
655
124
 
656
- ### 7. slash-commands
657
-
658
- **Purpose**: Slash command catalog for FramingUI design workflows
659
-
660
- ### 8. command-help
661
-
662
- **Purpose**: Detailed help for one slash command including usage, options, examples, and MCP workflow mapping
663
-
664
- ### 9. update-workflow
665
-
666
- **Purpose**: Maintenance workflow behind `/update`
667
-
668
- ### CLI adapter export
669
-
670
- You can export client-oriented slash command adapters from the CLI:
671
-
672
- ```bash
673
- framingui-mcp commands --client codex --format json
674
- framingui-mcp commands --client claude-code --format markdown
675
- framingui-mcp commands --client cursor --command /responsive --format text
676
- ```
677
-
678
- **Note**: These prompts are platform-agnostic and work with Claude Code, OpenAI Codex, Cursor, Windsurf, and any MCP-compatible client.
679
-
680
- **Total Prompts**: 9
681
-
682
- ### 11. Preview Screen Template
683
-
684
- **Tool**: `preview-screen-template`
685
-
686
- **Description**: Get detailed information about a specific screen template including skeleton structure, layout configuration, and customization boundaries
687
-
688
- **Input**:
689
-
690
- ```json
691
- {
692
- "templateId": "auth.login",
693
- "includeLayoutTokens": true
694
- }
695
- ```
696
-
697
- **Parameters**:
698
-
699
- - `templateId` (required): Template ID in format `category.name` (e.g., `'auth.login'`, `'feedback.loading'`)
700
- - `includeLayoutTokens` (optional): Include responsive layout tokens (default: `true`)
701
-
702
- **Output**:
703
-
704
- ```json
705
- {
706
- "success": true,
707
- "template": {
708
- "id": "auth.login",
709
- "name": "Login",
710
- "category": "auth",
711
- "description": "User authentication login screen",
712
- "version": "1.0.0",
713
- "skeleton": {
714
- "shell": "centered-card",
715
- "page": "auth-page",
716
- "sections": [
717
- {
718
- "id": "header",
719
- "name": "Header",
720
- "slot": "logo",
721
- "required": true
722
- },
723
- {
724
- "id": "form",
725
- "name": "Form",
726
- "slot": "main",
727
- "required": true
728
- }
729
- ]
730
- },
731
- "layout": {
732
- "type": "centered",
733
- "responsive": {
734
- "mobile": {
735
- "padding": "1rem",
736
- "gap": "1rem",
737
- "columns": 1
738
- },
739
- "tablet": {
740
- "padding": "2rem",
741
- "gap": "1.5rem",
742
- "columns": 1
743
- },
744
- "desktop": {
745
- "padding": "2rem",
746
- "gap": "2rem",
747
- "columns": 1
748
- }
749
- }
750
- },
751
- "customizable": {
752
- "texts": ["title", "subtitle", "button_label"],
753
- "optional": ["social_login", "remember_me"],
754
- "slots": ["logo", "footer", "socialLogin"]
755
- },
756
- "requiredComponents": ["Input", "Button", "Card", "Form", "Label"],
757
- "importStatement": "import { LoginTemplate } from '@framingui';",
758
- "exampleProps": {
759
- "texts": {
760
- "title": "Welcome Back",
761
- "subtitle": "Sign in to your account"
762
- },
763
- "options": {
764
- "social_login": true,
765
- "remember_me": true
766
- }
767
- },
768
- "created": "2026-01-15",
769
- "updated": "2026-01-20",
770
- "tags": ["authentication", "form"]
771
- }
772
- }
773
- ```
125
+ ## Package Docs
774
126
 
775
- **Error Handling**: When template not found, returns error with list of available templates
776
-
777
- **Use Cases**:
778
-
779
- - AI agents exploring available templates
780
- - Template integration planning
781
- - Understanding customization boundaries
782
- - Component dependency analysis
783
-
784
- ## Usage Examples
785
-
786
- ### From Claude Code
787
-
788
- **Legacy Blueprint & Theme Workflows**:
789
-
790
- ```
791
- User: "Create a user dashboard with profile card using calm-wellness theme"
792
- โ†’ Claude Code calls generate-blueprint
793
- โ†’ Blueprint JSON returned
794
-
795
- User: "Show me the premium-editorial theme"
796
- โ†’ Claude Code calls preview-theme
797
- โ†’ Theme metadata and CSS variables returned
798
-
799
- User: "Export that dashboard as TypeScript React"
800
- โ†’ Claude Code calls export-screen
801
- โ†’ TSX code returned (ready to copy/paste)
802
- ```
803
-
804
- **Screen Generation Workflows**:
805
-
806
- ```
807
- User: "Generate a dashboard screen using shell.web.dashboard and page.dashboard"
808
- โ†’ Claude Code calls get-screen-generation-context
809
- โ†’ Returns template hints, component plan, section plan, definition starter, props contracts
810
-
811
- User: "Validate this screen definition before writing code"
812
- โ†’ Claude Code calls validate-screen-definition
813
- โ†’ Returns validation results, auto-fix guidance, and component/props issues
814
-
815
- User: "Check if my project is ready for this screen"
816
- โ†’ Claude Code calls validate-environment
817
- โ†’ Returns package, Tailwind, and style-contract checks
818
-
819
- User: "What layout tokens are available for sections?"
820
- โ†’ Claude Code calls list_tokens with tokenType='section'
821
- โ†’ List of section tokens (grid-2, grid-3, hero, etc.) returned
822
- ```
823
-
824
- **Component Discovery Workflows** (SPEC-MCP-003):
825
-
826
- ```
827
- User: "What UI components are available?"
828
- โ†’ Claude Code calls list-components
829
- โ†’ List of 30+ components categorized by tier returned
830
-
831
- User: "Show me details about the Button component"
832
- โ†’ Claude Code calls preview-component with componentId='button'
833
- โ†’ Props, variants, examples, and dependencies returned
834
-
835
- User: "I need a dialog component. What are the props?"
836
- โ†’ Claude Code calls preview-component with componentId='dialog'
837
- โ†’ Complete Dialog component specification with sub-components returned
838
- ```
839
-
840
- **Template Discovery Workflows** (SPEC-MCP-003):
841
-
842
- ```
843
- User: "What screen templates are available for authentication?"
844
- โ†’ Claude Code calls list-screen-templates with category='auth'
845
- โ†’ 4 auth templates (login, signup, forgot-password, verification) returned
846
-
847
- User: "Show me the login template structure"
848
- โ†’ Claude Code calls preview-screen-template with templateId='auth.login'
849
- โ†’ Skeleton, layout, customization boundaries, and required components returned
850
-
851
- User: "What can I customize in the loading template?"
852
- โ†’ Claude Code calls preview-screen-template with templateId='feedback.loading'
853
- โ†’ Customizable texts, slots, and optional features returned
854
- ```
855
-
856
- See [Package Guide](../../docs/packages/mcp-server.md) for complete examples.
857
-
858
- ## Architecture
859
-
860
- ```
861
- packages/mcp-server/
862
- โ”œโ”€โ”€ src/
863
- โ”‚ โ”œโ”€โ”€ index.ts # stdio MCP server entry point (13 tools)
864
- โ”‚ โ”œโ”€โ”€ tools/ # MCP tool implementations
865
- โ”‚ โ”‚ โ”œโ”€โ”€ generate-blueprint.ts # Blueprint generation
866
- โ”‚ โ”‚ โ”œโ”€โ”€ preview-theme.ts # Theme preview
867
- โ”‚ โ”‚ โ”œโ”€โ”€ list-themes.ts # Theme listing
868
- โ”‚ โ”‚ โ”œโ”€โ”€ list-icon-libraries.ts # Icon library listing
869
- โ”‚ โ”‚ โ”œโ”€โ”€ preview-icon-library.ts # Icon library preview
870
- โ”‚ โ”‚ โ”œโ”€โ”€ export-screen.ts # Blueprint export
871
- โ”‚ โ”‚ โ”œโ”€โ”€ generate-screen.ts # Screen code generation (SPEC-LAYOUT-002)
872
- โ”‚ โ”‚ โ”œโ”€โ”€ validate-screen.ts # Screen validation (SPEC-LAYOUT-002)
873
- โ”‚ โ”‚ โ”œโ”€โ”€ list-tokens.ts # Layout token listing (SPEC-LAYOUT-002)
874
- โ”‚ โ”‚ โ”œโ”€โ”€ list-components.ts # Component listing (SPEC-MCP-003)
875
- โ”‚ โ”‚ โ”œโ”€โ”€ preview-component.ts # Component preview (SPEC-MCP-003)
876
- โ”‚ โ”‚ โ”œโ”€โ”€ list-screen-templates.ts # Template listing (SPEC-MCP-003)
877
- โ”‚ โ”‚ โ””โ”€โ”€ preview-screen-template.ts # Template preview (SPEC-MCP-003)
878
- โ”‚ โ”œโ”€โ”€ data/ # Data utilities (non-API helpers)
879
- โ”‚ โ”‚ โ”œโ”€โ”€ template-matcher.ts # Template matching logic
880
- โ”‚ โ”‚ โ”œโ”€โ”€ hint-generator.ts # AI hint generation
881
- โ”‚ โ”‚ โ””โ”€โ”€ recipe-resolver.ts # Recipe resolution
882
- โ”‚ โ”œโ”€โ”€ storage/ # Blueprint storage
883
- โ”‚ โ”‚ โ”œโ”€โ”€ blueprint-storage.ts
884
- โ”‚ โ”‚ โ””โ”€โ”€ timestamp-manager.ts
885
- โ”‚ โ”œโ”€โ”€ schemas/ # Zod validation
886
- โ”‚ โ”‚ โ””โ”€โ”€ mcp-schemas.ts
887
- โ”‚ โ””โ”€โ”€ utils/ # Helper functions
888
- โ”‚ โ”œโ”€โ”€ error-handler.ts
889
- โ”‚ โ””โ”€โ”€ logger.ts # stderr-only logging
890
- โ””โ”€โ”€ __tests__/ # Test suites
891
- โ”œโ”€โ”€ tools/ # Tool tests
892
- โ”‚ โ”œโ”€โ”€ generate-blueprint.test.ts
893
- โ”‚ โ”œโ”€โ”€ preview-theme.test.ts
894
- โ”‚ โ”œโ”€โ”€ export-screen.test.ts
895
- โ”‚ โ”œโ”€โ”€ screen-tools.test.ts # SPEC-LAYOUT-002 Phase 4 tests
896
- โ”‚ โ”œโ”€โ”€ list-components.test.ts # SPEC-MCP-003 tests
897
- โ”‚ โ”œโ”€โ”€ preview-component.test.ts # SPEC-MCP-003 tests
898
- โ”‚ โ”œโ”€โ”€ list-screen-templates.test.ts # SPEC-MCP-003 tests
899
- โ”‚ โ””โ”€โ”€ preview-screen-template.test.ts # SPEC-MCP-003 tests
900
- โ”œโ”€โ”€ mcp-protocol/ # JSON-RPC validation
901
- โ”œโ”€โ”€ storage/ # Storage tests
902
- โ””โ”€โ”€ utils/ # Utility tests
903
- ```
904
-
905
- **Key Changes in v2.0.0**:
906
-
907
- - โœ… stdio transport (StdioServerTransport)
908
- - โœ… JSON-RPC 2.0 protocol
909
- - โœ… stderr-only logging (stdout reserved for MCP messages)
910
- - โŒ HTTP endpoints removed (moved to SPEC-PLAYGROUND-001)
911
- - โŒ previewUrl/filePath removed from outputs
912
-
913
- ## Built-in Themes (6 Total)
914
-
915
- 1. `classic-magazine` - Classic magazine style
916
- 2. `dark-boldness` - Fitness & wellness
917
- 3. `minimal-workspace` - Minimal workspace
918
- 4. `neutral-workspace` - Neutral humanism
919
- 5. `pebble` - Round minimal
920
- 6. `square-minimalism` - Square minimalism
921
-
922
- **CSS Format**: All color values use OKLCH format for perceptual uniformity
923
-
924
- **Authentication**: All themes require valid API key and license
925
-
926
- ## Quality Metrics (SPEC-MCP-002 v2.0.0)
927
-
928
- | Metric | Target | Current | Status |
929
- | ---------------------------- | ------- | ---------- | ------ |
930
- | **Test Coverage** | โ‰ฅ 85% | **94.39%** | โœ… |
931
- | **TypeScript Errors** | 0 | **0** | โœ… |
932
- | **Critical Vulnerabilities** | 0 | **0** | โœ… |
933
- | **Tool Response Time** | < 500ms | < 100ms | โœ… |
934
- | **Server Startup** | < 1s | < 500ms | โœ… |
935
-
936
- **Test Results**:
937
-
938
- - 29 test files
939
- - 290 test cases
940
- - 100% pass rate
941
- - Zero failures
942
-
943
- ## Architecture: API-Based Data Sources (v0.6.0)
944
-
945
- Since v0.6.0, the MCP server fetches all data from the framingui.com API via `data-client.ts`. This removes `@framingui/core` and `@framingui/ui` from production dependencies, enabling truly standalone npm installation.
946
-
947
- **Data Client** (`src/api/data-client.ts`):
948
-
949
- - `fetchThemeList()`, `fetchTheme(id)` โ€” Theme data
950
- - `fetchIconLibraries()`, `fetchIconLibrary(id)` โ€” Icon libraries
951
- - `fetchTemplateList()`, `fetchTemplate(id)` โ€” Screen templates
952
- - `fetchComponentList()`, `fetchComponent(id)` โ€” Component catalog
953
- - `fetchTokenList(type?)` โ€” Layout tokens
954
- - `fetchCSSVariables(themeId)` โ€” CSS generation
955
- - `fetchScreenExamples()` โ€” Screen examples
956
-
957
- All functions use `MemoryCache` (10-min TTL) with `getStale()` fallback for network resilience.
958
-
959
- ## Documentation
960
-
961
- ### Consumer Documentation
962
-
963
- - ๐Ÿ“ฆ [Install And Update Guide](../../docs/packages/install-update.md) - package install, upgrade, and cache troubleshooting
964
- - ๐Ÿค– [Package Guide](../../docs/packages/mcp-server.md) - setup and usage
965
- - ๐Ÿ“˜ [Local MCP Docs](./docs/README.md) - quick start, API reference, and integration notes
966
-
967
- ### Quick Links
968
-
969
- - ๐Ÿงช [Test Coverage Report](./coverage/) - 94.39% coverage
970
- - ๐ŸŽจ [Theme System](../../packages/core/src/themes/) - 6 themes
971
- - ๐Ÿงฉ [UI Component Library](../../packages/ui/) - 30+ production-ready components
972
- - ๐Ÿ“„ [Template Registry](../../packages/ui/src/templates/) - 13 screen templates
973
- - ๐Ÿ”ง [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector) - Protocol testing tool
974
-
975
- ## Development
976
-
977
- ```bash
978
- # Install dependencies
979
- pnpm install
980
-
981
- # Build (TypeScript โ†’ dist/)
982
- pnpm build
983
-
984
- # Run tests
985
- pnpm test
986
-
987
- # Test with coverage
988
- pnpm test:coverage
989
-
990
- # Watch mode
991
- pnpm dev
992
-
993
- # Lint
994
- pnpm lint
995
-
996
- # Start MCP server (stdio)
997
- pnpm start
998
-
999
- # MCP Inspector (browser-based testing)
1000
- pnpm inspect
1001
- ```
1002
-
1003
- ### Validation Scripts
1004
-
1005
- ```bash
1006
- # Automated MCP protocol validation
1007
- node validate-mcp.mjs
1008
-
1009
- # Manual testing with MCP Inspector
1010
- pnpm inspect
1011
- ```
1012
-
1013
- ## Migration from v1.0.0 (HTTP) to v2.0.0 (stdio)
1014
-
1015
- **Breaking Changes**:
1016
-
1017
- - โŒ HTTP endpoints removed โ†’ stdio transport only
1018
- - โŒ `previewUrl` field removed from `generate-blueprint` and `preview-theme` outputs
1019
- - โŒ `filePath` field removed from `export-screen` output
1020
- - โŒ File system writes removed from `export-screen`
1021
- - โœ… `export-screen` now accepts `blueprint` object instead of `blueprintId`
1022
-
1023
- **Why?**
1024
-
1025
- - **Claude Code Integration**: stdio is the standard MCP transport
1026
- - **Data-Only Philosophy**: Claude Code handles all file operations
1027
- - **Security**: No file system side effects from MCP tools
1028
-
1029
- **Visual Preview**: Use the FramingUI playground app for React-based rendering and theme inspection.
1030
-
1031
- ## Contributing
1032
-
1033
- Contributions welcome! Please ensure:
1034
-
1035
- - Tests pass (`pnpm test`)
1036
- - Coverage โ‰ฅ 85% (`pnpm test:coverage`)
1037
- - TypeScript strict mode compliance (`pnpm build`)
1038
- - MCP protocol validation (`node validate-mcp.mjs`)
127
+ - [docs/README.md](./docs/README.md)
128
+ - [docs/01-quickstart.md](./docs/01-quickstart.md)
129
+ - [docs/02-user-guide.md](./docs/02-user-guide.md)
130
+ - [docs/03-api-reference.md](./docs/03-api-reference.md)
131
+ - [docs/04-architecture.md](./docs/04-architecture.md)
132
+ - [docs/05-developer-guide.md](./docs/05-developer-guide.md)
133
+ - [docs/06-integration-guide.md](./docs/06-integration-guide.md)
1039
134
 
1040
135
  ## License
1041
136
 
1042
137
  MIT
1043
-
1044
- ---
1045
-
1046
- **Version**: 0.6.5
1047
- **Last Updated**: 2026-03-07
1048
- **Total Tools**: 17