@nogataka/smart-edit 1.0.1 → 1.0.3

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 CHANGED
@@ -1,17 +1,205 @@
1
1
  # Smart Edit
2
2
 
3
- Smart Edit は、TypeScript / Node.js 上で動作する MCP (Model Context Protocol) サーバーです。SmartLSP ベースの言語サーバー管理や Smart-Edit 固有のツール群を TypeScript で実装しています。
3
+ ![Smart Edit Dashboard](docs/public/assets/screenshot.png)
4
+
5
+ Smart Edit は、TypeScript / Node.js 上で動作する MCP (Model Context Protocol) サーバーです。独自の言語サーバー管理システム「SmartLSP」と Smart-Edit 固有のツール群を TypeScript で実装しています。
6
+
7
+ ## SmartLSP について
8
+
9
+ SmartLSP は、Smart Edit に組み込まれた言語サーバー管理システムです。AI コーディングツールが複数のプログラミング言語を扱う際に必要となる LSP (Language Server Protocol) サーバーの管理を自動化します。
10
+
11
+ ### 主な特徴
12
+
13
+ | 特徴 | 説明 |
14
+ | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
15
+ | **23言語サポート** | Bash, C/C++, C#, Clojure, Dart, Erlang, Go, Java, Kotlin, Lua, Nix, PHP, Python (2種), R, Ruby (2種), Rust, Swift, Terraform, TypeScript/JavaScript, Vue, Zig |
16
+ | **オンデマンドダウンロード** | 言語サーバーは必要になったタイミングで自動的にダウンロード・インストールされます。起動時に全てをダウンロードする必要はありません |
17
+ | **クロスプラットフォーム** | macOS (Intel/Apple Silicon)、Linux (x64/ARM64)、Windows (x64) に対応。プラットフォームに応じた適切なバイナリを自動選択 |
18
+ | **統一API** | 異なる言語サーバーを同一のインターフェースで操作可能。初期化、診断取得、コード補完、定義ジャンプなどを共通の方法で呼び出せます |
19
+ | **依存関係の自動管理** | npm、pip、gem、go install など、各言語のパッケージマネージャーを通じた依存関係を自動的に解決 |
20
+
21
+ ### 動作の流れ
22
+
23
+ ```
24
+ 1. プロジェクトの言語を検出(project.yml または自動検出)
25
+
26
+ 2. 該当する言語サーバーが未インストールの場合、自動ダウンロード
27
+
28
+ 3. 言語サーバーを起動し、LSP 通信を開始
29
+
30
+ 4. AI エージェントが LSP 機能(診断、補完、定義参照など)を利用
31
+ ```
32
+
33
+ SmartLSP により、ユーザーは言語サーバーのインストールや設定を意識することなく、AI による高精度なコード支援を受けることができます。
34
+
35
+ ## メモリ機能
36
+
37
+ Smart Edit は、AI エージェントがプロジェクトに関する情報を永続的に保存・参照できる「メモリ機能」を提供します。
38
+
39
+ ### 主な特徴
40
+
41
+ | 特徴 | 説明 |
42
+ | -------------------- | ------------------------------------------------------------------------ |
43
+ | **永続化** | セッション間で完全に永続化され、IDE 再起動や PC 再起動後も保持されます |
44
+ | **プロジェクト独立** | メモリはプロジェクトごとに独立しており、他プロジェクトとは共有されません |
45
+ | **Markdown 形式** | 人間が読みやすい Markdown ファイルとして保存されます |
46
+ | **名前付き管理** | 「kickoff」「retro」「architecture」など、用途に応じた名前でメモリを管理 |
47
+
48
+ ### 利用可能なツール
49
+
50
+ | ツール | 説明 |
51
+ | -------------- | -------------------------- |
52
+ | `WriteMemory` | 名前付きメモリを保存 |
53
+ | `ReadMemory` | メモリの内容を読み込み |
54
+ | `ListMemories` | 保存済みメモリの一覧を取得 |
55
+ | `DeleteMemory` | メモリを削除 |
56
+
57
+ 保存場所: `{プロジェクトルート}/.smart-edit/memories/`
58
+
59
+ ## プロンプト/モード/コンテキスト システム
60
+
61
+ Smart Edit は、AI の振る舞いをカスタマイズするための柔軟なテンプレートシステムを提供します。
62
+
63
+ ### 構成要素
64
+
65
+ | 要素 | 説明 | 保存場所 |
66
+ | -------------------------- | ------------------------------------------------------------------ | --------------------------------- |
67
+ | **コンテキスト** | 接続先クライアント(Claude Code, Codex, Desktop など)に応じた設定 | `~/.smart-edit/contexts/` |
68
+ | **モード** | AI の動作モード(editor, reviewer, architect など)を定義 | `~/.smart-edit/modes/` |
69
+ | **プロンプトテンプレート** | 各ツールの出力形式やインストラクションを定義 | `~/.smart-edit/prompt_templates/` |
70
+
71
+ ### カスタマイズの流れ
72
+
73
+ ```
74
+ 1. 内蔵テンプレートを確認
75
+ smart-edit mode list / smart-edit context list
76
+
77
+ 2. テンプレートをコピーして編集
78
+ smart-edit mode create --from-internal default-editor
79
+
80
+ 3. MCP サーバー起動時に指定
81
+ --context ide-assistant --mode default-editor
82
+ ```
83
+
84
+ ## Web ダッシュボード
85
+
86
+ リアルタイムでセッション情報を可視化する Web ベースのダッシュボードを提供します。
87
+
88
+ ### 機能一覧
89
+
90
+ | タブ | 機能 |
91
+ | -------------- | ---------------------------------------------------------------------- |
92
+ | **Dashboard** | プロジェクト概要、リアルタイムメトリクス、最近のアクティビティ |
93
+ | **Logs** | ログ検索・フィルタ(レベル別、ツール名別)、リアルタイムストリーミング |
94
+ | **Statistics** | API 呼び出し統計、トークン使用量チャート、ライブカウンター |
95
+ | **Sessions** | セッション履歴、JSON エクスポート、過去セッション比較 |
96
+
97
+ - `npx @nogataka/smart-edit start-dashboard` で統合ダッシュボードを起動
98
+ - 複数プロジェクトをサイドバーで切り替え管理
99
+ - ダークモード / ライトモード切替対応
100
+
101
+ ## ワークフローツール
102
+
103
+ AI エージェントの作業効率を高めるためのワークフロー支援ツールを提供します。
104
+
105
+ | ツール | 説明 |
106
+ | --------------------------- | -------------------------------------------------------- |
107
+ | `Onboarding` | プロジェクト初回参加時のオンボーディングプロセスを支援 |
108
+ | `CheckOnboardingPerformed` | オンボーディング完了確認 + Git 差分による変更検出 |
109
+ | `CollectProjectSymbols` | プロジェクトシンボル(ユーティリティ、依存関係等)を収集 |
110
+
111
+ オンボーディングでは、プロジェクトの構造理解、コーディング規約の確認、既存メモリの参照などを AI エージェントに案内します。
112
+
113
+ ### アクティブ化とオンボーディングの違い
114
+
115
+ Smart Edit では「**アクティブ化**」と「**オンボーディング**」は別の概念です。
116
+
117
+ | 項目 | アクティブ化 (Activation) | オンボーディング (Onboarding) |
118
+ |------|---------------------------|-------------------------------|
119
+ | **目的** | プロジェクトを Smart Edit に登録 | AI がプロジェクトを理解する |
120
+ | **実行タイミング** | 最初の1回(自動または手動) | セッション開始時に推奨 |
121
+ | **結果** | `.smart-edit` ディレクトリ作成、ツールが利用可能に | メモリに情報を保存 |
122
+ | **ツール** | `activate_project` | `onboarding`, `check_onboarding_performed` |
123
+ | **必須か** | **必須**(プロジェクト操作に必要) | 任意(推奨) |
124
+
125
+ **処理の流れ:**
126
+
127
+ ```
128
+ 1. プロジェクトのアクティブ化
129
+ → activate_project ツール / --project オプション
130
+ → .smart-edit ディレクトリ作成
131
+ → ツールが利用可能になる
132
+
133
+ 2. オンボーディング(任意だが推奨)
134
+ → check_onboarding_performed → onboarding ツール
135
+ → AI がプロジェクト構造を学習
136
+ → メモリに情報を保存(project-symbols など)
137
+
138
+ 3. 実際の作業
139
+ → ファイル編集、シンボル検索など
140
+ ```
141
+
142
+ - **アクティブ化**は技術的な準備段階(プロジェクトパスの認識、`.smart-edit` ディレクトリ作成、言語サーバー初期化)
143
+ - **オンボーディング**は AI の学習プロセス(プロジェクト構造把握、既存コード・ライブラリの確認、メモリへの保存)
144
+
145
+ アクティブ化なしではオンボーディングはできませんが、オンボーディングなしでもアクティブ化されたプロジェクトで作業は可能です。
146
+
147
+ ## 重複定義チェック機能
148
+
149
+ AI エージェントが既存のコードや依存ライブラリと重複する実装を作成することを防ぐための機能です。
150
+
151
+ ### 概要
152
+
153
+ | 機能 | 説明 |
154
+ |------|------|
155
+ | **careful-editor モード** | 既存コードを尊重し、重複実装を防ぐ動作モード |
156
+ | **プロジェクトシンボル収集** | ユーティリティ関数、共通コンポーネント、依存ライブラリを記録 |
157
+ | **Git 差分検出** | 前回オンボーディング以降の大きな変更を自動検出し、再オンボーディングを推奨 |
158
+
159
+ ### 動作の流れ
160
+
161
+ ```
162
+ 1. オンボーディング時にプロジェクト構成を収集
163
+ → CollectProjectSymbols ツールで project-symbols メモリに保存
164
+
165
+ 2. 次回セッション開始時
166
+ → CheckOnboardingPerformed が Git 差分をチェック
167
+
168
+ 3. 大きな変更がある場合
169
+ → 「再オンボーディング推奨」メッセージを表示
170
+
171
+ 4. careful-editor モードで実装
172
+ → 既存のユーティリティ/ライブラリを優先利用
173
+ ```
174
+
175
+ ### careful-editor モードの使用
176
+
177
+ ```bash
178
+ npx @nogataka/smart-edit start-mcp-server \
179
+ --mode careful-editor \
180
+ --transport stdio
181
+ ```
182
+
183
+ このモードでは、AI エージェントは実装前に以下を確認します:
184
+ - `project-symbols` メモリから既存のユーティリティ関数一覧
185
+ - `package.json` の依存ライブラリとその用途
186
+ - 類似機能の有無を `find_symbol` ツールで検索
187
+
188
+ ### 変更検出の基準
189
+
190
+ 以下の条件で「大きな変更」と判定されます:
191
+ - 10 ファイル以上の変更
192
+ - 5 ファイル以上の新規追加
193
+ - `src/` ディレクトリへの新規ファイル追加
4
194
 
