poker-mcp 1.1.0 → 1.2.5

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/.mcp.json ADDED
@@ -0,0 +1,99 @@
1
+ {
2
+ "name": "poker-mcp",
3
+ "version": "1.2.0",
4
+ "description": "YAML-based input file management tool for radiation shielding calculation code POKER with MCP support - Enhanced with collision detection and daughter nuclide auto-completion",
5
+ "author": "Yoshihiro Hirao",
6
+ "license": "ISC",
7
+ "url": "stdio://",
8
+ "server": {
9
+ "command": "node",
10
+ "args": ["src/mcp_server_stdio_v4.js"],
11
+ "env": {
12
+ "NODE_ENV": "production",
13
+ "POKER_INSTALL_PATH": "C:/Poker"
14
+ }
15
+ },
16
+ "capabilities": {
17
+ "tools": true,
18
+ "logging": true,
19
+ "real_data_update": true,
20
+ "automatic_backup": true,
21
+ "error_handling": "complete",
22
+ "validation": "comprehensive"
23
+ },
24
+ "features": {
25
+ "geometry_validation": {
26
+ "collision_detection": true,
27
+ "interference_check": true,
28
+ "pre_calculation_validation": true
29
+ },
30
+ "nuclide_management": {
31
+ "daughter_auto_completion": true,
32
+ "decay_chain_analysis": true,
33
+ "icrp_database_integration": true
34
+ },
35
+ "enhanced_validation": {
36
+ "physics_consistency_check": true,
37
+ "units_compatibility_verification": true,
38
+ "material_property_validation": true,
39
+ "cmb_expression_validation": true
40
+ },
41
+ "operation_methods": {
42
+ "count": 24,
43
+ "categories": [
44
+ "Body operations (propose/update/delete)",
45
+ "Zone operations (propose/update/delete)",
46
+ "BuildupFactor operations (propose/update/delete/changeOrder)",
47
+ "Transform operations (propose/update/delete)",
48
+ "Source operations (propose/update/delete)",
49
+ "Detector operations (propose/update/delete)",
50
+ "Unit operations (propose/update/get/validate/analyze)",
51
+ "System operations (applyChanges/resetYaml/executeCalculation/confirmDaughterNuclides)"
52
+ ]
53
+ },
54
+ "supported_geometries": {
55
+ "count": 10,
56
+ "types": ["SPH", "RCC", "RPP", "BOX", "CMB", "TOR", "ELL", "REC", "TRC", "WED"]
57
+ },
58
+ "supported_materials": {
59
+ "count": 14,
60
+ "types": ["Carbon", "Concrete", "Iron", "Lead", "Aluminum", "Copper", "Tungsten", "Air", "Water", "PyrexGlass", "AcrylicResin", "Polyethylene", "Soil", "VOID"]
61
+ }
62
+ },
63
+ "data_configuration": {
64
+ "work_directory": "tasks",
65
+ "yaml_file": "tasks/poker.yaml",
66
+ "pending_file": "tasks/pending_changes.json",
67
+ "backup_directory": "backups",
68
+ "logs_directory": "logs",
69
+ "data_directory": "data",
70
+ "nuclide_database": {
71
+ "target_file": "data/ICRP-07.NDX",
72
+ "source_env_var": "POKER_INSTALL_PATH",
73
+ "source_relative_path": "lib/ICRP-07.NDX",
74
+ "default_install_path": "C:/Poker",
75
+ "skip_if_exists": true,
76
+ "fallback_behavior": "error_if_missing"
77
+ }
78
+ },
79
+ "environment_variables": {
80
+ "POKER_INSTALL_PATH": {
81
+ "description": "POKERインストールディレクトリのパス",
82
+ "required": false,
83
+ "default": "C:/Poker",
84
+ "purpose": "lib/ICRP-07.NDXファイルの取得元ディレクトリ指定",
85
+ "example_windows": "C:/Program Files/POKER",
86
+ "example_linux": "/usr/local/share/poker"
87
+ }
88
+ },
89
+ "documentation": {
90
+ "manifest": "config/mcp-manifest.json",
91
+ "readme": "README.md",
92
+ "manuals": "docs/manuals/",
93
+ "interactive_guides": "docs/interactive_guides/"
94
+ },
95
+ "repository": {
96
+ "type": "git",
97
+ "url": "https://github.com/Hirao-Y/poker_mcp"
98
+ }
99
+ }
package/README.md CHANGED
@@ -4,11 +4,39 @@ YAML-based input file management tool for radiation-shielding calculation code P
4
4
 
