@vadenai/mcp-server 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ROUTE06, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,356 @@
1
+ # @vadenai/mcp-server
2
+
3
+ An MCP Server that provides your Vaden design system to MCP-compatible coding agents such as Claude Code, Cursor, and Windsurf.
4
+
5
+ ## Overview
6
+
7
+ ```text
8
+ Coding Agent ←→ MCP Server (stdio) ←→ Vaden API ←→ Design System
9
+ ```
10
+
11
+ Using the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/), this server provides coding agents with design tokens, CSS variables, component specs, wireframes (screen layouts and navigation flows), and concepts (brand personality and design philosophy) from your Vaden project. Agents can generate code that adheres to your design system instead of hardcoding values.
12
+
13
+ ## Problem
14
+
15
+ Coding agents don't know about your project-specific design system. They tend to generate hardcoded values like `bg-blue-500` or implementations that deviate from your design system.
16
+
17
+ This MCP Server solves this by providing **design context** that agents can reference during implementation.
18
+
19
+ | Problem | Without MCP | With MCP |
20
+ | ------------------- | ------------------------------------------------ | ------------------------------------------------------------------ |
21
+ | Token deviation | Hardcoded colors and magic numbers | Generates using CSS variables + usage guide |
22
+ | Component misuse | Implements from generic shadcn/ui docs only | References project-specific variants, Do/Don'ts, a11y requirements |
23
+ | Inconsistent output | Different implementations per developer/prompt | Same spec = convergent design decisions |
24
+ | Lost design intent | "Why this design?" is lost during implementation | Token usage guide carries intent alongside values |
25
+
26
+ ## Tools
27
+
28
+ | Tool | Description | Arguments |
29
+ | ---------------------- | ------------------------------------------------------------------------------------------------ | --------------------------- |
30
+ | `get_design_tokens` | Returns design tokens (colors, fonts, spacing, radius, etc.) | none |
31
+ | `get_theme_css` | Returns CSS variables (`:root`, `.dark`, `@theme`) | none |
32
+ | `get_component_list` | Returns a list of available components | none |
33
+ | `get_component_spec` | Returns the spec for a component (props, variants, etc.) | `component`: component name |
34
+ | `search_components` | Searches components by keyword (Japanese supported) | `query`: search query |
35
+ | `get_wireframes` | Returns wireframe screen list and navigation flows | none |
36
+ | `get_wireframe_detail` | Returns screen details (components, states, behaviors) | `screen_id`: screen ID |
37
+ | `get_concept` | Returns concept info (brand personality, mood, visual style, target users, design principles) | none |
38
+ | `get_design_rationale` | Returns design philosophy, decision rationale, UX principles, color strategy, typography choices | none |
39
+
40
+ ### Example Output
41
+
42
+ **`get_design_tokens`** — Usage guide + raw JSON
43
+
44
+ ```text
45
+ # Design Token Usage Guide
46
+
47
+ ## Colors
48
+ - `primary`: Brand color. Use for primary buttons, links, and key interactive elements.
49
+ - `secondary`: Supporting color. Use for secondary actions.
50
+ ...
51
+
52
+ ## Raw Design Tokens (JSON)
53
+ { "colors": { "light": { ... }, "dark": { ... } }, "fontFamily": { ... }, ... }
54
+ ```
55
+
56
+ **`get_theme_css`** — Drop-in CSS for `theme.css`
57
+
58
+ ```css
59
+ :root {
60
+ --color-primary-9: #4f46e5;
61
+ --radius: 0.5rem;
62
+ --spacing: 0.25rem;
63
+ ...
64
+ }
65
+ .dark { ... }
66
+ @theme { --color-background: var(--background); ... }
67
+ ```
68
+
69
+ **`get_component_spec`** — Human-readable guide + registry spec (JSON)
70
+
71
+ ````text
72
+ # Button — Component Usage Guide
73
+
74
+ > Displays a button or a component that looks like a button.
75
+
76
+ **Category**: form
77
+
78
+ ## Structure
79
+ Single element component (cva-based) with variants.
80
+
81
+ ## Variants
82
+ - `variant`: default | destructive | outline | secondary | ghost | link
83
+ - `size`: default | sm | lg | icon
84
+
85
+ ## Dependencies
86
+ - `@radix-ui/react-slot`
87
+
88
+ ## Accessibility
89
+ - Use <button> for actions, <a> for navigation (use asChild with Link)
90
+ - Always provide accessible label: visible text or aria-label for icon buttons
91
+ - Disabled buttons must use disabled attribute, not aria-disabled
92
+
93
+ ## States
94
+ Supported: hover, focus-visible, active, disabled
95
+
96
+ ## Do NOT
97
+ - Do not use color props — use variant instead
98
+ - Do not hardcode border-radius — it comes from design tokens
99
+ - Do not nest interactive elements inside a button
100
+ - Do not use ghost/link variant for primary actions
101
+
102
+ ## Important Rules
103
+ - Always use design token CSS variables — never hardcode colors or spacing.
104
+ - Follow the variant system — do not create ad-hoc style overrides.
105
+
106
+ ---
107
+
108
+ ## Registry Spec (JSON)
109
+ ```json
110
+ {
111
+ "name": "button",
112
+ "title": "Button",
113
+ "description": "Displays a button or a component that looks like a button.",
114
+ "categories": ["form"],
115
+ "registryDependencies": [],
116
+ "dependencies": ["@radix-ui/react-slot"],
117
+ "files": [{ "path": "ui/button.tsx", "type": "registry:ui" }],
118
+ "cssVars": { "light": {}, "dark": {} }
119
+ }
120
+ ````
121
+
122
+ Components with registered metadata return both a guide and registry JSON. Components without metadata return registry JSON only.
123
+
124
+ **`get_component_list`** — Array of component summaries
125
+
126
+ ```json
127
+ {
128
+ "components": [
129
+ {
130
+ "name": "button",
131
+ "title": "Button",
132
+ "description": "...",
133
+ "categories": ["form"]
134
+ },
135
+ {
136
+ "name": "card",
137
+ "title": "Card",
138
+ "description": "...",
139
+ "categories": ["layout"]
140
+ }
141
+ ]
142
+ }
143
+ ```
144
+
145
+ **`search_components`** — Keyword search (Japanese-to-English mapping supported)
146
+
147
+ ```text
148
+ ## Search Results for "ボタン"
149
+
150
+ | Component | Title | Categories | Score |
151
+ |-----------|-------|------------|-------|
152
+ | `button` | Button | form | 100 |
153
+ | `button-group` | Button Group | form | 80 |
154
+ ...
155
+
156
+ Use `get_component_spec` with a component name for full details.
157
+ ```
158
+
159
+ **`get_wireframes`** — Screen list + navigation flow + raw JSON
160
+
161
+ ```text
162
+ # Wireframe Overview
163
+
164
+ Total screens: 22
165
+
166
+ ## Screen Map
167
+ | ID | Name | Purpose | Group | Journey Stage | Components |
168
+ ...
169
+
170
+ ## Screen Groups
171
+ ### auth
172
+ - `login` — **Login**: User login
173
+ ...
174
+
175
+ ## Navigation Flow
176
+ Login --[submit] "Login successful"--> Dashboard
177
+ ...
178
+
179
+ ## Raw Wireframe (JSON)
180
+ { "screens": [...], "transitions": [...], "metadata": { ... } }
181
+ ```
182
+
183
+ **`get_wireframe_detail`** — Screen details (component layout, UI states, behaviors)
184
+
185
+ ```text
186
+ # Screen: Dashboard
187
+
188
+ **ID**: `dashboard`
189
+ **Purpose**: Display project overview on the dashboard
190
+ **Group**: authenticated
191
+
192
+ ## Components
193
+ | ID | Type | Label | DataKey | Position (x,y) | Size (w×h) |
194
+ ...
195
+
196
+ ## UI States
197
+ ### Initial State
198
+ - **Condition**: Data not yet loaded
199
+ - **Display**: Loading indicator
200
+
201
+ ## Behaviors
202
+ | Action | Result | On Error |
203
+ ...
204
+
205
+ ## Related Screens
206
+ - `settings` — **Settings**: Settings page
207
+
208
+ ## Raw Screen (JSON)
209
+ { "id": "dashboard", "components": [...], ... }
210
+ ```
211
+
212
+ **`get_concept`** — Brand personality, visual style, target audience, design principles
213
+
214
+ ```text
215
+ # Concept: GreenHarvest
216
+
217
+ ## Brand Identity
218
+ - **Project**: GreenHarvest
219
+ - **Service**: Organic food e-commerce
220
+ - **Domain**: Food & E-commerce
221
+ - **Brand Personality**: Natural, warm, and trustworthy
222
+
223
+ ## Visual Direction
224
+ - **Aesthetic**: Natural & Organic
225
+ - **Mood**: Warmth & Trust
226
+ - **Era**: Modern
227
+ - **Inspiration**: A farm at dawn
228
+
229
+ ## Target Audience
230
+ - **Demographics**: Ages 30-50, health-conscious urban residents
231
+ - **Psychographics**: High concern for food safety
232
+ - **Pain Points**: Difficulty finding trustworthy organic food
233
+ - **Aspirations**: Providing safe meals for their family
234
+
235
+ ## Design Principles
236
+ - Visuals that evoke natural materials
237
+ - Simple and intuitive navigation
238
+ ...
239
+
240
+ ## Raw Concept (JSON)
241
+ { "projectName": "GreenHarvest", "brandPersonality": "...", ... }
242
+ ```
243
+
244
+ **`get_design_rationale`** — Design philosophy, color strategy, typography rationale, UX principles
245
+
246
+ ```text
247
+ # Design Rationale
248
+
249
+ ## Philosophy
250
+ A design that emphasizes harmony with nature and gives users a sense of security.
251
+
252
+ ## Interface Approach
253
+ Minimal and intuitive. Clean layouts that maximize product appeal.
254
+
255
+ ## Color Strategy
256
+ - **Base**: Earth tones (warm beige and brown)
257
+ - **Accent**: Fresh green (#4CAF50)
258
+ - **Accent Meaning**: Symbolizes nature, freshness, and organic quality
259
+
260
+ ## Typography
261
+ - **Choice**: Noto Sans JP
262
+ - **Rationale**: High readability without compromising the natural aesthetic
263
+
264
+ ## UX Principles
265
+ - Highlight product origin and producer information
266
+ - Complete purchase flow in 3 steps or fewer
267
+ ...
268
+
269
+ ## Raw Design Analysis (JSON)
270
+ { "philosophy": "...", "colorStrategyBase": "...", ... }
271
+ ```
272
+
273
+ ## Setup
274
+
275
+ ### Prerequisites
276
+
277
+ | Requirement | Description |
278
+ | --------------- | --------------------------------------------- |
279
+ | Node.js | 18.18 or later |
280
+ | Vaden Dashboard | A project created (design system is optional) |
281
+ | Registry Token | Issued from Dashboard > Settings > Tokens |
282
+
283
+ ### 1. Install
284
+
285
+ ```bash
286
+ npm install -g @vadenai/mcp-server
287
+ ```
288
+
289
+ ### 2. Issue a Token
290
+
291
+ Go to your Vaden Dashboard > Settings > Tokens. Set a label and expiration, then copy the token shown after creation. Store tokens securely and never commit them to version control.
292
+
293
+ ### 3. Configure MCP
294
+
295
+ #### Claude Code (`.claude/mcp.json`)
296
+
297
+ Set the token as an environment variable (recommended for security):
298
+
299
+ ```bash
300
+ export VADEN_TOKEN="your-token-here"
301
+ ```
302
+
303
+ Then configure MCP:
304
+
305
+ ```json
306
+ {
307
+ "mcpServers": {
308
+ "vaden": {
309
+ "command": "vaden-mcp-server",
310
+ "args": ["--project-id", "your-project-id"]
311
+ }
312
+ }
313
+ }
314
+ ```
315
+
316
+ The server reads `VADEN_TOKEN` from the environment automatically. You can also pass it via `--token`, but environment variables are preferred to avoid leaking secrets in config files.
317
+
318
+ #### Cursor (Settings > MCP Servers)
319
+
320
+ Add the same `command` and `args` to Cursor's MCP settings.
321
+
322
+ #### Environment Variables
323
+
324
+ All options can be set via environment variables:
325
+
326
+ ```bash
327
+ export VADEN_PROJECT_ID="your-project-id"
328
+ export VADEN_TOKEN="your-token-here"
329
+ export VADEN_API_URL="https://app.vaden.ai" # default if omitted
330
+ ```
331
+
332
+ ## CLI Options
333
+
334
+ ```bash
335
+ vaden-mcp-server [options]
336
+ ```
337
+
338
+ | Option | Environment Variable | Required | Description |
339
+ | ------------------- | -------------------- | ------------ | ---------------------------------------------- |
340
+ | `--project-id <id>` | `VADEN_PROJECT_ID` | Yes (either) | Vaden project ID |
341
+ | `--token <jwt>` | `VADEN_TOKEN` | Yes (either) | Registry Token (JWT) |
342
+ | `--api-url <url>` | `VADEN_API_URL` | No | API endpoint (default: `https://app.vaden.ai`) |
343
+
344
+ > **Note**: "Yes (either)" means the value must be provided via the CLI argument or the environment variable — either one satisfies the requirement.
345
+
346
+ ## Security
347
+
348
+ - **Never commit tokens to Git** — If you hardcode tokens in `.claude/mcp.json` or similar config files, add them to `.gitignore`
349
+ - **Prefer environment variables** — `VADEN_TOKEN` is the safest way to configure your token
350
+ - **Principle of least privilege** — Use `read` + `design-system` scope when `read-write` + `project` is not needed
351
+ - **Rotate tokens regularly** — Issue new tokens from the Dashboard (Settings > Tokens) and revoke old ones
352
+ - **If a token leaks** — Revoke it immediately from the Dashboard
353
+
354
+ ## License
355
+
356
+ [MIT](./LICENSE)
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Vaden レジストリ API クライアント
3
+ *
4
+ * Bearer トークン認証で Vaden API にアクセスする。
5
+ * packages/vaden-sdk/src/api-client.ts を参考にした独立実装。
6
+ */
7
+ export declare class VadenMcpApiClient {
8
+ private readonly baseUrl;
9
+ private readonly token;
10
+ private readonly timeoutMs;
11
+ constructor(baseUrl: string, token: string);
12
+ private headers;
13
+ private buildUrl;
14
+ get<T>(path: string): Promise<T>;
15
+ }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Vaden レジストリ API クライアント
3
+ *
4
+ * Bearer トークン認証で Vaden API にアクセスする。
5
+ * packages/vaden-sdk/src/api-client.ts を参考にした独立実装。
6
+ */
7
+ export class VadenMcpApiClient {
8
+ baseUrl;
9
+ token;
10
+ timeoutMs = 30_000;
11
+ constructor(baseUrl, token) {
12
+ this.baseUrl = baseUrl;
13
+ this.token = token;
14
+ }
15
+ headers() {
16
+ return {
17
+ "Content-Type": "application/json",
18
+ Authorization: `Bearer ${this.token}`,
19
+ };
20
+ }
21
+ buildUrl(path) {
22
+ const base = this.baseUrl.endsWith("/") ? this.baseUrl : `${this.baseUrl}/`;
23
+ const cleanPath = path.startsWith("/") ? path.slice(1) : path;
24
+ return new URL(cleanPath, base).toString();
25
+ }
26
+ async get(path) {
27
+ const url = this.buildUrl(path);
28
+ const controller = new AbortController();
29
+ const timeoutId = setTimeout(() => controller.abort(), this.timeoutMs);
30
+ try {
31
+ const response = await fetch(url, {
32
+ method: "GET",
33
+ headers: this.headers(),
34
+ signal: controller.signal,
35
+ });
36
+ if (!response.ok) {
37
+ const body = await response.text();
38
+ throw new Error(`API error (${response.status}): ${body}`);
39
+ }
40
+ return (await response.json());
41
+ }
42
+ catch (error) {
43
+ if (error instanceof Error && error.name === "AbortError") {
44
+ throw new Error(`Request timeout after ${this.timeoutMs}ms: ${url}`);
45
+ }
46
+ throw error;
47
+ }
48
+ finally {
49
+ clearTimeout(timeoutId);
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * 全コンポーネントの構造メタデータ
3
+ *
4
+ * ComponentStyleConfig から抽出した静的情報。
5
+ * MCP Server 側でコンポーネントガイドを生成するためのデータソース。
6
+ *
7
+ * - type: "single" (cva ベース) / "multipart" (slots ベース)
8
+ * - variants: バリアントキーとそのオプション
9
+ * - slots: multipart の構成パーツ
10
+ * - dependencies: Radix UI 等の実行時依存
11
+ * - a11y: アクセシビリティ上の注意事項
12
+ * - states: 対応する UI ステート
13
+ * - doNot: よくある誤用・禁止事項
14
+ */
15
+ interface ComponentMetadata {
16
+ type: "single" | "multipart";
17
+ variants?: Record<string, string[]>;
18
+ slots?: string[];
19
+ dependencies?: string[];
20
+ a11y?: string[];
21
+ states?: string[];
22
+ doNot?: string[];
23
+ }
24
+ export declare const componentMetadata: Record<string, ComponentMetadata>;
25
+ export {};