5
195
  ## 主な構成
6
196
 
7
197
  | ディレクトリ / ファイル | 概要 |
8
198
  | -------------------------- | ----------------------------------------------------------- |
9
199
  | `src/smart-edit` | エージェント本体、CLI、各種ツール・コンフィグ周りのロジック |
10
- | `src/smart-lsp` | SmartLSP 連携と言語サーバーごとのランタイム管理実装 |
200
+ | `src/smart-lsp` | SmartLSP 本体:23言語サーバーの自動管理・LSP通信実装 |
11
201
  | `src/smart-edit/resources` | Smart-Edit が自動生成・参照する YAML テンプレート群 |
12
202
  | `test/` | Vitest によるユニットテスト・スモークテスト |
13
- | `docs/` | 言語サーバー対応状況などの資料 |
14
- | `tsconfig*.json` | ビルド・テスト・Lint 用 TypeScript 設定 |
15
203
 
16
204
  ## 環境要件
17
205
 
@@ -50,7 +238,7 @@ CLI は npm パッケージとして公開されており、`npx` または `nod
50
238
 
51
239
  ```bash
52
240
  # npm パッケージを利用する場合(推奨)
53
- npx @nogataka/smart-edit smart-edit <command>
241
+ npx @nogataka/smart-edit <command>
54
242
 