5
5
  ## 📋 クイック情報
6
6
 
7
- - **バージョン**: 1.1.0 (安定版リリース)
7
+ - **バージョン**: 1.2.5 (Enhanced Release)
8
8
  - **プロトコル**: MCP (Model Context Protocol) 1.0.0 完全準拠
9
9
  - **メインサーバー**: `src/mcp_server_stdio_v4.js`
10
+ - **データ保存**: tasks/ディレクトリ(実行時自動作成)
10
11
  - **実行方式**: STDIO通信(MCPプロトコル標準)
11
12
 
13
+ ## 🆕 バージョン1.2.5の新機能
14
+
15
+ ### ⚡ 衝突検出システム
16
+ - **リアルタイム干渉チェック**: 立体間の重なり・接触を自動検出
17
+ - **自動修正提案**: 衝突解決のための幾何調整案を提示
18
+ - **物理的妥当性検証**: 非物理的な配置を事前に防止
19
+
20
+ ### ☢️ 子孫核種自動管理
21
+ - **ICRP-07データベース統合**: 1,254核種の崩壊データを内蔵
22
+ - **放射平衡計算**: 親核種から子孫核種を自動計算
23
+ - **寄与度閾値制御**: 5%以上の寄与を持つ核種を自動追加
24
+
25
+ ### 📏 単位系完全性保証
26
+ - **4キー完全性検証**: length, angle, density, radioactivityの一貫性保証
27
+ - **単位変換分析**: 異なる単位系間の変換係数を自動計算
28
+ - **物理的整合性チェック**: 単位の組み合わせの妥当性を検証
29
+
30
+ ### 🔄 YAMLリセット機能
31
+ - **3段階リセットレベル**: minimal(最小限)、standard(標準)、complete(完全)
32
+ - **自動バックアップ**: リセット前に必ずバックアップを作成
33
+ - **ATMOSPHERE保護**: 必須ゾーンの自動復元
34
+
35
+ ### 🔧 検出器分析機能
36
+ - **互換性チェック**: 複数検出器間の比較可能性を分析
37
+ - **性能最適化提案**: メモリ使用量と計算効率の最適化
38
+ - **システム全体分析**: 全検出器の統合的な性能評価
39
+
12
40
  ## ⚡ セットアップ
13
41
 
14
42
  ### 1. インストール
@@ -20,7 +48,26 @@ npm install
20
48
  npx poker-mcp
