@monoharada/wcf-mcp 0.9.0 → 0.9.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 +8 -4
- package/bin.mjs +160 -15
- package/core/cem.mjs +923 -0
- package/core/constants.mjs +143 -0
- package/core/plugins.mjs +158 -0
- package/core/prefix.mjs +165 -0
- package/core/register.mjs +1469 -0
- package/core/response.mjs +149 -0
- package/core/tokens.mjs +379 -0
- package/core.mjs +142 -3339
- package/data/custom-elements.json +0 -18
- package/data/design-tokens.json +1 -1
- package/data/guidelines-index.json +16 -12
- package/data/llms-full.txt +7 -7
- package/data/skills-registry.json +345 -0
- package/package.json +3 -1
- package/runtime-data.mjs +55 -0
- package/server.mjs +20 -44
|
@@ -42282,24 +42282,6 @@
|
|
|
42282
42282
|
}
|
|
42283
42283
|
]
|
|
42284
42284
|
},
|
|
42285
|
-
{
|
|
42286
|
-
"kind": "method",
|
|
42287
|
-
"name": "#isSlottedControlClick",
|
|
42288
|
-
"privacy": "private",
|
|
42289
|
-
"return": {
|
|
42290
|
-
"type": {
|
|
42291
|
-
"text": "boolean"
|
|
42292
|
-
}
|
|
42293
|
-
},
|
|
42294
|
-
"parameters": [
|
|
42295
|
-
{
|
|
42296
|
-
"name": "path",
|
|
42297
|
-
"type": {
|
|
42298
|
-
"text": "readonly EventTarget[]"
|
|
42299
|
-
}
|
|
42300
|
-
}
|
|
42301
|
-
]
|
|
42302
|
-
},
|
|
42303
42285
|
{
|
|
42304
42286
|
"kind": "method",
|
|
42305
42287
|
"name": "#isUsablePrimaryTitleLink",
|
package/data/design-tokens.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "0.1.0",
|
|
3
|
-
"indexedAt": "2026-03-
|
|
3
|
+
"indexedAt": "2026-03-07T09:50:20.703Z",
|
|
4
4
|
"documents": [
|
|
5
5
|
{
|
|
6
6
|
"id": ".claude/skills/css-writing-rules/references/core-principles.md",
|
|
@@ -4304,7 +4304,7 @@
|
|
|
4304
4304
|
"両方指定時は"
|
|
4305
4305
|
],
|
|
4306
4306
|
"snippet": "```typescript\n/** カスタムツール定義 */\ninterface WcfMcpPluginTool {\n /** ツール名(必須。組み込みツール名と重複不可) */\n name: string;\n /** ツールの説明 */\n description?: string;\n /** 入力スキーマ(JSON Schema 形式) */\n inputSchema?: Record<string, unknown>;\n /** 動的ハンドラ関数。両方指定時は handler が優先される */\n handler?: (args: Record<string, unknown>, context: WcfMcpHandlerContext) => unknown | Promise<unknown>;\n /** 静的レスポンスペイロード。handler がある場合は無視される */\n staticPayload?: unknown;\n}\n```\n\n### handler vs staticPayload\n\n- `handler`: リクエストごとに実行される関",
|
|
4307
|
-
"body": "### handler vs staticPayload - `handler`: リクエストごとに実行される関数。動的な結果を返す場合に使用 - `staticPayload`: 固定のレスポンスを返す場合に使用 - **両方指定した場合**: `handler` が優先され、`staticPayload` は無視される - **どちらも未指定**: バリデーションエラー(少なくとも一方が必須)",
|
|
4307
|
+
"body": "### handler vs staticPayload - `handler`: リクエストごとに実行される関数。動的な結果を返す場合に使用 - `staticPayload`: 固定のレスポンスを返す場合に使用 - **両方指定した場合**: `handler` が優先され、`staticPayload` は無視される - **どちらも未指定**: バリデーションエラー(少なくとも一方が必須) - `handler` は plain payload のほか raw MCP result(`{ content: [...] }`)を返してもよい - ただし最終返却サイズには 100KB 上限が適用され、上限を超える raw result は `TOOL_RESULT_TOO_LARGE` warning payload に置き換わる",
|
|
4308
4308
|
"startLine": 25
|
|
4309
4309
|
},
|
|
4310
4310
|
{
|
|
@@ -4329,11 +4329,11 @@
|
|
|
4329
4329
|
"filename",
|
|
4330
4330
|
"promise",
|
|
4331
4331
|
"unknown",
|
|
4332
|
-
"
|
|
4332
|
+
"テキストデータファイルを読み込む"
|
|
4333
4333
|
],
|
|
4334
|
-
"snippet": "```typescript\n/** handler 関数に渡されるコンテキスト */\ninterface WcfMcpHandlerContext {\n /** プラグイン自身の情報 */\n plugin: { name: string; version: string };\n /** 共通ヘルパー */\n helpers: {\n /** JSON データファイルを読み込む */\n loadJsonData: (fileName: string) => Promise<unknown>;\n /** ツール応答を MCP 形式の JSON テキストに変換する */\n buildJsonToolResponse: (payload: unknown) => { content: Array<{ type: string; text: string }> };\n /**
|
|
4334
|
+
"snippet": "```typescript\n/** handler 関数に渡されるコンテキスト */\ninterface WcfMcpHandlerContext {\n /** プラグイン自身の情報 */\n plugin: { name: string; version: string };\n /** 共通ヘルパー */\n helpers: {\n /** JSON データファイルを読み込む */\n loadJsonData: (fileName: string) => Promise<unknown>;\n /** テキストデータファイルを読み込む (v1.1+) */\n loadTextData: (fileName: string) => Promise<string>;\n /** ツール応答を MCP 形式の JSON テキストに変換する */\n buildJsonToolResponse: (payload: unknown) => { content: Array<{ type: string; text: string }> };\n /** ",
|
|
4335
4335
|
"body": "",
|
|
4336
|
-
"startLine":
|
|
4336
|
+
"startLine": 52
|
|
4337
4337
|
},
|
|
4338
4338
|
{
|
|
4339
4339
|
"heading": "DataSource オブジェクト",
|
|
@@ -4361,7 +4361,7 @@
|
|
|
4361
4361
|
],
|
|
4362
4362
|
"snippet": "```typescript\n/** データソース差し替え定義 */\ninterface WcfMcpDataSourceConfig {\n /** 差し替え対象のファイル名 */\n fileName: string;\n /** 差し替えファイルのパス */\n path: string;\n}\n```\n\n### 差し替え可能なファイル\n\n| fileName | 説明 |\n|----------|------|\n| `custom-elements.json` | Custom Elements Manifest |\n| `install-registry.json` | インストールレジストリ |\n| `pattern-registry.json` | パターンレジストリ |\n| `design-tokens.json` | デザイントークン |\n| `guidelines-index.json` | ガイドラインインデックス |",
|
|
4363
4363
|
"body": "### 差し替え可能なファイル | fileName | 説明 | |----------|------| | `custom-elements.json` | Custom Elements Manifest | | `install-registry.json` | インストールレジストリ | | `pattern-registry.json` | パターンレジストリ | | `design-tokens.json` | デザイントークン | | `guidelines-index.json` | ガイドラインインデックス |",
|
|
4364
|
-
"startLine":
|
|
4364
|
+
"startLine": 77
|
|
4365
4365
|
},
|
|
4366
4366
|
{
|
|
4367
4367
|
"heading": "バリデーションルール",
|
|
@@ -4378,7 +4378,7 @@
|
|
|
4378
4378
|
],
|
|
4379
4379
|
"snippet": "1. `name` と `version` は必須\n2. ツール名は組み込みツール名と重複不可\n3. 複数プラグイン間でツール名の重複不可\n4. `dataSources` のファイル名は上記5種のみ\n5. 複数プラグイン間で同一ファイルの重複差し替え不可",
|
|
4380
4380
|
"body": "1. `name` と `version` は必須 2. ツール名は組み込みツール名と重複不可 3. 複数プラグイン間でツール名の重複不可 4. `dataSources` のファイル名は上記5種のみ 5. 複数プラグイン間で同一ファイルの重複差し替え不可",
|
|
4381
|
-
"startLine":
|
|
4381
|
+
"startLine": 99
|
|
4382
4382
|
},
|
|
4383
4383
|
{
|
|
4384
4384
|
"heading": "互換性ポリシー",
|
|
@@ -4387,15 +4387,19 @@
|
|
|
4387
4387
|
"契約バージョン",
|
|
4388
4388
|
"plugin_contract_version",
|
|
4389
4389
|
"定数で公開",
|
|
4390
|
+
"helpers",
|
|
4391
|
+
"loadtextdata",
|
|
4392
|
+
"テキストファイルの読み込み",
|
|
4393
|
+
"utf-8",
|
|
4390
4394
|
"破壊的変更なし",
|
|
4391
4395
|
"新フィールドは追加のみ",
|
|
4392
4396
|
"既存フィールドの削除・型変更なし",
|
|
4393
4397
|
"破壊的変更を含む可能性あり",
|
|
4394
4398
|
"メジャーバージョンアップで通知"
|
|
4395
4399
|
],
|
|
4396
|
-
"snippet": "- **契約バージョン**: `1.
|
|
4397
|
-
"body": "- **契約バージョン**: `1.
|
|
4398
|
-
"startLine":
|
|
4400
|
+
"snippet": "- **契約バージョン**: `1.1.0`(`PLUGIN_CONTRACT_VERSION` 定数で公開)\n- **v1.1 追加**: `helpers.loadTextData` — テキストファイルの読み込み(UTF-8)\n- **v1.x 内**: 破壊的変更なし。新フィールドは追加のみ(既存フィールドの削除・型変更なし)\n- **v2.0**: 破壊的変更を含む可能性あり。メジャーバージョンアップで通知",
|
|
4401
|
+
"body": "- **契約バージョン**: `1.1.0`(`PLUGIN_CONTRACT_VERSION` 定数で公開) - **v1.1 追加**: `helpers.loadTextData` — テキストファイルの読み込み(UTF-8) - **v1.x 内**: 破壊的変更なし。新フィールドは追加のみ(既存フィールドの削除・型変更なし) - **v2.0**: 破壊的変更を含む可能性あり。メジャーバージョンアップで通知",
|
|
4402
|
+
"startLine": 107
|
|
4399
4403
|
},
|
|
4400
4404
|
{
|
|
4401
4405
|
"heading": "@experimental 機能",
|
|
@@ -4410,7 +4414,7 @@
|
|
|
4410
4414
|
],
|
|
4411
4415
|
"snippet": "以下は将来追加される可能性がありますが、まだ安定していません:\n\n- ライフサイクルフック(`onInit`, `onDestroy`)\n- プラグイン間依存の宣言",
|
|
4412
4416
|
"body": "以下は将来追加される可能性がありますが、まだ安定していません: - ライフサイクルフック(`onInit`, `onDestroy`) - プラグイン間依存の宣言",
|
|
4413
|
-
"startLine":
|
|
4417
|
+
"startLine": 114
|
|
4414
4418
|
},
|
|
4415
4419
|
{
|
|
4416
4420
|
"heading": "設定ファイルからの利用",
|
|
@@ -4438,7 +4442,7 @@
|
|
|
4438
4442
|
],
|
|
4439
4443
|
"snippet": "```json\n{\n \"plugins\": [\n {\n \"module\": \"./plugins/my-plugin.mjs\"\n },\n {\n \"name\": \"static-tools\",\n \"version\": \"1.0.0\",\n \"staticTools\": [\n { \"name\": \"my_tool\", \"payload\": { \"ok\": true } }\n ]\n }\n ]\n}\n```\n\n### module プラグイン\n\nESM ファイルが `default export` でプラグインオブジェクトを返す:\n\n```javascript\n// plugins/my-plugin.mjs\nexport default {\n name: 'my-plugin',\n version: '1.0.0',\n tools: [\n {\n name: 'my_custom_tool',\n description: 'Custom tool from plugin',\n",
|
|
4440
4444
|
"body": "### module プラグイン ESM ファイルが `default export` でプラグインオブジェクトを返す:",
|
|
4441
|
-
"startLine":
|
|
4445
|
+
"startLine": 121
|
|
4442
4446
|
}
|
|
4443
4447
|
]
|
|
4444
4448
|
},
|
package/data/llms-full.txt
CHANGED
|
@@ -5083,9 +5083,9 @@ Requires: `heading`, `fieldset`, `input-text`, `select`, `textarea`, `button`
|
|
|
5083
5083
|
<form id="application-form-single">
|
|
5084
5084
|
<dads-fieldset>
|
|
5085
5085
|
<legend>申請情報</legend>
|
|
5086
|
-
<dads-input-text name="name" required error error-text="氏名は必須です"></dads-input-text>
|
|
5087
|
-
<dads-select name="type" required></dads-select>
|
|
5088
|
-
<dads-textarea name="reason" required></dads-textarea>
|
|
5086
|
+
<dads-input-text label="氏名" name="name" required error error-text="氏名は必須です"></dads-input-text>
|
|
5087
|
+
<dads-select label="種別" name="type" required></dads-select>
|
|
5088
|
+
<dads-textarea label="理由" name="reason" required></dads-textarea>
|
|
5089
5089
|
</dads-fieldset>
|
|
5090
5090
|
<dads-button type="submit">送信</dads-button>
|
|
5091
5091
|
</form>
|
|
@@ -5105,7 +5105,7 @@ Requires: `heading`, `step-navigation`, `fieldset`, `input-text`, `button`
|
|
|
5105
5105
|
<form id="application-form-step">
|
|
5106
5106
|
<dads-fieldset>
|
|
5107
5107
|
<legend>ステップ1: 申請者情報</legend>
|
|
5108
|
-
<dads-input-text name="name" required error error-text="氏名は必須です"></dads-input-text>
|
|
5108
|
+
<dads-input-text label="氏名" name="name" required error error-text="氏名は必須です"></dads-input-text>
|
|
5109
5109
|
</dads-fieldset>
|
|
5110
5110
|
<dads-button type="submit">次へ</dads-button>
|
|
5111
5111
|
</form>
|
|
@@ -5184,9 +5184,9 @@ Requires: `device-mock`, `heading`, `fieldset`, `input-text`, `select`, `textare
|
|
|
5184
5184
|
<form>
|
|
5185
5185
|
<dads-fieldset>
|
|
5186
5186
|
<legend>基本情報</legend>
|
|
5187
|
-
<dads-input-text name="name" required></dads-input-text>
|
|
5188
|
-
<dads-select name="type" required></dads-select>
|
|
5189
|
-
<dads-textarea name="detail" required></dads-textarea>
|
|
5187
|
+
<dads-input-text label="氏名" name="name" required></dads-input-text>
|
|
5188
|
+
<dads-select label="種別" name="type" required></dads-select>
|
|
5189
|
+
<dads-textarea label="詳細" name="detail" required></dads-textarea>
|
|
5190
5190
|
</dads-fieldset>
|
|
5191
5191
|
<dads-button type="submit">確認へ進む</dads-button>
|
|
5192
5192
|
</form>
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 2,
|
|
3
|
+
"sourceOfTruth": ".claude/skills",
|
|
4
|
+
"clients": {
|
|
5
|
+
"codex": {
|
|
6
|
+
"description": "Codex local skills install destination (~/.codex/skills)"
|
|
7
|
+
},
|
|
8
|
+
"claude_code": {
|
|
9
|
+
"description": "Claude Code project-level skill references"
|
|
10
|
+
},
|
|
11
|
+
"cursor": {
|
|
12
|
+
"description": "Cursor project-level skill references"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"skills": [
|
|
16
|
+
{
|
|
17
|
+
"name": "component-design-study",
|
|
18
|
+
"path": ".claude/skills/component-design-study",
|
|
19
|
+
"entry": "SKILL.md",
|
|
20
|
+
"clients": [
|
|
21
|
+
"codex",
|
|
22
|
+
"claude_code",
|
|
23
|
+
"cursor"
|
|
24
|
+
],
|
|
25
|
+
"status": "active",
|
|
26
|
+
"description": "Drive design studies for new web components with evidence-based variant selection.",
|
|
27
|
+
"tags": [
|
|
28
|
+
"spec",
|
|
29
|
+
"workflow"
|
|
30
|
+
],
|
|
31
|
+
"version": "1.0.0",
|
|
32
|
+
"dependencies": [],
|
|
33
|
+
"compat": {
|
|
34
|
+
"minVersion": {
|
|
35
|
+
"claude_code": "1.0",
|
|
36
|
+
"cursor": "0.50",
|
|
37
|
+
"codex": "0.1"
|
|
38
|
+
},
|
|
39
|
+
"capabilities": [
|
|
40
|
+
"read_repo",
|
|
41
|
+
"web_fetch"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"manifest": {
|
|
45
|
+
"author": "wcf-team",
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"entryFormat": "markdown",
|
|
48
|
+
"sections": [
|
|
49
|
+
"overview",
|
|
50
|
+
"workflow",
|
|
51
|
+
"do_dont",
|
|
52
|
+
"references"
|
|
53
|
+
],
|
|
54
|
+
"sizeBytes": 30404,
|
|
55
|
+
"lastUpdated": "2026-03-04"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "css-writing-rules",
|
|
60
|
+
"path": ".claude/skills/css-writing-rules",
|
|
61
|
+
"entry": "SKILL.md",
|
|
62
|
+
"clients": [
|
|
63
|
+
"codex",
|
|
64
|
+
"claude_code",
|
|
65
|
+
"cursor"
|
|
66
|
+
],
|
|
67
|
+
"status": "active",
|
|
68
|
+
"description": "CSS coding guidelines for Web Components with Shadow DOM.",
|
|
69
|
+
"tags": [
|
|
70
|
+
"spec",
|
|
71
|
+
"token"
|
|
72
|
+
],
|
|
73
|
+
"version": "1.0.0",
|
|
74
|
+
"dependencies": [],
|
|
75
|
+
"compat": {
|
|
76
|
+
"minVersion": {
|
|
77
|
+
"claude_code": "1.0",
|
|
78
|
+
"cursor": "0.50",
|
|
79
|
+
"codex": "0.1"
|
|
80
|
+
},
|
|
81
|
+
"capabilities": [
|
|
82
|
+
"read_repo"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"manifest": {
|
|
86
|
+
"author": "wcf-team",
|
|
87
|
+
"license": "MIT",
|
|
88
|
+
"entryFormat": "markdown",
|
|
89
|
+
"sections": [
|
|
90
|
+
"overview",
|
|
91
|
+
"workflow",
|
|
92
|
+
"do_dont",
|
|
93
|
+
"references"
|
|
94
|
+
],
|
|
95
|
+
"sizeBytes": 43328,
|
|
96
|
+
"lastUpdated": "2026-03-04"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"name": "headless-component-design",
|
|
101
|
+
"path": ".claude/skills/headless-component-design",
|
|
102
|
+
"entry": "SKILL.md",
|
|
103
|
+
"clients": [
|
|
104
|
+
"codex",
|
|
105
|
+
"claude_code",
|
|
106
|
+
"cursor"
|
|
107
|
+
],
|
|
108
|
+
"status": "active",
|
|
109
|
+
"description": "Headless Web Component design patterns with DADS conventions.",
|
|
110
|
+
"tags": [
|
|
111
|
+
"spec"
|
|
112
|
+
],
|
|
113
|
+
"version": "1.0.0",
|
|
114
|
+
"dependencies": [],
|
|
115
|
+
"compat": {
|
|
116
|
+
"minVersion": {
|
|
117
|
+
"claude_code": "1.0",
|
|
118
|
+
"cursor": "0.50",
|
|
119
|
+
"codex": "0.1"
|
|
120
|
+
},
|
|
121
|
+
"capabilities": [
|
|
122
|
+
"read_repo"
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
"manifest": {
|
|
126
|
+
"author": "wcf-team",
|
|
127
|
+
"license": "MIT",
|
|
128
|
+
"entryFormat": "markdown",
|
|
129
|
+
"sections": [
|
|
130
|
+
"overview",
|
|
131
|
+
"do_dont",
|
|
132
|
+
"references"
|
|
133
|
+
],
|
|
134
|
+
"sizeBytes": 24403,
|
|
135
|
+
"lastUpdated": "2026-03-04"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "wcf-compose",
|
|
140
|
+
"path": ".claude/skills/wcf-compose",
|
|
141
|
+
"entry": "SKILL.md",
|
|
142
|
+
"clients": [
|
|
143
|
+
"codex",
|
|
144
|
+
"claude_code",
|
|
145
|
+
"cursor"
|
|
146
|
+
],
|
|
147
|
+
"status": "active",
|
|
148
|
+
"description": "Compose screen HTML and state variants from installed component IDs.",
|
|
149
|
+
"tags": [
|
|
150
|
+
"workflow"
|
|
151
|
+
],
|
|
152
|
+
"version": "1.0.0",
|
|
153
|
+
"dependencies": [
|
|
154
|
+
"wcf-install"
|
|
155
|
+
],
|
|
156
|
+
"compat": {
|
|
157
|
+
"minVersion": {
|
|
158
|
+
"claude_code": "1.0",
|
|
159
|
+
"cursor": "0.50",
|
|
160
|
+
"codex": "0.1"
|
|
161
|
+
},
|
|
162
|
+
"capabilities": [
|
|
163
|
+
"read_repo",
|
|
164
|
+
"write_repo"
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
"manifest": {
|
|
168
|
+
"author": "wcf-team",
|
|
169
|
+
"license": "MIT",
|
|
170
|
+
"entryFormat": "markdown",
|
|
171
|
+
"sections": [
|
|
172
|
+
"overview",
|
|
173
|
+
"workflow"
|
|
174
|
+
],
|
|
175
|
+
"sizeBytes": 2333,
|
|
176
|
+
"lastUpdated": "2026-03-04"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "wcf-discovery",
|
|
181
|
+
"path": ".claude/skills/wcf-discovery",
|
|
182
|
+
"entry": "SKILL.md",
|
|
183
|
+
"clients": [
|
|
184
|
+
"codex",
|
|
185
|
+
"claude_code",
|
|
186
|
+
"cursor"
|
|
187
|
+
],
|
|
188
|
+
"status": "active",
|
|
189
|
+
"description": "Discover component IDs and patterns from screen requirements.",
|
|
190
|
+
"tags": [
|
|
191
|
+
"workflow"
|
|
192
|
+
],
|
|
193
|
+
"version": "1.0.0",
|
|
194
|
+
"dependencies": [],
|
|
195
|
+
"compat": {
|
|
196
|
+
"minVersion": {
|
|
197
|
+
"claude_code": "1.0",
|
|
198
|
+
"cursor": "0.50",
|
|
199
|
+
"codex": "0.1"
|
|
200
|
+
},
|
|
201
|
+
"capabilities": [
|
|
202
|
+
"read_repo",
|
|
203
|
+
"mcp_tools"
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
"manifest": {
|
|
207
|
+
"author": "wcf-team",
|
|
208
|
+
"license": "MIT",
|
|
209
|
+
"entryFormat": "markdown",
|
|
210
|
+
"sections": [
|
|
211
|
+
"overview",
|
|
212
|
+
"workflow"
|
|
213
|
+
],
|
|
214
|
+
"sizeBytes": 2514,
|
|
215
|
+
"lastUpdated": "2026-03-04"
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"name": "wcf-install",
|
|
220
|
+
"path": ".claude/skills/wcf-install",
|
|
221
|
+
"entry": "SKILL.md",
|
|
222
|
+
"clients": [
|
|
223
|
+
"codex",
|
|
224
|
+
"claude_code",
|
|
225
|
+
"cursor"
|
|
226
|
+
],
|
|
227
|
+
"status": "active",
|
|
228
|
+
"description": "Resolve install order and generate WCF install commands.",
|
|
229
|
+
"tags": [
|
|
230
|
+
"workflow"
|
|
231
|
+
],
|
|
232
|
+
"version": "1.0.0",
|
|
233
|
+
"dependencies": [
|
|
234
|
+
"wcf-discovery"
|
|
235
|
+
],
|
|
236
|
+
"compat": {
|
|
237
|
+
"minVersion": {
|
|
238
|
+
"claude_code": "1.0",
|
|
239
|
+
"cursor": "0.50",
|
|
240
|
+
"codex": "0.1"
|
|
241
|
+
},
|
|
242
|
+
"capabilities": [
|
|
243
|
+
"read_repo",
|
|
244
|
+
"run_commands"
|
|
245
|
+
]
|
|
246
|
+
},
|
|
247
|
+
"manifest": {
|
|
248
|
+
"author": "wcf-team",
|
|
249
|
+
"license": "MIT",
|
|
250
|
+
"entryFormat": "markdown",
|
|
251
|
+
"sections": [
|
|
252
|
+
"overview",
|
|
253
|
+
"workflow"
|
|
254
|
+
],
|
|
255
|
+
"sizeBytes": 2341,
|
|
256
|
+
"lastUpdated": "2026-03-04"
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"name": "wcf-ui-builder",
|
|
261
|
+
"path": ".claude/skills/wcf-ui-builder",
|
|
262
|
+
"entry": "SKILL.md",
|
|
263
|
+
"clients": [
|
|
264
|
+
"codex",
|
|
265
|
+
"claude_code",
|
|
266
|
+
"cursor"
|
|
267
|
+
],
|
|
268
|
+
"status": "active",
|
|
269
|
+
"description": "Orchestrator skill for discovery, install, compose, and validate flow.",
|
|
270
|
+
"tags": [
|
|
271
|
+
"workflow"
|
|
272
|
+
],
|
|
273
|
+
"version": "1.0.0",
|
|
274
|
+
"dependencies": [
|
|
275
|
+
"wcf-discovery",
|
|
276
|
+
"wcf-install",
|
|
277
|
+
"wcf-compose",
|
|
278
|
+
"wcf-validate"
|
|
279
|
+
],
|
|
280
|
+
"compat": {
|
|
281
|
+
"minVersion": {
|
|
282
|
+
"claude_code": "1.0",
|
|
283
|
+
"cursor": "0.50",
|
|
284
|
+
"codex": "0.1"
|
|
285
|
+
},
|
|
286
|
+
"capabilities": [
|
|
287
|
+
"read_repo",
|
|
288
|
+
"write_repo",
|
|
289
|
+
"mcp_tools"
|
|
290
|
+
]
|
|
291
|
+
},
|
|
292
|
+
"manifest": {
|
|
293
|
+
"author": "wcf-team",
|
|
294
|
+
"license": "MIT",
|
|
295
|
+
"entryFormat": "markdown",
|
|
296
|
+
"sections": [
|
|
297
|
+
"overview",
|
|
298
|
+
"workflow"
|
|
299
|
+
],
|
|
300
|
+
"sizeBytes": 1986,
|
|
301
|
+
"lastUpdated": "2026-03-04"
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"name": "wcf-validate",
|
|
306
|
+
"path": ".claude/skills/wcf-validate",
|
|
307
|
+
"entry": "SKILL.md",
|
|
308
|
+
"clients": [
|
|
309
|
+
"codex",
|
|
310
|
+
"claude_code",
|
|
311
|
+
"cursor"
|
|
312
|
+
],
|
|
313
|
+
"status": "active",
|
|
314
|
+
"description": "Validate generated markup and return diagnostics with fix suggestions.",
|
|
315
|
+
"tags": [
|
|
316
|
+
"audit"
|
|
317
|
+
],
|
|
318
|
+
"version": "1.0.0",
|
|
319
|
+
"dependencies": [],
|
|
320
|
+
"compat": {
|
|
321
|
+
"minVersion": {
|
|
322
|
+
"claude_code": "1.0",
|
|
323
|
+
"cursor": "0.50",
|
|
324
|
+
"codex": "0.1"
|
|
325
|
+
},
|
|
326
|
+
"capabilities": [
|
|
327
|
+
"read_repo",
|
|
328
|
+
"mcp_tools"
|
|
329
|
+
]
|
|
330
|
+
},
|
|
331
|
+
"manifest": {
|
|
332
|
+
"author": "wcf-team",
|
|
333
|
+
"license": "MIT",
|
|
334
|
+
"entryFormat": "markdown",
|
|
335
|
+
"sections": [
|
|
336
|
+
"overview",
|
|
337
|
+
"workflow",
|
|
338
|
+
"do_dont"
|
|
339
|
+
],
|
|
340
|
+
"sizeBytes": 2129,
|
|
341
|
+
"lastUpdated": "2026-03-04"
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
]
|
|
345
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monoharada/wcf-mcp",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "MCP server for the web-components-factory design system. Provides component discovery, validation, and pattern-based UI composition without cloning the repository.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"bin.mjs",
|
|
11
11
|
"core.mjs",
|
|
12
|
+
"core/",
|
|
12
13
|
"server.mjs",
|
|
14
|
+
"runtime-data.mjs",
|
|
13
15
|
"validator.mjs",
|
|
14
16
|
"data/",
|
|
15
17
|
"examples/",
|
package/runtime-data.mjs
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
export const RUNTIME_FILE_MAP = Object.freeze({
|
|
5
|
+
'custom-elements.json': 'custom-elements.json',
|
|
6
|
+
'install-registry.json': 'registry/install-registry.json',
|
|
7
|
+
'pattern-registry.json': 'registry/pattern-registry.json',
|
|
8
|
+
'component-selector-guide.json': 'registry/component-selector-guide.json',
|
|
9
|
+
'design-tokens.json': 'packages/mcp-server/data/design-tokens.json',
|
|
10
|
+
'guidelines-index.json': 'packages/mcp-server/data/guidelines-index.json',
|
|
11
|
+
'llms-full.txt': 'llms-full.txt',
|
|
12
|
+
'skills-registry.json': 'registry/skills-registry.json',
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export function resolveRuntimeDataPath(fileName, { repoRoot = process.cwd() } = {}) {
|
|
16
|
+
const repoRelative = RUNTIME_FILE_MAP[fileName];
|
|
17
|
+
return repoRelative ? path.join(repoRoot, repoRelative) : undefined;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function resolveBundledDataPath(fileName, { bundledDir } = {}) {
|
|
21
|
+
if (!bundledDir) return undefined;
|
|
22
|
+
return path.join(bundledDir, 'data', fileName);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async function readTextIfExists(targetPath) {
|
|
26
|
+
if (!targetPath) return null;
|
|
27
|
+
try {
|
|
28
|
+
return await fs.readFile(targetPath, 'utf8');
|
|
29
|
+
} catch {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export async function loadTextDataWithFallback(fileName, { bundledDir, repoRoot = process.cwd() } = {}) {
|
|
35
|
+
const bundled = resolveBundledDataPath(fileName, { bundledDir });
|
|
36
|
+
const repo = resolveRuntimeDataPath(fileName, { repoRoot });
|
|
37
|
+
|
|
38
|
+
for (const candidate of [bundled, repo]) {
|
|
39
|
+
const text = await readTextIfExists(candidate);
|
|
40
|
+
if (text !== null) return text;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
throw new Error(`テキストデータファイルが見つかりません: ${fileName}`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export async function loadJsonDataWithFallback(fileName, options = {}) {
|
|
47
|
+
const text = await loadTextDataWithFallback(fileName, options);
|
|
48
|
+
try {
|
|
49
|
+
return JSON.parse(text);
|
|
50
|
+
} catch (error) {
|
|
51
|
+
throw new Error(
|
|
52
|
+
`データファイルのJSON解析に失敗しました: ${fileName} (${error instanceof Error ? error.message : String(error)})`,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
}
|
package/server.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import path from 'node:path';
|
|
|
10
10
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
11
11
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
12
12
|
import { createMcpServer } from './core.mjs';
|
|
13
|
+
import { loadJsonDataWithFallback, loadTextDataWithFallback } from './runtime-data.mjs';
|
|
13
14
|
|
|
14
15
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
15
16
|
|
|
@@ -17,51 +18,24 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
17
18
|
// Data loading — bundled data/ first, then repo root fallback
|
|
18
19
|
// ---------------------------------------------------------------------------
|
|
19
20
|
|
|
20
|
-
const REPO_FILE_MAP = {
|
|
21
|
-
'custom-elements.json': 'custom-elements.json',
|
|
22
|
-
'install-registry.json': 'registry/install-registry.json',
|
|
23
|
-
'pattern-registry.json': 'registry/pattern-registry.json',
|
|
24
|
-
'component-selector-guide.json': 'registry/component-selector-guide.json',
|
|
25
|
-
'design-tokens.json': 'design-tokens.json',
|
|
26
|
-
'guidelines-index.json': 'guidelines-index.json',
|
|
27
|
-
'llms-full.txt': 'llms-full.txt',
|
|
28
|
-
'skills-registry.json': 'registry/skills-registry.json',
|
|
29
|
-
};
|
|
30
21
|
export const DEFAULT_WCF_MCP_CONFIG = 'wcf-mcp.config.json';
|
|
31
22
|
|
|
32
|
-
function
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// Try next path
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
throw new Error(`データファイルが見つかりません: ${fileName}`);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
async function loadTextData(fileName) {
|
|
55
|
-
const { bundled, repo } = resolveDataPath(fileName);
|
|
56
|
-
for (const p of [bundled, repo]) {
|
|
57
|
-
if (!p) continue;
|
|
58
|
-
try {
|
|
59
|
-
return await fs.readFile(p, 'utf8');
|
|
60
|
-
} catch {
|
|
61
|
-
// Try next path
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
throw new Error(`テキストデータファイルが見つかりません: ${fileName}`);
|
|
23
|
+
export function createRuntimeDataLoaders({ cwd = process.cwd() } = {}) {
|
|
24
|
+
const repoRoot = path.resolve(cwd);
|
|
25
|
+
return {
|
|
26
|
+
async loadJsonData(fileName) {
|
|
27
|
+
return loadJsonDataWithFallback(fileName, {
|
|
28
|
+
bundledDir: __dirname,
|
|
29
|
+
repoRoot,
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
async loadTextData(fileName) {
|
|
33
|
+
return loadTextDataWithFallback(fileName, {
|
|
34
|
+
bundledDir: __dirname,
|
|
35
|
+
repoRoot,
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
};
|
|
65
39
|
}
|
|
66
40
|
|
|
67
41
|
async function loadValidator() {
|
|
@@ -228,10 +202,12 @@ export async function loadJsonDataFromPath(sourcePath) {
|
|
|
228
202
|
// ---------------------------------------------------------------------------
|
|
229
203
|
|
|
230
204
|
export async function createServer(options = {}) {
|
|
205
|
+
const runtimeCwd = options.cwd ?? process.cwd();
|
|
231
206
|
const runtimeConfig = await loadWcfMcpRuntimeConfig({
|
|
232
|
-
cwd:
|
|
207
|
+
cwd: runtimeCwd,
|
|
233
208
|
configPath: options.configPath,
|
|
234
209
|
});
|
|
210
|
+
const { loadJsonData, loadTextData } = createRuntimeDataLoaders({ cwd: runtimeCwd });
|
|
235
211
|
return createMcpServer(loadJsonData, loadValidator, {
|
|
236
212
|
plugins: runtimeConfig.plugins,
|
|
237
213
|
loadJsonDataFromPath,
|