55
243
  # ローカル開発時
56
244
  node dist/cli.js <command>
@@ -62,28 +250,28 @@ pnpm exec tsx src/smart-edit/cli.ts <command>
62
250
 
63
251
  1. **smart-edit 管理ディレクトリの生成**
64
252
  ```bash
65
- npx @nogataka/smart-edit smart-edit config edit
253
+ npx @nogataka/smart-edit config edit
66
254
  ```
67
255
  初回実行時は `~/.smart-edit/smart_edit_config.yml` をテンプレートから生成し、既定エディタで開きます。
68
256
 
69
257
  2. **プロジェクト設定 (project.yml) の生成**
70
258
  ```bash
71
- npx @nogataka/smart-edit smart-edit project generate-yml /path/to/project
259
+ npx @nogataka/smart-edit project generate-yml /path/to/project
72
260
  ```
73
261
  言語を手動指定したい場合は `--language <lang>` を付与します。生成された YAML をプロジェクトルートに配置してください。
74
262
 
75
263
  3. **モード / コンテキストの確認とカスタマイズ**
76
264
  ```bash
77
265
  # 一覧表示
78
- npx @nogataka/smart-edit smart-edit mode list
79
- npx @nogataka/smart-edit smart-edit context list
266
+ npx @nogataka/smart-edit mode list
267
+ npx @nogataka/smart-edit context list
80
268
 
81
269
  # テンプレートからコピー
82
- npx @nogataka/smart-edit smart-edit mode create --from-internal default-editor
270
+ npx @nogataka/smart-edit mode create --from-internal default-editor
83
271
 
84
272
  # 編集 / 削除
85
- npx @nogataka/smart-edit smart-edit mode edit <name>
86
- npx @nogataka/smart-edit smart-edit context delete <name>
273
+ npx @nogataka/smart-edit mode edit <name>
274
+ npx @nogataka/smart-edit context delete <name>
87
275
  ```
88
276
 
89
277
  4. **プロンプトテンプレートの更新**
@@ -92,7 +280,7 @@ pnpm exec tsx src/smart-edit/cli.ts <command>
92
280
  ### 2. MCP サーバーの起動
93
281
 
94
282
  ```bash
95
- npx @nogataka/smart-edit smart-edit start-mcp-server \
283
+ npx @nogataka/smart-edit start-mcp-server \
96
284
  --project /path/to/project \
97
285
  --context ide-assistant \
98
286
  --mode default-editor \
@@ -101,34 +289,59 @@ npx @nogataka/smart-edit smart-edit start-mcp-server \
101
289
 
102
290
  ランタイムの自動インストールをスキップする場合は環境変数を設定します:
103
291
  ```bash