21
49
  ```
22
50
 
23
- ### 2. Claude Desktop設定
51
+ ### 2. 環境変数設定(オプション)
52
+
53
+ **POKER_INSTALL_PATH環境変数**(オプション):
54
+ ```bash
55
+ # Windowsの場合(コマンドプロンプト)
56
+ set POKER_INSTALL_PATH=C:\Program Files\POKER
57
+
58
+ # Windowsの場合(PowerShell)
59
+ $env:POKER_INSTALL_PATH="C:\Program Files\POKER"
60
+
61
+ # Linux/macOSの場合
62
+ export POKER_INSTALL_PATH="/usr/local/share/poker"
63
+ ```
64
+
65
+ - **デフォルト値**: `C:/Poker`
66
+ - **目的**: `lib/ICRP-07.NDX`核種データベースファイルの取得元ディレクトリ指定
67
+ - **動作**: 初回起動時に`{POKER_INSTALL_PATH}/lib/ICRP-07.NDX`を`data/`ディレクトリにコピー
68
+ - **注意**: `data/ICRP-07.NDX`が既に存在する場合はコピーをスキップ
69
+
70
+ ### 3. Claude Desktop設定
24
71
 
25
72
  **Claude Desktop アプリでの設定方法:**
26
73
 
@@ -37,15 +84,13 @@ npx poker-mcp
37
84
  "mcpServers": {
38
85
  "poker-mcp": {
39
86
  "command": "node",
40
- "args": ["(ローカルのエントリポイント、例えば)C:\\Users\\yoshi\\Desktop\\poker_mcp\\src\\mcp_server_stdio_v4.js"],
87
+ "args": ["C:\\Users\\yoshi\\Desktop\\poker_mcp\\src\\mcp_server_stdio_v4.js"],
41
88
  "env": {
42
- "POKER_WORK_DIR": "(作業ディレクトリのパス、例えば)C:\\Users\\Yoshi\\Desktop\\PokerWorks",
43
- "POKER_DATA_DIR": "data",
44
- "POKER_NUCLIDE_FILE": "ICRP-07.NDX"
45
- }
89
+ "POKER_INSTALL_PATH": "C:/Program Files/POKER"
46
90
  }
47
- }
48
- }
91
+ }
92
+ }
93
+ }
49
94
  ```
50
95
 
51
96
  3. **NPXを使用する場合**
@@ -56,9 +101,7 @@ npx poker-mcp
56
101
  "command": "npx",
57
102
  "args": ["poker-mcp"],
58
103
  "env": {
59
- "POKER_WORK_DIR": "(作業ディレクトリのパス、例えば)C:\\Users\\Yoshi\\Desktop\\PokerWorks",
60
- "POKER_DATA_DIR": "data",
61
- "POKER_NUCLIDE_FILE": "ICRP-07.NDX"
104
+ "POKER_INSTALL_PATH": "C:/Program Files/POKER"
62
105
  }
63
106
  }
64
107
  }
@@ -67,7 +110,11 @@ npx poker-mcp
67
110
 
68
111
  4. **Claude Desktopを再起動** してMCPサーバーを有効化
69
112
 
70
- ### 3. 動作確認
113
+ **注意**:
114
+ - `env`セクションの`POKER_INSTALL_PATH`はオプションです(省略時は`C:/Poker`を使用)
115
+ - 環境変数で指定したパスの`lib/ICRP-07.NDX`ファイルが初回起動時に`data/`にコピーされます
116
+
117
+ ### 4. 動作確認
71
118
  Claude Desktopで以下のようにテストできます:
