@godxjp/ui-mcp 0.2.0
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 +274 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3317 -0
- package/dist/index.js.map +1 -0
- package/package.json +56 -0
package/README.md
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
# @godxjp/ui-mcp
|
|
2
|
+
|
|
3
|
+
Model Context Protocol server for [`@godxjp/ui`](https://github.com/godx-jp/godxjp-ui).
|
|
4
|
+
Gives **Claude Code**, **Codex CLI**, **Cursor**, **Cline**, **Continue**, or any
|
|
5
|
+
MCP-aware agent live access to:
|
|
6
|
+
|
|
7
|
+
- 30+ component catalog (props, types, defaults, examples)
|
|
8
|
+
- 14 shared prop-vocabulary types (`SizeProp`, `ColorProp`, `LoadingProp`, …)
|
|
9
|
+
- 48 design tokens (color / spacing / typography / radius / breakpoint / density / motion)
|
|
10
|
+
- 34 cardinal rules from `CLAUDE.md`
|
|
11
|
+
- 7 canonical copy-paste-ready patterns (sign-up, settings, data-table, …)
|
|
12
|
+
- 12 taste / design skills (taste / soft / minimalist / brutalist / gpt-tasteskill /
|
|
13
|
+
redesign / output / brandkit / stitch / imagegen-mobile / imagegen-web / image-to-code)
|
|
14
|
+
- 20+ anti-AI-tell patterns to AVOID + their fixes
|
|
15
|
+
- 50+ redesign-audit checks across 9 categories
|
|
16
|
+
- heuristic JSX linter (raw HTML / wrong vocab / banned default fonts / …)
|
|
17
|
+
|
|
18
|
+
**Token-efficient design:** discovery tools return small metadata; agents
|
|
19
|
+
drill into ONE section at a time via `get_skill_section`. Average
|
|
20
|
+
interaction: ~2.5 KB vs. 50+ KB for naive dump-everything servers.
|
|
21
|
+
|
|
22
|
+
Read-only, zero filesystem access into consumer projects, zero network,
|
|
23
|
+
zero shell. Safe to mount.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
npm install --save-dev @godxjp/ui-mcp
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or run via `npx` without installing:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
npx @godxjp/ui-mcp
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Configure your agent
|
|
42
|
+
|
|
43
|
+
### Claude Code
|
|
44
|
+
|
|
45
|
+
`~/.claude.json` (user-level) or `.mcp.json` at project root:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"mcpServers": {
|
|
50
|
+
"godx-ui": {
|
|
51
|
+
"command": "npx",
|
|
52
|
+
"args": ["@godxjp/ui-mcp"]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Restart Claude Code. The 14 tools appear under `mcp__godx_ui__*`.
|
|
59
|
+
|
|
60
|
+
### Codex CLI
|
|
61
|
+
|
|
62
|
+
`~/.codex/config.toml`:
|
|
63
|
+
|
|
64
|
+
```toml
|
|
65
|
+
[mcp_servers.godx-ui]
|
|
66
|
+
command = "npx"
|
|
67
|
+
args = ["@godxjp/ui-mcp"]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Codex picks it up on next session start. Tools accessible via the
|
|
71
|
+
standard Codex tool-call protocol.
|
|
72
|
+
|
|
73
|
+
### Cursor
|
|
74
|
+
|
|
75
|
+
`.cursor/mcp.json` in your project root:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"mcpServers": {
|
|
80
|
+
"godx-ui": {
|
|
81
|
+
"command": "npx",
|
|
82
|
+
"args": ["@godxjp/ui-mcp"]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Cline (VS Code)
|
|
89
|
+
|
|
90
|
+
`cline_mcp_settings.json`:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"mcpServers": {
|
|
95
|
+
"godx-ui": {
|
|
96
|
+
"command": "npx",
|
|
97
|
+
"args": ["@godxjp/ui-mcp"],
|
|
98
|
+
"disabled": false
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Continue.dev
|
|
105
|
+
|
|
106
|
+
`~/.continue/config.yaml`:
|
|
107
|
+
|
|
108
|
+
```yaml
|
|
109
|
+
mcpServers:
|
|
110
|
+
- name: godx-ui
|
|
111
|
+
command: npx
|
|
112
|
+
args: ["@godxjp/ui-mcp"]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## How to use it well (token-efficient pattern)
|
|
118
|
+
|
|
119
|
+
Start with discovery, then drill in. Don't ask for everything at once.
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
Agent: "I want to design a premium agency landing page hero."
|
|
123
|
+
|
|
124
|
+
Step 1 — route the task (tiny response):
|
|
125
|
+
→ route_task task="premium agency landing page hero"
|
|
126
|
+
← { skill: "soft", section: "vibe-archetypes", why: "Premium tier — pick a Vibe + Layout archetype.", alsoSee: ["soft/layout-archetypes", "soft/double-bezel"] }
|
|
127
|
+
|
|
128
|
+
Step 2 — fetch the relevant section (small):
|
|
129
|
+
→ get_skill_section skill="soft" section="vibe-archetypes"
|
|
130
|
+
← (2 KB of Ethereal Glass / Editorial Luxury / Soft Structuralism)
|
|
131
|
+
|
|
132
|
+
Step 3 — fetch the pattern (medium):
|
|
133
|
+
→ get_pattern name="app-shell"
|
|
134
|
+
← (copy-paste-ready code)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Total: ~3 KB. Versus naive "give me everything about @godxjp/ui" = 50+ KB.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Tools (14)
|
|
142
|
+
|
|
143
|
+
### Discovery (small responses — start here)
|
|
144
|
+
|
|
145
|
+
| Tool | Returns | Size |
|
|
146
|
+
|---|---|---|
|
|
147
|
+
| `list_skills` | 12 taste/design skills + section ids | ~1 KB |
|
|
148
|
+
| `list_primitives` | All components, grouped + tagline. Optional `group` filter. | ~3 KB |
|
|
149
|
+
| `list_patterns` | 7 canonical patterns + taglines | ~500 B |
|
|
150
|
+
| `list_anti_ai_tells` | 20+ AI-tell patterns. Optional `category` filter. | ~2 KB |
|
|
151
|
+
| `list_redesign_checks` | 50+ audit checks + fix priority. Optional `category` filter. | ~5 KB |
|
|
152
|
+
|
|
153
|
+
### Drill-down (medium responses — after discovery)
|
|
154
|
+
|
|
155
|
+
| Tool | Returns | Size |
|
|
156
|
+
|---|---|---|
|
|
157
|
+
| `get_skill_section` | ONE section of ONE skill | ~2 KB |
|
|
158
|
+
| `get_component` | Full API for one component | ~2 KB |
|
|
159
|
+
| `get_pattern` | Full code snippet for one pattern | ~3 KB |
|
|
160
|
+
| `get_rule` | One cardinal rule (or all 34) | ~500 B / ~10 KB |
|
|
161
|
+
| `get_vocab` | One vocab type (or all 14) | ~500 B / ~3 KB |
|
|
162
|
+
| `get_tokens` | Tokens (optionally by category) | ~5 KB |
|
|
163
|
+
|
|
164
|
+
### Task routing (smallest — pointer only)
|
|
165
|
+
|
|
166
|
+
| Tool | Returns | Size |
|
|
167
|
+
|---|---|---|
|
|
168
|
+
| `route_task` | `{ skill, section, why, alsoSee }` for a natural-language task | ~300 B |
|
|
169
|
+
| `suggest_primitive` | Use case → recommended primitive + rationale | ~500 B |
|
|
170
|
+
| `search_components` | Fuzzy-search by name / tagline / prop | ~1 KB |
|
|
171
|
+
|
|
172
|
+
### Lint (one-shot critique)
|
|
173
|
+
|
|
174
|
+
| Tool | Returns | Size |
|
|
175
|
+
|---|---|---|
|
|
176
|
+
| `lint_jsx` | Heuristic findings (raw `<button>` / wrong vocab / etc.) | ~1 KB |
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Skills bundled (12)
|
|
181
|
+
|
|
182
|
+
Synthesised from [Leonxlnx/taste-skill](https://github.com/Leonxlnx/taste-skill)
|
|
183
|
+
+ framework-native design knowledge:
|
|
184
|
+
|
|
185
|
+
| Skill | When to use |
|
|
186
|
+
|---|---|
|
|
187
|
+
| `taste` | Default — production app screen baseline |
|
|
188
|
+
| `soft` | Premium agency / Awwwards-tier ($150k brief) |
|
|
189
|
+
| `minimalist` | Editorial workspace (Notion-like) — warm monochrome + bento |
|
|
190
|
+
| `brutalist` | Data-heavy dashboards, declassified-blueprint feel |
|
|
191
|
+
| `gpt-tasteskill` | Long-scroll marketing, GSAP ScrollTrigger choreography |
|
|
192
|
+
| `redesign` | Auditing + upgrading EXISTING project |
|
|
193
|
+
| `output` | Always — bans `// ...` / `// TODO` patterns |
|
|
194
|
+
| `brandkit` | Brand identity boards before screens |
|
|
195
|
+
| `stitch` | Generate DESIGN.md for Google Stitch / similar generators |
|
|
196
|
+
| `imagegen-mobile` | Pre-code phase — mobile app screen mockups |
|
|
197
|
+
| `imagegen-web` | Pre-code phase — landing page section images |
|
|
198
|
+
| `image-to-code` | Visual brief → working frontend code |
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Example interactions
|
|
203
|
+
|
|
204
|
+
> **User:** "How do I build a sign-up form with @godxjp/ui?"
|
|
205
|
+
>
|
|
206
|
+
> **Agent:** calls `get_pattern name="registration-form"` → returns the full Card + Form + zod schema snippet.
|
|
207
|
+
|
|
208
|
+
> **User:** "What's the difference between Table and DataTable?"
|
|
209
|
+
>
|
|
210
|
+
> **Agent:** calls `get_component name="Table"` + `get_component name="DataTable"`. Returns both APIs with comparison.
|
|
211
|
+
|
|
212
|
+
> **User:** "I want to design a premium agency hero — what should I do?"
|
|
213
|
+
>
|
|
214
|
+
> **Agent:** calls `route_task task="premium agency hero design"` → routed to `soft/vibe-archetypes`. Calls `get_skill_section skill="soft" section="vibe-archetypes"`. Picks Ethereal Glass + Editorial Split layout. Returns finished concept.
|
|
215
|
+
|
|
216
|
+
> **User:** "Audit this UI for me: \[paste JSX\]"
|
|
217
|
+
>
|
|
218
|
+
> **Agent:** calls `lint_jsx jsx="..."` → returns heuristic findings. Then `list_redesign_checks` for deeper categories.
|
|
219
|
+
|
|
220
|
+
> **User:** "What's banned by rule 34?"
|
|
221
|
+
>
|
|
222
|
+
> **Agent:** calls `get_rule number=34` → returns the rule body.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Resources
|
|
227
|
+
|
|
228
|
+
| URI | Format | Purpose |
|
|
229
|
+
|---|---|---|
|
|
230
|
+
| `godx-ui://components` | JSON | Full catalog |
|
|
231
|
+
| `godx-ui://components/{name}` | Markdown | One component |
|
|
232
|
+
| `godx-ui://prop-vocabulary` | JSON | Shared vocab |
|
|
233
|
+
| `godx-ui://tokens` | JSON | All tokens |
|
|
234
|
+
| `godx-ui://tokens/{category}` | JSON | Tokens by category |
|
|
235
|
+
| `godx-ui://rules` | Markdown | All 34 rules |
|
|
236
|
+
| `godx-ui://rules/{number}` | Markdown | One rule |
|
|
237
|
+
| `godx-ui://patterns` | JSON | Pattern index |
|
|
238
|
+
| `godx-ui://patterns/{name}` | Markdown | One pattern |
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Develop locally
|
|
243
|
+
|
|
244
|
+
```sh
|
|
245
|
+
pnpm install
|
|
246
|
+
pnpm dev # tsup --watch
|
|
247
|
+
pnpm inspect # MCP inspector (https://github.com/modelcontextprotocol/inspector)
|
|
248
|
+
pnpm type-check
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Test directly via stdio:
|
|
252
|
+
|
|
253
|
+
```sh
|
|
254
|
+
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | node dist/index.js
|
|
255
|
+
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_skills","arguments":{}}}' | node dist/index.js
|
|
256
|
+
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"route_task","arguments":{"task":"design a sign-up form"}}}' | node dist/index.js
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Architecture
|
|
262
|
+
|
|
263
|
+
See `PLAN.md` for the full design decisions:
|
|
264
|
+
|
|
265
|
+
- Token-efficient two-tier API (`list_*` then `get_*_section`)
|
|
266
|
+
- Skill catalog mapped to `data/skills-index.ts` (compact metadata)
|
|
267
|
+
- Full skill bodies stored in dedicated `data/*.ts` files (lazy-fetched)
|
|
268
|
+
- Heuristic task router (`route_task`) — keyword match for v1; embedding-based for v2
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## License
|
|
273
|
+
|
|
274
|
+
Apache-2.0
|
package/dist/index.d.ts
ADDED