104
- SMART_EDIT_SKIP_RUNTIME_INSTALL=1 npx @nogataka/smart-edit smart-edit start-mcp-server ...
292
+ SMART_EDIT_SKIP_RUNTIME_INSTALL=1 npx @nogataka/smart-edit start-mcp-server ...
105
293
  ```
106
294
 
107
295
  主なオプション:
108
296
 
109
- - `--transport`: `stdio` (既定) / `sse` / `streamable-http` から選択
110
- - `--enable-web-dashboard`, `--enable-gui-log-window`: Config の設定を一時的に上書き
111
- - `--log-level`, `--trace-lsp-communication`: ログ詳細度や LSP トレースの制御
112
- - `--tool-timeout`: ツール実行のタイムアウト秒数
113
- - `--instructions-override`: MCP クライアントに渡す初期インストラクションをカスタム指定
297
+ | オプション | 説明 |
298
+ |------------|------|
299
+ | `--project <path>` | アクティブ化するプロジェクトパス(省略時はカレントディレクトリ) |
300
+ | `--no-project` | プロジェクトなしで起動(後から `activate_project` で指定) |
301
+ | `--transport` | `stdio`(既定)/ `sse` / `streamable-http` |
302
+ | `--log-level` | ログレベル(DEBUG / INFO / WARNING / ERROR) |
303
+ | `--tool-timeout <秒>` | ツール実行のタイムアウト |
304
+ | `--instructions-override` | MCP クライアントへの初期インストラクション |
114
305
 
115
- サーバー起動後は、必要に応じてダッシュボード (`--enable-web-dashboard`) や GUI ログビューア (`--enable-gui-log-window`) を利用できます。GUI ログは `GuiLogViewer` 経由でブラウザが自動起動し、`logs/` ディレクトリにも出力されます。
306
+ #### Web ダッシュボード
116
307
 
117
- #### Web ダッシュボード機能
308
+ Smart Edit は統合ダッシュボードを提供し、複数プロジェクトのモニタリングと管理を一元化できます。
118
309
 
119
- ダッシュボードは以下の機能を提供します:
310
+ ```bash
311
+ # 統合ダッシュボードを起動
312
+ npx @nogataka/smart-edit start-dashboard
313
+ ```
120
314
 
121
- | タブ | 機能 |
122
- | ---------- | ---------------------------------------------------------------------- |
123
- | Dashboard | プロジェクト概要、リアルタイムメトリクス、最近のアクティビティ |
124
- | Logs | ログ検索・フィルタ(レベル別、ツール名別)、リアルタイムストリーミング |
125
- | Statistics | API 呼び出し統計、トークン使用量チャート、ライブカウンター |
126
- | Sessions | セッション履歴、JSON エクスポート、過去セッション比較 |
315
+ ダッシュボードは MCP サーバーとは独立して動作します。複数の MCP サーバーを起動していても、1つのダッシュボードですべてのプロジェクトを管理できます。
127
316
 
128
- - ダークモード / ライトモード切替対応
129
- - サイドバーナビゲーション(折りたたみ可能)
317
+ ```bash
318
+ # 例: 複数プロジェクトの同時利用
319
+ npx @nogataka/smart-edit start-dashboard # ダッシュボード起動
320
+ npx @nogataka/smart-edit start-mcp-server --project ~/projects/app-a # プロジェクトA
321
+ npx @nogataka/smart-edit start-mcp-server --project ~/projects/app-b # プロジェクトB
322
+ ```
323
+
324
+ **ダッシュボード機能:**
325
+
326
+ | タブ | 機能 |
327
+ |------|------|
328
+ | Dashboard | プロジェクト概要、リアルタイムメトリクス |
329
+ | Logs | ログ検索・フィルタ、リアルタイムストリーミング |
330
+ | Statistics | ツール呼び出し統計、トークン使用量チャート |
331
+ | Sessions | セッション履歴、JSON エクスポート |
332
+
333
+ **特徴:**
334
+ - サイドバーで複数プロジェクトを切り替え
335
+ - MCP サーバー終了後もダッシュボードは継続動作
336
+ - ダークモード / ライトモード切替
130
337
  - モバイルレスポンシブ対応
131
338
 
339
+ **ダッシュボードオプション:**
340
+
341
+ | オプション | 説明 |
342
+ |------------|------|
343
+ | `--port <port>` | ダッシュボードのポート番号(デフォルト: 24282) |
344
+
132
345
  #### MCP クライアント(Codex など)からの接続例
133
346
 
134
347
  `npx` で公開パッケージを取得する場合、`mcp_servers.toml` の設定キーを `smart-edit` に合わせてください。
@@ -136,7 +349,7 @@ SMART_EDIT_SKIP_RUNTIME_INSTALL=1 npx @nogataka/smart-edit smart-edit start-mcp-
136
349
  ```toml
137
350
  [mcp_servers.smart-edit]
138
351
  command = "npx"
139
- args = ["-y", "@nogataka/smart-edit@latest", "smart-edit", "start-mcp-server", "--context", "codex", "--transport", "stdio"]
352
+ args = ["-y", "@nogataka/smart-edit@latest", "start-mcp-server", "--context", "codex", "--transport", "stdio"]
140
353
  ```
141
354
 
142
355
  CLI 側の `--context` や `--mode` は必要に応じて追加してください。`smart-edit` コマンドは `package.json` の `bin.smart-edit` で `./dist/cli.js` にマッピングされています。
@@ -145,13 +358,13 @@ CLI 側の `--context` や `--mode` は必要に応じて追加してくださ
145
358
 
146
359
  ```bash
147
360
  # プロジェクト設定 YAML の生成
148
- npx @nogataka/smart-edit smart-edit project generate-yml /path/to/project
361
+ npx @nogataka/smart-edit project generate-yml /path/to/project
149
362
 
150
363
  # 有効化されているツールを確認
151
- npx @nogataka/smart-edit smart-edit tools list
364
+ npx @nogataka/smart-edit tools list
152
365
 
153
366
  # ツールごとの説明を表示