72
119
  ```
73
120
  放射線遮蔽計算用のコンクリート壁(100cm x 50cm x 30cm)を作成してください
@@ -84,20 +131,26 @@ Claude Desktopで以下のようにテストできます:
84
131
  ## 🏆 主要機能
85
132
 
86
133
  ### ✅ **MCP完全対応**
87
- - **28メソッド完全実装**: 全ての放射線遮蔽計算入力管理機能
134
+ - **29メソッド完全実装**: 全ての放射線遮蔽計算入力管理機能
88
135
  - **JSON-RPC 2.0準拠**: 標準プロトコル完全対応
89
136
  - **STDIO通信**: MCPクライアントとの標準通信方式
90
137
  - **自動バックアップ・ロールバック**: 企業品質のデータ保護
91
138
 
92
139
  ### ✅ **放射線遮蔽計算専用設計**
93
140
  - **10種類の立体形状**: SPH, RCC, RPP, BOX, CMB, TOR, ELL, REC, TRC, WED
94
- - **13種類の材料**: コンクリート、鉛、鉄など標準遮蔽材料
141
+ - **14種類の材料**: コンクリート、鉛、鉄、VOID等標準遮蔽材料
95
142
  - **複数線源対応**: 点・体積線源の完全管理
96
- - **検出器配置**: 1D/2D/3D検出器の柔軟な配置
143
+ - **検出器配置**: 0D/1D/2D/3D検出器の柔軟な配置
144
+
145
+ ### ✅ **物理検証システム**
146
+ - **衝突検出**: リアルタイム立体干渉チェック
147
+ - **子孫核種管理**: ICRP-07データベース基準の自動計算
148
+ - **単位整合性**: 4キー完全性保証システム
149
+ - **材料妥当性**: 密度・物性の自動検証
97
150
 
98
151
  ## 🎯 API構成
99
152
 
100
- ### 🔧 **28メソッド完全実装**
153
+ ### 🔧 **29メソッド完全実装**
101
154
 
102
155
  | **カテゴリ** | **メソッド数** | **機能** | **主要操作** |
103
156
  |-------------|---------------|----------|-------------|
@@ -106,23 +159,23 @@ Claude Desktopで以下のようにテストできます:
106
159
  | **🔄 Transform** | 3個 | 幾何変換管理 | propose・update・delete |
107
160
  | **⚛️ BuildupFactor** | 4個 | ビルドアップ係数制御 | propose・update・delete・changeOrder |
108
161
  | **📡 Source** | 3個 | 線源管理 | propose・update・delete |
109
- | **🎯 Detector** | 3个 | 検出器管理 | propose・update・delete |
110
- | **📏 Unit** | 5個 | 単位設定管理 | propose・get・update・validate・analyze |
111
- | **⚙️ System** | 4個 | システム制御 | apply・execute・reset・confirm |
162
+ | **🎯 Detector** | 3個 | 検出器管理 | propose・update・delete |
163
+ | **📏 Unit** | 5個 | 単位設定管理 | propose・get・update・validateIntegrity・analyzeConversion |
164
+ | **⚙️ System** | 5個 | システム制御 | applyChanges・executeCalculation・resetYaml・confirmDaughterNuclides・各種検証 |
112
165
 
113
- ### 📋 **全28メソッド一覧**
166
+ ### 📋 **全29メソッド一覧**
114
167
  ```
115
- Body系 (3): poker_proposeBody, poker_updateBody, poker_deleteBody
116
- Zone系 (3): poker_proposeZone, poker_updateZone, poker_deleteZone
117
- Transform系 (3): poker_proposeTransform, poker_updateTransform, poker_deleteTransform
168
+ Body系 (3): poker_proposeBody, poker_updateBody, poker_deleteBody
169
+ Zone系 (3): poker_proposeZone, poker_updateZone, poker_deleteZone
170
+ Transform系 (3): poker_proposeTransform, poker_updateTransform, poker_deleteTransform
118
171
  BuildupFactor系 (4): poker_proposeBuildupFactor, poker_updateBuildupFactor,
119
172
  poker_deleteBuildupFactor, poker_changeOrderBuildupFactor
120
- Source系 (3): poker_proposeSource, poker_updateSource, poker_deleteSource
121
- Detector系 (3): poker_proposeDetector, poker_updateDetector, poker_deleteDetector
122
- Unit系 (5): poker_proposeUnit, poker_getUnit, poker_updateUnit,
123
- poker_validateUnitIntegrity, poker_analyzeUnitConversion
124
- System系 (4): poker_applyChanges, poker_executeCalculation,
125
- poker_resetYaml, poker_confirmDaughterNuclides
173
+ Source系 (3): poker_proposeSource, poker_updateSource, poker_deleteSource
174
+ Detector系 (3): poker_proposeDetector, poker_updateDetector, poker_deleteDetector
175
+ Unit系 (5): poker_proposeUnit, poker_getUnit, poker_updateUnit,
176
+ poker_validateUnitIntegrity, poker_analyzeUnitConversion
177
+ System系 (5): poker_applyChanges, poker_executeCalculation, poker_resetYaml,
178
+ poker_confirmDaughterNuclides, 内部検証メソッド群
126
179
  ```
127
180
 
128
181
  ## 📁 プロジェクト構造
@@ -133,25 +186,39 @@ poker_mcp/
133
186
  │ ├── mcp_server_stdio_v4.js # メインサーバー (エントリポイント)
134
187
  │ ├── 📁 mcp/ # MCP実装
135
188
  │ ├── 📁 services/ # ビジネスロジック
136
- │ ├── 📁 validators/ # データ検証
189
+ │ ├── 📁 validators/ # データ検証(物理・単位・衝突)
137
190
  │ ├── 📁 utils/ # ユーティリティ
138
191
  │ └── 📁 config/ # 設定管理
192
+ ├── 📁 data/ # 📊 核種データベース
193
+ │ └── ICRP-07.NDX # ICRP-107核種データ(1,254核種)
139
194
  ├── 📁 config/ # ⚙️ 設定ファイル
140
- │ └── mcp-manifest.json # MCPマニフェスト (1,700行)
195
+ │ ├── mcp-manifest.json # MCPマニフェスト (2,276行)
196
+ │ └── mcp-example.json # 設定例
141
197
  ├── 📁 docs/ # 📚 完全ドキュメント
198
+ │ ├── README.md # 詳細ドキュメント
142
199
  │ ├── 📁 manuals/ # マニュアル集
143
200
  │ └── 📁 interactive_guides/ # インタラクティブ学習ガイド
144
- ├── 📁 [Claude App Dir]/サブフォルダ/ # 📊 YAMLデータファイル
145
- └── 📁 backups/ # 💾 自動バックアップ
201
+ ├── 📁 node_modules/ # 📦 依存パッケージ
202
+ ├── .mcp.json # MCPクライアント接続設定
203
+ ├── package.json # パッケージ定義
204
+ ├── package-lock.json # 依存関係ロック
205
+ └── README.md # このファイル
206
+
207
+ # 実行時に自動作成されるディレクトリ
208
+ ├── 📁 tasks/ # 📊 作業ディレクトリ(自動作成)
209
+ │ ├── poker.yaml # メインYAMLファイル
210
+ │ └── pending_changes.json # 保留中の変更
211
+ ├── 📁 backups/ # 💾 自動バックアップ(自動作成)
212
+ └── 📁 logs/ # 📝 ログファイル(自動作成)
146
213
  ```
147
214
 
148
215
  ## 🔧 Claude経由での使用例
149
216
 
150
- ### 立体作成
217
+ ### 立体作成と衝突検出
151
218
  ```
152
219
  「医療施設用のコンクリート遮蔽壁を作成してください。サイズは幅100cm、高さ200cm、厚さ30cmです」
153
220
  ```
154
- → `poker_proposeBody`メソッドが自動実行
221
+ → `poker_proposeBody`メソッドが自動実行 + 衝突検出
155
222
 
156
223
  ### 材料ゾーン設定
157
224
  ```
@@ -159,17 +226,29 @@ poker_mcp/
159
226
  ```
160
227
  → `poker_proposeZone`メソッドが自動実行
161
228
 
162
- ### 線源配置
229
+ ### 線源配置(子孫核種自動追加)
163
230
  ```
164
231
  「Cs-137線源(放射能1TBq)を原点に配置してください」
165
232
  ```
166
- → `poker_proposeSource`メソッドが自動実行
233
+ → `poker_proposeSource`メソッド実行 + Ba-137m自動追加提案
234
+
235
+ ### 検出器設置と最適化
236
+ ```
237
+ 「遮蔽壁から120cm離れた位置に2D検出器グリッドを設置してください」
238
+ ```
239
+ → `poker_proposeDetector`メソッド実行 + 性能最適化提案
240
+
241
+ ### 単位系検証
242
+ ```
243
+ 「現在の単位設定の物理的整合性を確認してください」
244
+ ```
245
+ → `poker_validateUnitIntegrity`メソッドが自動実行
167
246
 
168
- ### 検出器設置
247
+ ### YAMLリセット
169
248
  ```
170
- 「遮蔽壁から120cm離れた位置に線量率検出器を設置してください」
249
+ 「立体構造だけクリアして、単位設定は保持したままリセットしてください」
171
250
  ```
172
- → `poker_proposeDetector`メソッドが自動実行
251
+ → `poker_resetYaml`メソッド(minimal level)実行
173
252
 
174
253
  ### POKER計算実行