154
- npx @nogataka/smart-edit smart-edit tools list
367
+ npx @nogataka/smart-edit tools list
155
368
  ```
156
369
 
157
370
  ### 4. メモリ機能
@@ -186,71 +399,296 @@ Smart Edit はプロジェクト固有のメモリ機能を提供します。AI
186
399
 
187
400
  以下の言語サーバーに対応しています:
188
401
 
189
- | 言語 | サーバー | バージョン | ダウンロード元 | 備考 |
190
- | ----------------------- | -------------------------- | -------------------- | --------------------------------- | ---------------------------------- |
191
- | Bash | bash-language-server | 5.6.0 | npm | Node.js 20 以上必須 |
192
- | C / C++ | clangd | 19.1.2 | GitHub Releases | LLVM プロジェクト |
193
- | C# | csharp-language-server | 5.0.0-1.25329.6 | NuGet | .NET ランタイム必要 |
194
- | Clojure | clojure-lsp | latest | GitHub Releases | Clojure 開発環境 |
195
- | Dart | Dart SDK | 3.10.4 | Google Storage | Flutter SDK に同梱 |
196
- | Erlang | erlang_ls | (PATH 検出) | 外部インストール | Erlang/OTP ランタイム必要 |
197
- | Go | gopls | latest | `go install` | 公式 Go チームによる実装 |
198
- | Java | Eclipse JDT.LS | 1.42.0 | GitHub (vscode-java) | Java 21 以上必須 |
199
- | Kotlin | kotlin-language-server | 0.253.10629 | JetBrains CDN | JVM ランタイム必要 |
200
- | Lua | lua-language-server | 3.15.0 | GitHub Releases | Lua 5.1〜5.5、LuaJIT 対応 |
201
- | Nix | nixd | (PATH / nix profile) | 外部インストール | Nix 式のサポート |
202
- | PHP | Intelephense | 1.16.4 | npm | 高機能 PHP サーバー |
203
- | Python | Jedi Language Server | (PyPI) | pip | 軽量・高速 |
204
- | Python | Pyright | (PyPI) | pip | Microsoft 製・型チェック強化 |
205
- | R | R Language Server | (CRAN) | R package | CRAN パッケージ |
206
- | Ruby | Ruby LSP | (gem) | RubyGems | Shopify 製・高速 |
207
- | Ruby | Solargraph | (gem) | RubyGems | 従来からの定番 |
208
- | Rust | rust-analyzer | (rustup) | rustup component | 公式推奨 |
209
- | Swift | SourceKit-LSP | (PATH 検出) | Xcode / Swift Toolchain | Apple 公式 |
210
- | Terraform | terraform-ls | 0.38.3 | HashiCorp Releases | HashiCorp 公式、Actions block 対応 |
211
- | TypeScript / JavaScript | typescript-language-server | 5.1.3 (TS 5.9.3) | npm | tsserver ラッパー |
212
- | Vue | VTS (Volar) | 0.3.0 | npm (@vtsls/language-server) | Vue 3 対応、TS 必須 |
213
- | Zig | zls | (PATH 検出) | 外部インストール | Zig 公式 |
402
+ | 言語 | サーバー | バージョン | ダウンロード元 | 備考 |
403
+ | ----------------------- | -------------------------- | -------------------- | ---------------------------- | ---------------------------------- |
404
+ | Bash | bash-language-server | 5.6.0 | npm | Node.js 20 以上必須 |
405
+ | C / C++ | clangd | 19.1.2 | GitHub Releases | LLVM プロジェクト |
406
+ | C# | csharp-language-server | 5.0.0-1.25329.6 | NuGet | .NET ランタイム必要 |
407
+ | Clojure | clojure-lsp | latest | GitHub Releases | Clojure 開発環境 |
408
+ | Dart | Dart SDK | 3.10.4 | Google Storage | Flutter SDK に同梱 |
409
+ | Erlang | erlang_ls | (PATH 検出) | 外部インストール | Erlang/OTP ランタイム必要 |
410
+ | Go | gopls | latest | `go install` | 公式 Go チームによる実装 |
411
+ | Java | Eclipse JDT.LS | 1.42.0 | GitHub (vscode-java) | Java 21 以上必須 |
412
+ | Kotlin | kotlin-language-server | 0.253.10629 | JetBrains CDN | JVM ランタイム必要 |
413
+ | Lua | lua-language-server | 3.15.0 | GitHub Releases | Lua 5.1〜5.5、LuaJIT 対応 |
414
+ | Nix | nixd | (PATH / nix profile) | 外部インストール | Nix 式のサポート |
415
+ | PHP | Intelephense | 1.16.4 | npm | 高機能 PHP サーバー |
416
+ | Python | Jedi Language Server | (PyPI) | pip | 軽量・高速 |
417
+ | Python | Pyright | (PyPI) | pip | Microsoft 製・型チェック強化 |
418
+ | R | R Language Server | (CRAN) | R package | CRAN パッケージ |
419
+ | Ruby | Ruby LSP | (gem) | RubyGems | Shopify 製・高速 |
420
+ | Ruby | Solargraph | (gem) | RubyGems | 従来からの定番 |
421
+ | Rust | rust-analyzer | (rustup) | rustup component | 公式推奨 |
422
+ | Swift | SourceKit-LSP | (PATH 検出) | Xcode / Swift Toolchain | Apple 公式 |
423
+ | Terraform | terraform-ls | 0.38.3 | HashiCorp Releases | HashiCorp 公式、Actions block 対応 |
424
+ | TypeScript / JavaScript | typescript-language-server | 5.1.3 (TS 5.9.3) | npm | tsserver ラッパー |
425
+ | Vue | VTS (Volar) | 0.3.0 | npm (@vtsls/language-server) | Vue 3 対応、TS 必須 |
426
+ | Zig | zls | (PATH 検出) | 外部インストール | Zig 公式 |
214
427
 
215
428
  **除外**: AL Language Server, elixir_tools, OmniSharp(TypeScript 版では対象外)
216
429
 
217
430
  **バージョン更新日**: 2026-02-01
218
431
 
432
+ #### 実行方式の分類
433
+
434
+ 言語サーバーは以下の方式で管理されます:
435
+
436
+ | 方式 | 説明 | 対象サーバー |
437
+ | -------------------------- | -------------------------------------------- | -------------------------------------------- |
438
+ | **バイナリDL型** | プラットフォーム別バイナリを自動ダウンロード | Clangd, Dart SDK, Lua, Zig, Terraform |
439
+ | **npm型** | npm でパッケージをインストール | TypeScript, Bash, PHP, Vue |
440
+ | **システム依存型** | システムにインストール済みのコマンドを使用 | Pyright, Jedi, gopls, SourceKit, Erlang, Nix |
441
+ | **システム依存型(半自動)** | 未検出時に自動インストール | rust-analyzer (rustup経由) |
442
+ | **言語パッケージ型** | 各言語のパッケージマネージャーでインストール | Ruby LSP, Solargraph (gem), R (CRAN) |
443
+ | **複合ダウンロード型** | 複数コンポーネントをダウンロード・展開 | Eclipse JDT (Java), Kotlin |
444
+
445
+ 詳細は [LSPサーバー実行方式調査](docs/public/lsp_server_execution_methods.md) および [LSPサーバー実行方式一覧表](docs/public/lsp_servers_execution_type_table.md) を参照してください。
446
+
447
+ ## MCP クライアント接続ガイド
448
+
449
+ Smart Edit は MCP (Model Context Protocol) サーバーとして動作し、様々な AI コーディングツールから利用できます。
450
+
451
+ ### `--project` オプションについて
452
+
453
+ **デフォルトでカレントディレクトリがプロジェクトとして自動アクティブ化されます。** `--project` を明示的に指定した場合はそのパスが使用されます。
454
+
455
+ | 指定方法 | 動作 |
456
+ |----------|------|
457
+ | オプションなし | カレントディレクトリを自動アクティブ化 |
458
+ | `--project /path/to/project` | 指定したパスをアクティブ化 |
459
+ | `--no-project` | プロジェクトなしで起動(後から `activate_project` で指定可能) |
460
+
461
+ ```bash
462
+ # オプションなし(カレントディレクトリを自動使用)
463
+ npx @nogataka/smart-edit start-mcp-server --transport stdio
464
+
465
+ # --project あり(特定プロジェクトを指定)
466
+ npx @nogataka/smart-edit start-mcp-server --project /path/to/project --transport stdio
467
+
468
+ # --no-project(プロジェクトなしで起動、後から指定)
469
+ npx @nogataka/smart-edit start-mcp-server --no-project --transport stdio
470
+ ```
471
+
472
+ #### `--no-project` で起動した場合の使い方
473
+
474
+ `--no-project` を指定した場合、最初にプロジェクトをアクティブ化する必要があります。以下のようにチャットで AI に依頼してください:
475
+
476
+ **プロンプト例:**
477
+ ```
478
+ 現在のディレクトリをプロジェクトとしてアクティブ化して
479
+ ```
480
+
481
+ ```
482
+ /path/to/my-project をアクティブ化して
483
+ ```
484
+
485
+ ```
486
+ smart-edit で現在のプロジェクトを登録して
487
+ ```
488
+
489
+ AI が `activate_project` ツールを呼び出し、以下が実行されます:
490
+ - `.smart-edit` ディレクトリの作成
491
+ - 言語サーバーの初期化
492
+ - プロジェクト固有のツールが利用可能に
493
+
494
+ 以下の各クライアント設定例ではデフォルト動作(カレントディレクトリ自動使用)を利用していますが、必要に応じて `--project` や `--no-project` を追加できます。
495
+
496
+ ---
497
+
498
+ ### 対応 MCP クライアント一覧
499
+
500
+ | クライアント | 開発元 | 対応状況 | 備考 |
501
+ | ------------------ | ---------------- | ---------- | ------------------------------------ |
502
+ | **Claude Code** | Anthropic | ✅ 完全対応 | CLI ベースのコーディングアシスタント |
503
+ | **Claude Desktop** | Anthropic | ✅ 完全対応 | デスクトップアプリ版 Claude |
504
+ | **Codex CLI** | OpenAI | ✅ 完全対応 | OpenAI の CLI コーディングツール |
505
+ | **Cursor** | Cursor Inc | ✅ 対応 | AI ファースト IDE |
506
+ | **Windsurf** | Codeium | ✅ 対応 | AI コードエディタ |
507
+ | **Continue** | Continue | ✅ 対応 | オープンソース AI アシスタント |
508
+ | **Cline** | Cline | ✅ 対応 | VS Code 拡張 (旧 Claude Dev) |
509
+ | **Zed** | Zed | ✅ 対応 | 高速 AI コードエディタ |
510
+ | **GitHub Copilot** | GitHub/Microsoft | ✅ 対応 | VS Code 1.102+, JetBrains で公式対応 |
511
+
512
+ ---
513
+
219
514
  ### Claude Code への接続手順
220
515
 
221
- Claude Code ではプロジェクトごとに MCP サーバーを追加します。smart-edit を使う場合の手順は以下の通りです。
516
+ Claude Code ではプロジェクトごとに MCP サーバーを追加します。
222
517
 
223
- 1. プロジェクトのルートディレクトリで次のコマンドを実行します。
224
- ```bash
225
- claude mcp add smart-edit -- npx -y @nogataka/smart-edit@latest smart-edit start-mcp-server --context ide-assistant --project "$(pwd)" --transport stdio
226
- ```
227
- - `smart-edit` が Claude Code 上でのサーバー識別子になります(任意で変更可)。
228
- - `--context ide-assistant` は Claude Code 向けに最適化した設定です。用途に応じて `desktop-app` など他のコンテキストへ切り替えても構いません。
229
- - `--project` にはコードベースのルートパスを指定してください。`$(pwd)` を使うとカレントディレクトリをそのまま渡せます。
230
- - `--transport stdio` は標準入出力経由での通信を指定します。Claude Code は stdio を用いるため、この指定が必要です。
518
+ ```bash
519
+ # プロジェクトのルートディレクトリで実行
520
+ claude mcp add smart-edit -- npx -y @nogataka/smart-edit@latest start-mcp-server --transport stdio
521
+ ```
231
522
 
232
- 2. 追加が完了したら、`claude mcp list` で登録済みサーバーを確認できます。必要に応じて `claude mcp remove smart-edit` で削除し、再登録してください。
523
+ **オプション付きの例:**
524
+ ```bash
525
+ # プロジェクトを指定する場合
526
+ claude mcp add smart-edit -- npx -y @nogataka/smart-edit@latest start-mcp-server --project "$(pwd)" --transport stdio
233
527
 