175
254
  ```
@@ -193,16 +272,22 @@ poker_mcp/
193
272
 
194
273
  ### **✅ 放射線遮蔽計算特化**
195
274
  - **物理的妥当性**: 全パラメータの物理検証
196
- - **材料データベース**: 標準遮蔽材料13種完備
197
- - **単位系管理**: 長さ・角度・密度・放射能の一貫管理
275
+ - **材料データベース**: 標準遮蔽材料14種完備
276
+ - **単位系管理**: 4キー完全性保証(長さ・角度・密度・放射能)
198
277
  - **計算品質保証**: 自動整合性チェック
199
278
 
200
279
  ### **✅ 実用性重視設計**
201
- - **自動バックアップ**: 全操作で自動データ保護
280
+ - **自動バックアップ**: 全操作で自動データ保護(最大10世代)
202
281
  - **依存関係チェック**: 安全な削除・更新処理
203
282
  - **エラー回復**: ロールバック機能付き
204
283
  - **レスポンス速度**: <50ms応答時間
205
284
 
285
+ ### **✅ エラーハンドリング強化(v1.2.5)**
286
+ - **propose/update自動判別**: エラーメッセージによる適切なメソッド案内
287
+ - **専用エラーコード**: 各操作に固有のエラーコード体系
288
+ - **材料名サジェスト**: 類似材料名の自動提案機能
289
+ - **Transform参照検証**: 依存関係の事前チェック
290
+
206
291
  ## 📊 対応する計算コード
207
292
 
208
293
  - **POKER**: 放射線遮蔽計算メインコード
@@ -213,6 +298,7 @@ poker_mcp/
213
298
  - **Node.js**: ≥18.0.0
214
299
  - **OS**: Windows, macOS, Linux
215
300
  - **MCP Client**: Claude Desktop (推奨)、その他MCPクライアント
301
+ - **メモリ**: 512MB以上推奨(大規模検出器使用時は1GB以上)
216
302
 
217
303
  ## 🎯 実際の使用ワークフロー
218
304
 
@@ -223,7 +309,7 @@ poker_mcp/
223
309
  ```
224
310
 
225
311
  2. **自動的なMCPメソッド実行**
226
- - 立体作成 → 材料設定 → 線源配置 → 検出器設定
312
+ - 立体作成 → 衝突検出 → 材料設定 → 線源配置 → 子孫核種確認 → 検出器設定
227
313
 
228
314
  3. **計算実行と結果取得**