234
- 3. 会話を開始すると Claude が smart-edit の初期インストラクション(`initial_instructions`)を自動で読み込みます。もし読み込みに失敗した場合は、Claude に「smart-edit の初期インストラクションを読んで」と依頼するか、`/mcp__smart-edit__initial_instructions` を実行してください(初期インストラクションツールを有効化している場合)。
528
+ # コンテキストを指定する場合
529
+ claude mcp add smart-edit -- npx -y @nogataka/smart-edit@latest start-mcp-server --context ide-assistant --transport stdio
530
+ ```
235
531
 
236
- 4. コンテキストやモードをカスタマイズしたい場合は、`~/.smart-edit/context/` 配下に YAML を配置した上で `--context` / `--mode` オプションで指定できます。
532
+ **管理コマンド:**
533
+ ```bash
534
+ claude mcp list # 登録済みサーバー一覧
535
+ claude mcp remove smart-edit # サーバー削除
536
+ ```
537
+
538
+ ---
237
539
 
238
540
  ### Codex CLI への接続手順
239
541
 
240
- Codex CLI はグローバル設定で MCP サーバーを追加します。`~/.codex/config.toml` に以下のエントリを追加してください。
542
+ `~/.codex/config.toml` に以下を追加します。
241
543
 
242
544
  ```toml
243
545
  [mcp_servers.smart-edit]
244
546
  command = "npx"
245
- args = ["-y", "@nogataka/smart-edit@latest", "smart-edit", "start-mcp-server", "--context", "codex", "--transport", "stdio"]
547
+ args = ["-y", "@nogataka/smart-edit@latest", "start-mcp-server", "--context", "codex", "--transport", "stdio"]
246
548
  ```
247
549
 
248
- - `--context codex` は Codex 特有の I/O や制約に対応するための設定です。Codex では `codex` コンテキストを使うことでツールの動作が最適化されます。
249
- - Codex 起動後、チャット内で「smart-edit で現在のディレクトリをプロジェクトとしてアクティブ化して」と依頼してください。プロジェクトをアクティブ化しないとツールを利用できません。
250
- - ダッシュボード (`--enable-web-dashboard`) を利用する場合、Codex のサンドボックスではブラウザが自動起動しないことがあります。その場合は `http://localhost:24282/dashboard/index.html` (ポートは環境により変わります)へブラウザでアクセスしてください。
251
- - Codex の UI ではツール実行が `failed` と表示されることがありますが、実際には処理が成功しているケースが多いです。ログ (`~/.codex/log/codex-tui.log`) を併せて確認してください。
550
+ **使用方法:**
551
+ 1. Codex 起動後、チャット内で「smart-edit で現在のディレクトリをプロジェクトとしてアクティブ化して」と依頼
552
+ 2. プロジェクトをアクティブ化するとツールが利用可能に
553
+
554
+ > **Note**:
555
+ > - デフォルトではカレントディレクトリが自動的にプロジェクトとして使用されます(上記「`--project` オプションについて」を参照)
556
+ > - Codex の UI でツール実行が `failed` と表示されても、実際には成功していることがあります。ログ (`~/.codex/log/codex-tui.log`) で確認してください。
557
+
558
+ ---
559
+
560
+ ### Cursor への接続手順
561
+
562
+ Cursor では `~/.cursor/mcp.json` (または Settings → MCP) で設定します。
563
+
564
+ ```json
565
+ {
566
+ "mcpServers": {
567
+ "smart-edit": {
568
+ "command": "npx",
569
+ "args": ["-y", "@nogataka/smart-edit@latest", "start-mcp-server", "--transport", "stdio"]
570
+ }
571
+ }
572
+ }
573
+ ```
574
+
575
+ > デフォルトでカレントディレクトリが使用されます。特定パスを指定する場合: `args` に `"--project", "/path/to/project"` を追加
576
+
577
+ ---
578
+
579
+ ### Windsurf (Codeium) への接続手順
580
+
581
+ Windsurf では `~/.codeium/windsurf/mcp_config.json` で設定します。
582
+
583
+ ```json
584
+ {
585
+ "mcpServers": {
586
+ "smart-edit": {
587
+ "command": "npx",
588
+ "args": ["-y", "@nogataka/smart-edit@latest", "start-mcp-server", "--transport", "stdio"]
589
+ }
590
+ }
591
+ }
592
+ ```
593
+
594
+ > デフォルトでカレントディレクトリが使用されます。特定パスを指定する場合: `args` に `"--project", "/path/to/project"` を追加
595
+
596
+ ---
597
+
598
+ ### Continue への接続手順
599
+
600
+ Continue では `~/.continue/config.json` の `experimental.modelContextProtocolServers` に追加します。
601
+
602
+ ```json
603
+ {
604
+ "experimental": {
605
+ "modelContextProtocolServers": [
606
+ {
607
+ "transport": {
608
+ "type": "stdio",
609
+ "command": "npx",
610
+ "args": ["-y", "@nogataka/smart-edit@latest", "start-mcp-server", "--transport", "stdio"]
611
+ }
612
+ }
613
+ ]
614
+ }
615
+ }
616
+ ```
617
+
618
+ > デフォルトでカレントディレクトリが使用されます。特定パスを指定する場合: `args` に `"--project", "/path/to/project"` を追加
619
+
620
+ ---
621
+
622
+ ### Cline (VS Code 拡張) への接続手順
623
+
624
+ Cline では VS Code の設定 (`settings.json`) または Cline の MCP 設定画面から追加します。
625
+
626
+ ```json
627
+ {
628
+ "cline.mcpServers": {
629
+ "smart-edit": {
630
+ "command": "npx",
631
+ "args": ["-y", "@nogataka/smart-edit@latest", "start-mcp-server", "--transport", "stdio"]
632
+ }
633
+ }
634
+ }
635
+ ```
636
+
637
+ > デフォルトでカレントディレクトリが使用されます。特定パスを指定する場合: `args` に `"--project", "/path/to/project"` を追加
638
+
639
+ ---
640
+
641
+ ### Zed への接続手順
642
+
643
+ Zed では `~/.config/zed/settings.json` の `context_servers` に追加します。
644
+
645
+ ```json
646
+ {
647
+ "context_servers": {
648
+ "smart-edit": {
649
+ "command": {
650
+ "path": "npx",
651
+ "args": ["-y", "@nogataka/smart-edit@latest", "start-mcp-server", "--transport", "stdio"]
652
+ }
653
+ }
654
+ }
655
+ }
656
+ ```
657
+
658
+ > デフォルトでカレントディレクトリが使用されます。特定パスを指定する場合: `args` に `"--project", "/path/to/project"` を追加
659
+
660
+ ---
661
+
662
+ ### GitHub Copilot への接続手順
663
+
664
+ GitHub Copilot は VS Code 1.102 以降で MCP を公式サポートしています。
665
+
666
+ #### VS Code での設定
667
+
668
+ `.vscode/mcp.json` または `settings.json` の `mcp.servers` に追加します。
669
+
670
+ ```json
671
+ {
672
+ "servers": {
673
+ "smart-edit": {
674
+ "command": "npx",
675
+ "args": ["-y", "@nogataka/smart-edit@latest", "start-mcp-server", "--transport", "stdio"]
676
+ }
677
+ }
678
+ }
679
+ ```
680
+
681
+ > デフォルトでカレントディレクトリが使用されます。特定パスを指定する場合: `args` に `"--project", "/path/to/project"` を追加
682
+
683
+ #### JetBrains IDE での設定
684
+
685
+ JetBrains IDE(IntelliJ IDEA, WebStorm 等)でも MCP がサポートされています。設定は IDE の MCP 設定画面から追加できます。
686
+
687
+ **参考リンク:**
688
+ - [VS Code MCP Servers ドキュメント](https://code.visualstudio.com/docs/copilot/customization/mcp-servers)
689
+ - [GitHub Copilot MCP 概要](https://docs.github.com/en/copilot/concepts/context/mcp)
252
690
 
253
- これらの設定を行うことで、Claude Code / Codex ともに `npx -y @nogataka/smart-edit@latest` を通して smart-edit MCP サーバーを利用できます。`npm publish` 後に `@nogataka/smart-edit` のバージョンを最新に保つようご注意ください。
691
+ ---
254
692
 
255
693
  ### Claude Desktop への接続手順
256
694
 
@@ -262,7 +700,7 @@ Claude Desktop (Windows/macOS) では `claude_desktop_config.json` に MCP サ
262
700
  "mcpServers": {
263
701
  "smart-edit": {
264
702
  "command": "npx",
265
- "args": ["-y", "@nogataka/smart-edit@latest", "smart-edit", "start-mcp-server", "--context", "desktop-app", "--transport", "stdio"]
703
+ "args": ["-y", "@nogataka/smart-edit@latest", "start-mcp-server", "--context", "desktop-app", "--transport", "stdio"]
266
704
  }
267
705
  }
268
706
  }
@@ -280,7 +718,7 @@ Claude Desktop (Windows/macOS) では `claude_desktop_config.json` に MCP サ
280
718
  }