229
315
  ```
@@ -235,15 +321,38 @@ poker_mcp/
235
321
  - 遮蔽効果の定量評価
236
322
  - 法規制適合性の確認
237
323
 
324
+ ## 📝 更新履歴
325
+
326
+ ### v1.2.5 (2025-01-24)
327
+ - ✨ 衝突検出システム実装
328
+ - ✨ 子孫核種自動補完機能追加(ICRP-07統合)
329
+ - ✨ 単位系完全性検証強化(4キー保証)
330
+ - ✨ YAMLリセット機能実装(3段階レベル)
331
+ - ✨ 検出器分析機能追加
332
+ - 🐛 NuclideManagerデフォルトパス統一
333
+ - 📝 .mcp.json完全化
334
+ - 📝 材料数13→14(VOID追加明記)
335
+ - 🗑️ archiveディレクトリ削除(未使用ファイル整理)
336
+
337
+ ### v1.1.0 (Previous)
338
+ - 基本24メソッド実装
339
+ - MCP 1.0.0準拠
340
+ - 自動バックアップ機能
341
+
342
+ ### v1.0.0 (Initial Release)
343
+ - 初期リリース
344
+ - YAML管理基本機能
345
+
238
346
  ## 📞 サポート・詳細情報
239
347
 
240
348
  - **📖 詳細README**: [docs/README.md](docs/README.md)
241
- - **🚀 セットアップガイド**: [docs/SETUP_GUIDE.md](docs/SETUP_GUIDE.md)
242
349
  - **📚 完全マニュアル**: [docs/manuals/](docs/manuals/)
243
350
  - **🎓 インタラクティブガイド**: [docs/interactive_guides/](docs/interactive_guides/)
351
+ - **📋 マニフェスト**: [config/mcp-manifest.json](config/mcp-manifest.json)
352
+ - **🐛 Issues**: [GitHub Issues](https://github.com/Hirao-Y/poker_mcp/issues)
244
353
 
245
354
  ---
246
355
 
247
- **🎯 Poker MCP Server v1.1.0**
356
+ **🎯 Poker MCP Server v1.2.5**
248
357
  **プロトコル**: MCP 1.0.0 完全準拠
249
358
  **作者**: Yoshihiro Hirao | **ライセンス**: ISC
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "poker-mcp",
3
- "version": "1.1.0",
4
- "description": "YAML-based input file management tool for radiation shielding calculation code POKER with MCP support",
3
+ "version": "1.2.5",
4
+ "description": "YAML-based input file management tool for radiation shielding calculation code POKER with MCP support - Enhanced with collision detection, daughter nuclide auto-completion, and environment variable support",
5
5
  "main": "src/mcp_server_stdio_v4.js",
6
6
  "type": "module",
7
7
  "bin": {
@@ -10,9 +10,7 @@
10
10
  "scripts": {
11
11
  "start": "node src/mcp_server_stdio_v4.js",
12
12
  "dev": "nodemon src/mcp_server_stdio_v4.js",
13
- "prepare": "echo 'NPX ready: npx poker-mcp'",
14
- "start:custom": "POKER_WORK_DIR=/path/to/project node src/mcp_server_stdio_v4.js",
15
- "start:windows": "set POKER_WORK_DIR=C:\\MyProject && node src/mcp_server_stdio_v4.js"
13
+ "prepare": "echo 'NPX ready: npx poker-mcp'"
16
14
  },
17
15
  "keywords": [
18
16
  "mcp",
@@ -28,10 +26,17 @@
28
26
  "physics",
29
27
  "validation",
30
28
  "npx",
31
- "point-kernel"
29
+ "point-kernel",
30
+ "collision-detection",
31
+ "daughter-nuclide"
32
32
  ],
33
33
  "author": "Yoshihiro Hirao <tora@pointkernel.com>",
34
34
  "license": "ISC",
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/Hirao-Y/poker_mcp.git"
38
+ },
39
+ "homepage": "https://github.com/Hirao-Y/poker_mcp#readme",
35
40
  "engines": {
36
41
  "node": ">=18.0.0"
37
42
  },
@@ -43,6 +48,7 @@
43
48
  },
44
49
  "files": [
45
50
  "src/",
46
- "README.md"
51
+ "README.md",
52
+ ".mcp.json"
47
53
  ]
48
54
  }
@@ -10,10 +10,29 @@ export function createCalculationHandlers(taskManager) {
10
10
  return {
11
11
  async executeCalculation(args) {
12
12
  try {
13
- // 環境変数で設定されたYAMLファイルを使用
14
- const yamlFile = taskManager.dataManager.yamlFile;
15
-
16
- logger.info('Using YAML file from environment variables', { yamlFile });
13
+ // 引数検証
14
+ if (!args.yaml_file) {
15
+ throw new ValidationError('YAML file is required', 'yaml_file', args.yaml_file);
16
+ }
17
+
18
+ // 絶対パス形式の事前チェック(詳細検証はサービス層で実行)
19
+ const absolutePathPattern = /^([a-zA-Z]:[\\\/]|\/)/;
20
+ if (!absolutePathPattern.test(args.yaml_file)) {
21
+ throw new ValidationError(
22
+ 'YAML file must be specified with absolute path. Examples: C:\\path\\to\\file.yaml or /path/to/file.yaml',
23
+ 'yaml_file',
24
+ args.yaml_file
25
+ );
26
+ }
27
+
28
+ // YAML拡張子チェック
29
+ if (!args.yaml_file.match(/\.(yaml|yml)$/i)) {
30
+ throw new ValidationError(
31
+ 'YAML file must have .yaml or .yml extension',
32
+ 'yaml_file',
33
+ args.yaml_file
34
+ );
35
+ }
17
36
 
18
37
  // サマリーオプション検証
19
38
  const summaryOptions = args.summary_options || {};
@@ -27,8 +46,8 @@ export function createCalculationHandlers(taskManager) {
27
46
  const resolvedOutputFiles = {};
28
47
 
29
48
  if (Object.keys(outputFiles).length > 0) {
30
- // 環境変数YAMLファイルのディレクトリを取得
31
- const inputDir = path.dirname(yamlFile);
49
+ // 入力YAMLファイルのディレクトリを取得
50
+ const inputDir = path.dirname(args.yaml_file);
32
51
 
33
52
  // 各出力ファイルの絶対パス化
34
53
  for (const [key, fileName] of Object.entries(outputFiles)) {
@@ -58,7 +77,7 @@ export function createCalculationHandlers(taskManager) {
58
77
  // 出力ファイル検証(従来の検証は不要、上記で実施済み)
59
78
 
60
79
  logger.info('Starting radiation shielding calculation', {
61
- yamlFile,
80
+ yamlFile: args.yaml_file,
62
81
  summaryOptions,
63
82
  outputFiles: outputFiles,
64
83
  resolvedOutputFiles
@@ -66,7 +85,7 @@ export function createCalculationHandlers(taskManager) {
66
85
 
67
86
  // 計算実行(統合検証付き、絶対パス化済みの出力ファイルパスを使用)
68
87
  const result = await calculationService.executeWithValidation(
69
- yamlFile,
88
+ args.yaml_file,
70
89
  summaryOptions,
71
90
  resolvedOutputFiles, // 絶対パス化済み
72
91
  undefined, // timeout(デフォルト値を使用)
@@ -76,7 +95,7 @@ export function createCalculationHandlers(taskManager) {
76
95
  // 事前検証で重大エラーが検出された場合の処理
77
96
  if (result.success === false && result.stage === 'pre_validation') {
78
97
  logger.error('Pre-calculation validation failed', {
79
- yamlFile,
98
+ yamlFile: args.yaml_file,
80
99
  criticalErrors: result.criticalErrors
81
100
  });
82
101
 
@@ -92,10 +111,10 @@ export function createCalculationHandlers(taskManager) {
92
111
  category: 'pre_validation_error',
93
112
  recoverable: true,
94
113
  suggestions: [
95
- 'Resolve geometry collisions if detected',
96
114
  'Check daughter nuclide configurations',
97
- 'Review enhanced validation warnings',
98
- 'Ensure all bodies, zones, and sources are properly defined'
115
+ 'Review material definitions',
116
+ 'Ensure all required parameters are properly defined',
117
+ 'Note: Geometry collisions will not block calculation'
99
118
  ]
100
119
  }
101
120
  };
@@ -109,7 +128,7 @@ export function createCalculationHandlers(taskManager) {
109
128
  success: true,
110
129
  message: 'Radiation shielding calculation completed successfully',
111
130
  calculation: {
112
- input_file: yamlFile,
131
+ input_file: args.yaml_file,
113
132
  execution_time_ms: result.executionTime,
114
133
  timestamp: result.summary.timestamp,
115
134
  options: result.summary.options
@@ -142,7 +161,7 @@ export function createCalculationHandlers(taskManager) {
142
161
  }
143
162
 
144
163
  logger.info('Calculation completed successfully', {
145
- yamlFile,
164
+ yamlFile: args.yaml_file,
146
165
  executionTime: result.executionTime,
147
166
  outputFiles: Object.keys(fileVerification).filter(k => k !== 'allFilesGenerated')
148
167
  });
@@ -151,7 +170,7 @@ export function createCalculationHandlers(taskManager) {
151
170
 
152
171
  } catch (error) {
153
172
  logger.error('executeCalculation handler error', {
154
- yamlFile: taskManager.dataManager.yamlFile,
173
+ args,
155
174
  error: error.message,
156
175
  errorType: error.constructor.name
157
176
  });