281
719
  ```
282
720
  - `dist/cli.js` を呼び出す前に `pnpm build` を実行し、`dist/` に成果物を生成しておいてください。
283
- - `--project` は必要に応じて省略できます(省略時は起動後にチャットからプロジェクトをアクティブ化します)。
721
+ - デフォルトでカレントディレクトリが使用されます。`--no-project` を指定するとプロジェクトなしで起動できます。
284
722
 
285
723
  - **Docker イメージを使う場合(PoC)**
286
724
  ```json
@@ -292,7 +730,7 @@ Claude Desktop (Windows/macOS) では `claude_desktop_config.json` に MCP サ
292
730
  "run", "--rm", "-i",
293
731
  "-v", "/path/to/your/projects:/workspace/projects",
294
732
  "ghcr.io/nogataka/smart-edit:latest",
295
- "smart-edit", "start-mcp-server", "--context", "desktop-app", "--transport", "stdio"
733
+ "start-mcp-server", "--context", "desktop-app", "--transport", "stdio"
296
734
  ]
297
735
  }
298
736
  }
@@ -304,7 +742,7 @@ Claude Desktop (Windows/macOS) では `claude_desktop_config.json` に MCP サ
304
742
  - Windows でパスを指定する場合はバックスラッシュを二重にする (`\\`) か、スラッシュ (`/`) を利用してください。
305
743
  - 設定を保存したら Claude Desktop を完全終了(システムトレイのアイコンも終了)し、再起動すると smart-edit のツールが利用可能になります。
306
744
  - `desktop-app` コンテキストは Claude Desktop 向けにチューニングされています。必要に応じて `~/.smart-edit/contexts/` 配下に自作コンテキストを配置し、`--context` で差し替え可能です。
307
- - ダッシュボードを利用したい場合は Config 側で `web_dashboard: true` を有効にしてください。ブラウザが自動起動しない場合は `http://localhost:24282/dashboard/index.html` へアクセスできます。
745
+ - ダッシュボードを利用したい場合は別ターミナルで `npx @nogataka/smart-edit start-dashboard` を実行してください。ブラウザで `http://localhost:24282/dashboard/` にアクセスすると統合ダッシュボードが表示されます。
308
746
  - MCP サーバーを終了するにはチャットを閉じるだけでなく、別コンソールから `smart-edit` プロセスを停止するか、CLI のログを確認しながら Ctrl+C で停止してください。
309
747
 
310
748
  Claude Desktop の MCP 設定については [公式クイックスタート](https://modelcontextprotocol.io/quickstart/user) も参考になります。