ai-cli-mcp 2.3.3 → 2.4.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/CHANGELOG.md +8 -0
- package/CONTRIBUTING.md +71 -0
- package/README.ja.md +227 -0
- package/README.md +77 -103
- package/dist/server.js +22 -14
- package/docs/RELEASE_CHECKLIST.md +10 -8
- package/package.json +1 -1
- package/src/server.ts +24 -14
- package/docs/local_install.md +0 -111
- package/scripts/check-version-log.sh +0 -34
- package/scripts/publish-release.sh +0 -95
- package/scripts/restore-config.sh +0 -28
- package/scripts/test-release.sh +0 -69
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
# [2.4.0](https://github.com/mkXultra/claude-code-mcp/compare/v2.3.3...v2.4.0) (2026-01-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* add model aliases and auto-reasoning for Codex ([16bbd7c](https://github.com/mkXultra/claude-code-mcp/commit/16bbd7cef934cbe2c652e7e48c8dd289f1a64eda))
|
|
7
|
+
* add support for gemini-3-flash-preview ([b51a2d1](https://github.com/mkXultra/claude-code-mcp/commit/b51a2d1789455f3366dfc8f6397cf7ffc39f930d))
|
|
8
|
+
|
|
1
9
|
## [2.3.3](https://github.com/mkXultra/claude-code-mcp/compare/v2.3.2...v2.3.3) (2026-01-20)
|
|
2
10
|
|
|
3
11
|
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## Development Setup
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
git clone https://github.com/mkXultra/claude-code-mcp.git
|
|
7
|
+
cd claude-code-mcp
|
|
8
|
+
npm install
|
|
9
|
+
npm run build
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Testing
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# Run all tests
|
|
16
|
+
npm test
|
|
17
|
+
|
|
18
|
+
# Unit tests only
|
|
19
|
+
npm run test:unit
|
|
20
|
+
|
|
21
|
+
# E2E tests (with mocks)
|
|
22
|
+
npm run test:e2e
|
|
23
|
+
|
|
24
|
+
# E2E tests locally (requires Claude CLI)
|
|
25
|
+
npm run test:e2e:local
|
|
26
|
+
|
|
27
|
+
# Watch mode
|
|
28
|
+
npm run test:watch
|
|
29
|
+
|
|
30
|
+
# Coverage
|
|
31
|
+
npm run test:coverage
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Manual Testing with MCP Inspector
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm run build
|
|
38
|
+
npx @modelcontextprotocol/inspector node dist/server.js
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Local Development with npm link
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install
|
|
45
|
+
npm run build
|
|
46
|
+
npm link
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Then use `ai-cli-mcp` command globally.
|
|
50
|
+
|
|
51
|
+
## Environment Variables
|
|
52
|
+
|
|
53
|
+
| Variable | Description |
|
|
54
|
+
|----------|-------------|
|
|
55
|
+
| `CLAUDE_CLI_NAME` | Claude CLI binary name or absolute path |
|
|
56
|
+
| `CODEX_CLI_NAME` | Codex CLI binary name or absolute path |
|
|
57
|
+
| `GEMINI_CLI_NAME` | Gemini CLI binary name or absolute path |
|
|
58
|
+
| `MCP_CLAUDE_DEBUG` | Enable debug logging (`true`/`false`) |
|
|
59
|
+
|
|
60
|
+
## Release Process
|
|
61
|
+
|
|
62
|
+
See [docs/RELEASE_CHECKLIST.md](docs/RELEASE_CHECKLIST.md) for release instructions.
|
|
63
|
+
|
|
64
|
+
Uses semantic-release with Conventional Commits:
|
|
65
|
+
- `fix:` → patch release
|
|
66
|
+
- `feat:` → minor release
|
|
67
|
+
- `feat!:` or `BREAKING CHANGE:` → major release
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
MIT
|
package/README.ja.md
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# AI CLI MCP Server
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/ai-cli-mcp)
|
|
4
|
+
[](/CHANGELOG.md)
|
|
5
|
+
|
|
6
|
+
> **📦 パッケージ移行のお知らせ**: 本パッケージは旧名 `@mkxultra/claude-code-mcp` から `ai-cli-mcp` に名称変更されました。これは、複数のAI CLIツールのサポート拡大を反映したものです。
|
|
7
|
+
|
|
8
|
+
AI CLIツール(Claude, Codex, Gemini)をバックグラウンドプロセスとして実行し、権限処理を自動化するMCP(Model Context Protocol)サーバーです。
|
|
9
|
+
|
|
10
|
+
Cursorなどのエディタが、複雑な手順を伴う編集や操作に苦戦していることに気づいたことはありませんか?このサーバーは、強力な統合 `run` ツールを提供し、複数のAIエージェントを活用してコーディングタスクをより効果的に処理できるようにします。
|
|
11
|
+
|
|
12
|
+
<img src="assets/screenshot.png" width="300" alt="Screenshot">
|
|
13
|
+
|
|
14
|
+
## 概要
|
|
15
|
+
|
|
16
|
+
このMCPサーバーは、LLMがAI CLIツールと対話するためのツールを提供します。MCPクライアントと統合することで、LLMは以下のことが可能になります:
|
|
17
|
+
|
|
18
|
+
- すべての権限確認をスキップしてClaude CLIを実行(`--dangerously-skip-permissions` を使用)
|
|
19
|
+
- 自動承認モードでCodex CLIを実行(`--full-auto` を使用)
|
|
20
|
+
- 自動承認モードでGemini CLIを実行(`-y` を使用)
|
|
21
|
+
- 複数のAIモデルのサポート:
|
|
22
|
+
- Claude (sonnet, opus, haiku)
|
|
23
|
+
- Codex (gpt-5.2-codex, gpt-5.1-codex-mini, gpt-5.1-codex-max, など)
|
|
24
|
+
- Gemini (gemini-2.5-pro, gemini-2.5-flash, gemini-3-pro-preview, gemini-3-flash-preview)
|
|
25
|
+
- PID追跡によるバックグラウンドプロセスの管理
|
|
26
|
+
- ツールからの構造化された出力の解析と返却
|
|
27
|
+
|
|
28
|
+
### 使用例(高度な並行処理)
|
|
29
|
+
|
|
30
|
+
メインのエージェントに以下のように指示することで、複数のタスクを並行して実行させることができます。
|
|
31
|
+
|
|
32
|
+
> 以下の3つのタスクをacm mcp runでエージェントを起動して:
|
|
33
|
+
> 1. `sonnet` で `src/backend` のコードをリファクタリング
|
|
34
|
+
> 2. `gpt-5.2-codex` で `src/frontend` のユニットテストを作成
|
|
35
|
+
> 3. `gemini-2.5-pro` で `docs/` のドキュメントを更新
|
|
36
|
+
>
|
|
37
|
+
> 実行中はあなたはTODOリストを更新する作業を行ってください。それが終わったら `wait` ツールを使ってすべての完了を待機し、結果をまとめて報告してください。
|
|
38
|
+
|
|
39
|
+
### 使用例(コンテキストキャッシュの共有)
|
|
40
|
+
|
|
41
|
+
一度読み込んだ重いコンテキスト(大規模なコードベースやドキュメント)をセッションIDを使って再利用することで、コストを抑えながら複数のタスクを実行できます。
|
|
42
|
+
|
|
43
|
+
> 1. まず `acm mcp run` を使い、`opus` で `src/` 以下の全ファイルを読み込み、プロジェクトの構造を理解させてください。
|
|
44
|
+
> 2. `wait` ツールでこの処理の完了を待ち、結果から `session_id` を取得してください。
|
|
45
|
+
> 3. その `session_id` を使い、以下の2つのタスクを `acm mcp run` で並行して実行してください:
|
|
46
|
+
> - `sonnet` で `src/utils` のリファクタリング案を作成
|
|
47
|
+
> - `gpt-5.2-codex` で `README.md` にアーキテクチャの解説を追記
|
|
48
|
+
> 4. 最後に再び `wait` して、両方の結果をまとめてください。
|
|
49
|
+
|
|
50
|
+
## メリット
|
|
51
|
+
|
|
52
|
+
- **真の非同期マルチタスク**: エージェントの実行はバックグラウンドで行われ、即座に制御が戻ります。呼び出し元のAIは実行完了を待つことなく、並行して次のタスクの実行や別のエージェントの呼び出しを行うことができます。
|
|
53
|
+
- **CLI in CLI (Agent in Agent) の実現**: MCPをサポートするあらゆるIDEやCLIから、Claude CodeやCodexといった強力なCLIツールを直接呼び出せます。ホスト環境の制限を超えた、より広範で複雑なシステム操作や自動化が可能になります。
|
|
54
|
+
- **モデル・プロバイダの制約からの解放**: 特定のエコシステムに縛られることなく、Claude、Codex (GPT)、Geminiの中から、タスクに最適な「最強のモデル」や「コスト効率の良いモデル」を自由に選択・組み合わせて利用できます。
|
|
55
|
+
|
|
56
|
+
## 前提条件
|
|
57
|
+
|
|
58
|
+
利用したいAI CLIツールがローカル環境にインストールされ、正しく設定されていることが唯一の前提条件です。
|
|
59
|
+
|
|
60
|
+
- **Claude Code**: `claude doctor` が通り、`--dangerously-skip-permissions` での実行が承認済み(一度手動で実行してログイン・承認済み)であること。
|
|
61
|
+
- **Codex CLI**(オプション): インストール済みで、ログインなどの初期設定が完了していること。
|
|
62
|
+
- **Gemini CLI**(オプション): インストール済みで、ログインなどの初期設定が完了していること。
|
|
63
|
+
|
|
64
|
+
## インストールと使い方
|
|
65
|
+
|
|
66
|
+
推奨される使用方法は、`npx` を使用してインストールすることです。
|
|
67
|
+
|
|
68
|
+
### MCP設定ファイルでnpxを使用する場合:
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
"ai-cli-mcp": {
|
|
72
|
+
"command": "npx",
|
|
73
|
+
"args": [
|
|
74
|
+
"-y",
|
|
75
|
+
"ai-cli-mcp@latest"
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Claude CLI mcp add コマンドを使用する場合:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
claude mcp add ai-cli '{"name":"ai-cli","command":"npx","args":["-y","ai-cli-mcp@latest"]}'
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## 重要な初回セットアップ
|
|
87
|
+
|
|
88
|
+
### Claude CLIの場合:
|
|
89
|
+
|
|
90
|
+
**MCPサーバーがClaudeを使用する前に、一度手動で `--dangerously-skip-permissions` フラグを付けてClaude CLIを実行し、ログインして利用規約に同意する必要があります。**
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npm install -g @anthropic-ai/claude-code
|
|
94
|
+
claude --dangerously-skip-permissions
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
プロンプトに従って同意してください。これが完了すると、MCPサーバーはこのフラグを使って非対話的に実行できるようになります。
|
|
98
|
+
|
|
99
|
+
### Codex CLIの場合:
|
|
100
|
+
|
|
101
|
+
**Codexの場合、ログインして必要な規約に同意していることを確認してください:**
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
codex login
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Gemini CLIの場合:
|
|
108
|
+
|
|
109
|
+
**Geminiの場合、ログインして認証情報を設定していることを確認してください:**
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
gemini auth login
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
macOSでは、これらのツールを初めて実行する際にフォルダへのアクセス許可を求められる場合があります。最初の実行が失敗しても、2回目以降は動作するはずです。
|
|
116
|
+
|
|
117
|
+
## MCPクライアントへの接続
|
|
118
|
+
|
|
119
|
+
サーバーのセットアップ後、MCPクライアント(CursorやWindsurfなど)の設定ファイル(`mcp.json` や `mcp_config.json`)に設定を追加してください。
|
|
120
|
+
|
|
121
|
+
ファイルが存在しない場合は作成し、`ai-cli-mcp` の設定を追加してください。
|
|
122
|
+
|
|
123
|
+
## 提供されるツール
|
|
124
|
+
|
|
125
|
+
このサーバーは以下のツールを公開しています:
|
|
126
|
+
|
|
127
|
+
### `run`
|
|
128
|
+
|
|
129
|
+
Claude CLI、Codex CLI、またはGemini CLIを使用してプロンプトを実行します。モデル名に基づいて適切なCLIが自動的に選択されます。
|
|
130
|
+
|
|
131
|
+
**引数:**
|
|
132
|
+
- `prompt` (string, 任意): AIエージェントに送信するプロンプト。`prompt` または `prompt_file` のいずれかが必須です。
|
|
133
|
+
- `prompt_file` (string, 任意): プロンプトを含むファイルへのパス。`prompt` または `prompt_file` のいずれかが必須です。絶対パス、または `workFolder` からの相対パスが指定可能です。
|
|
134
|
+
- `workFolder` (string, 必須): CLIを実行する作業ディレクトリ。絶対パスである必要があります。
|
|
135
|
+
- **モデル (Models):**
|
|
136
|
+
- **Ultra エイリアス:** `claude-ultra`, `codex-ultra` (自動的に high-reasoning に設定), `gemini-ultra`
|
|
137
|
+
- Claude: `sonnet`, `opus`, `haiku`
|
|
138
|
+
- Codex: `gpt-5.2-codex`, `gpt-5.1-codex-mini`, `gpt-5.1-codex-max`, `gpt-5.2`, `gpt-5.1`, `gpt-5`
|
|
139
|
+
- Gemini: `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-3-pro-preview`, `gemini-3-flash-preview`
|
|
140
|
+
- `reasoning_effort` (string, 任意): Codex専用。`model_reasoning_effort` を設定します(許容値: "low", "medium", "high")。
|
|
141
|
+
- `session_id` (string, 任意): 以前のセッションを再開するためのセッションID。対応モデル: haiku, sonnet, opus, gemini-2.5-pro, gemini-2.5-flash, gemini-3-pro-preview, gemini-3-flash-preview。
|
|
142
|
+
|
|
143
|
+
### `wait`
|
|
144
|
+
|
|
145
|
+
複数のAIエージェントプロセスの完了を待機し、結果をまとめて返します。指定されたすべてのPIDが終了するか、タイムアウトになるまでブロックします。
|
|
146
|
+
|
|
147
|
+
**引数:**
|
|
148
|
+
- `pids` (array of numbers, 必須): 待機するプロセスIDのリスト(`run` ツールから返されたもの)。
|
|
149
|
+
- `timeout` (number, 任意): 最大待機時間(秒)。デフォルトは180秒(3分)です。
|
|
150
|
+
|
|
151
|
+
### `list_processes`
|
|
152
|
+
|
|
153
|
+
実行中および完了したすべてのAIエージェントプロセスを、ステータス、PID、基本情報とともにリストアップします。
|
|
154
|
+
|
|
155
|
+
### `get_result`
|
|
156
|
+
|
|
157
|
+
PIDを指定して、AIエージェントプロセスの現在の出力とステータスを取得します。
|
|
158
|
+
|
|
159
|
+
**引数:**
|
|
160
|
+
- `pid` (number, 必須): `run` ツールによって返されたプロセスID。
|
|
161
|
+
|
|
162
|
+
### `kill_process`
|
|
163
|
+
|
|
164
|
+
PIDを指定して、実行中のAIエージェントプロセスを終了します。
|
|
165
|
+
|
|
166
|
+
**引数:**
|
|
167
|
+
- `pid` (number, 必須): 終了させるプロセスID。
|
|
168
|
+
|
|
169
|
+
## トラブルシューティング
|
|
170
|
+
|
|
171
|
+
- **"Command not found" (claude-code-mcp):** グローバルにインストールした場合、npmのグローバルbinディレクトリがシステムのPATHに含まれているか確認してください。`npx` を使用している場合、`npx` 自体が機能しているか確認してください。
|
|
172
|
+
- **"Command not found" (claude または ~/.claude/local/claude):** Claude CLIが正しくインストールされていることを確認してください。`claude/doctor` を実行するか、公式ドキュメントを確認してください。
|
|
173
|
+
- **権限の問題:** 「重要な初回セットアップ」の手順を実行したか確認してください。
|
|
174
|
+
- **サーバーからのJSONエラー:** `MCP_CLAUDE_DEBUG` が `true` の場合、エラーメッセージやログがMCPのJSON解析を妨げる可能性があります。通常動作時は `false` に設定してください。
|
|
175
|
+
|
|
176
|
+
## 開発者向け: ローカルセットアップと貢献
|
|
177
|
+
|
|
178
|
+
このサーバーを開発・貢献したい場合、またはクローンしたリポジトリから実行してテストしたい場合は、[Local Installation & Development Setup Guide](./docs/local_install.md) を参照してください。
|
|
179
|
+
|
|
180
|
+
## テスト
|
|
181
|
+
|
|
182
|
+
プロジェクトには包括的なテストスイートが含まれています:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# 全テストの実行
|
|
186
|
+
npm test
|
|
187
|
+
|
|
188
|
+
# ユニットテストのみ実行
|
|
189
|
+
npm run test:unit
|
|
190
|
+
|
|
191
|
+
# E2Eテストの実行(モック使用)
|
|
192
|
+
npm run test:e2e
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## 高度な設定(オプション)
|
|
196
|
+
|
|
197
|
+
通常の利用では設定不要ですが、CLIツールのパスをカスタマイズしたい場合やデバッグが必要な場合に使用できる環境変数です。
|
|
198
|
+
|
|
199
|
+
- `CLAUDE_CLI_NAME`: Claude CLIのバイナリ名または絶対パスを上書き(デフォルト: `claude`)
|
|
200
|
+
- `CODEX_CLI_NAME`: Codex CLIのバイナリ名または絶対パスを上書き(デフォルト: `codex`)
|
|
201
|
+
- `GEMINI_CLI_NAME`: Gemini CLIのバイナリ名または絶対パスを上書き(デフォルト: `gemini`)
|
|
202
|
+
- `MCP_CLAUDE_DEBUG`: デバッグログを有効化(`true` に設定すると詳細な出力が表示されます)
|
|
203
|
+
|
|
204
|
+
**CLI名の指定方法:**
|
|
205
|
+
- コマンド名のみ: `CLAUDE_CLI_NAME=claude-custom`
|
|
206
|
+
- 絶対パス: `CLAUDE_CLI_NAME=/path/to/custom/claude`
|
|
207
|
+
※ 相対パスは使用できません。
|
|
208
|
+
|
|
209
|
+
### カスタムCLIバイナリを使用する場合の設定例:
|
|
210
|
+
|
|
211
|
+
```json
|
|
212
|
+
"ai-cli-mcp": {
|
|
213
|
+
"command": "npx",
|
|
214
|
+
"args": [
|
|
215
|
+
"-y",
|
|
216
|
+
"ai-cli-mcp@latest"
|
|
217
|
+
],
|
|
218
|
+
"env": {
|
|
219
|
+
"CLAUDE_CLI_NAME": "claude-custom",
|
|
220
|
+
"CODEX_CLI_NAME": "codex-custom"
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## ライセンス
|
|
226
|
+
|
|
227
|
+
MIT
|
package/README.md
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/ai-cli-mcp)
|
|
4
4
|
[](/CHANGELOG.md)
|
|
5
5
|
|
|
6
|
+
[🇯🇵 日本語のREADMEはこちら](./README.ja.md)
|
|
7
|
+
|
|
6
8
|
> **📦 Package Migration Notice**: This package was formerly `@mkxultra/claude-code-mcp` and has been renamed to `ai-cli-mcp` to reflect its expanded support for multiple AI CLI tools.
|
|
7
9
|
|
|
8
10
|
An MCP (Model Context Protocol) server that allows running AI CLI tools (Claude, Codex, and Gemini) in background processes with automatic permission handling.
|
|
@@ -18,39 +20,45 @@ This MCP server provides tools that can be used by LLMs to interact with AI CLI
|
|
|
18
20
|
- Run Claude CLI with all permissions bypassed (using `--dangerously-skip-permissions`)
|
|
19
21
|
- Execute Codex CLI with automatic approval mode (using `--full-auto`)
|
|
20
22
|
- Execute Gemini CLI with automatic approval mode (using `-y`)
|
|
21
|
-
- Support multiple AI models: Claude (sonnet, opus, haiku), Codex (gpt-5.2-codex, gpt-5.1-codex-mini, gpt-5.1-codex-max, gpt-5.2, gpt-5.1, gpt-5.1-codex, gpt-5-codex, gpt-5-codex-mini, gpt-5), and Gemini (gemini-2.5-pro, gemini-2.5-flash, gemini-3-pro-preview)
|
|
23
|
+
- Support multiple AI models: Claude (sonnet, opus, haiku), Codex (gpt-5.2-codex, gpt-5.1-codex-mini, gpt-5.1-codex-max, gpt-5.2, gpt-5.1, gpt-5.1-codex, gpt-5-codex, gpt-5-codex-mini, gpt-5), and Gemini (gemini-2.5-pro, gemini-2.5-flash, gemini-3-pro-preview, gemini-3-flash-preview)
|
|
22
24
|
- Manage background processes with PID tracking
|
|
23
25
|
- Parse and return structured outputs from both tools
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
### Usage Example (Advanced Parallel Processing)
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
- Multiple commands can be queued instead of direct execution. This saves context space so more important stuff is retained longer, fewer compacts happen.
|
|
29
|
-
- File ops, git, or other operations don't need costy models. Claude Code is pretty cost effective if you sign up for Antropic Max. You can use Gemini or o3 in Max mode and save costs with offloading tasks to cheaper models.
|
|
30
|
-
- Claude has wider system access and can do things that Cursor/Windsurf can't do (or believe they can't), so whenever they are stuck just ask them "use claude code" and it will usually un-stuck them.
|
|
31
|
-
- Agents in Agents rules.
|
|
29
|
+
You can instruct your main agent to run multiple tasks in parallel like this:
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
> Launch agents for the following 3 tasks using acm mcp run:
|
|
32
|
+
> 1. Refactor `src/backend` code using `sonnet`
|
|
33
|
+
> 2. Create unit tests for `src/frontend` using `gpt-5.2-codex`
|
|
34
|
+
> 3. Update docs in `docs/` using `gemini-2.5-pro`
|
|
35
|
+
>
|
|
36
|
+
> While they run, please update the TODO list. Once done, use the `wait` tool to wait for all completions and report the results together.
|
|
34
37
|
|
|
35
|
-
|
|
36
|
-
- Claude CLI installed locally (run it and call /doctor) and `--dangerously-skip-permissions` accepted
|
|
37
|
-
- Codex CLI installed (optional, for Codex support)
|
|
38
|
-
- Gemini CLI installed (optional, for Gemini support)
|
|
38
|
+
### Usage Example (Context Caching & Sharing)
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
You can reuse heavy context (like large codebases) using session IDs to save costs while running multiple tasks.
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
> 1. First, use `acm mcp run` with `opus` to read all files in `src/` and understand the project structure.
|
|
43
|
+
> 2. Use the `wait` tool to wait for completion and retrieve the `session_id` from the result.
|
|
44
|
+
> 3. Using that `session_id`, run the following two tasks in parallel with `acm mcp run`:
|
|
45
|
+
> - Create refactoring proposals for `src/utils` using `sonnet`
|
|
46
|
+
> - Add architecture documentation to `README.md` using `gpt-5.2-codex`
|
|
47
|
+
> 4. Finally, `wait` again to combine both results.
|
|
43
48
|
|
|
44
|
-
|
|
45
|
-
- `CODEX_CLI_NAME`: Override the Codex CLI binary name or provide an absolute path (default: `codex`)
|
|
46
|
-
- `GEMINI_CLI_NAME`: Override the Gemini CLI binary name or provide an absolute path (default: `gemini`)
|
|
47
|
-
- `MCP_CLAUDE_DEBUG`: Enable debug logging (set to `true` for verbose output)
|
|
49
|
+
## Benefits
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
51
|
+
- **True Async Multitasking**: Agent execution happens in the background, returning control immediately. The calling AI can proceed with the next task or invoke another agent without waiting for completion.
|
|
52
|
+
- **CLI in CLI (Agent in Agent)**: Directly invoke powerful CLI tools like Claude Code or Codex from any MCP-supported IDE or CLI. This enables broader, more complex system operations and automation beyond host environment limitations.
|
|
53
|
+
- **Freedom from Model/Provider Constraints**: Freely select and combine the "strongest" or "most cost-effective" models from Claude, Codex (GPT), and Gemini without being tied to a specific ecosystem.
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
## Prerequisites
|
|
56
|
+
|
|
57
|
+
The only prerequisite is that the AI CLI tools you want to use are locally installed and correctly configured.
|
|
58
|
+
|
|
59
|
+
- **Claude Code**: `claude doctor` passes, and execution with `--dangerously-skip-permissions` is approved (you must run it manually once to login and accept terms).
|
|
60
|
+
- **Codex CLI** (Optional): Installed and initial setup (login etc.) completed.
|
|
61
|
+
- **Gemini CLI** (Optional): Installed and initial setup (login etc.) completed.
|
|
54
62
|
|
|
55
63
|
## Installation & Usage
|
|
56
64
|
|
|
@@ -74,22 +82,6 @@ The recommended way to use this server is by installing it by using `npx`.
|
|
|
74
82
|
claude mcp add ai-cli '{"name":"ai-cli","command":"npx","args":["-y","ai-cli-mcp@latest"]}'
|
|
75
83
|
```
|
|
76
84
|
|
|
77
|
-
### With custom CLI binaries:
|
|
78
|
-
|
|
79
|
-
```json
|
|
80
|
-
"ai-cli-mcp": {
|
|
81
|
-
"command": "npx",
|
|
82
|
-
"args": [
|
|
83
|
-
"-y",
|
|
84
|
-
"ai-cli-mcp@latest"
|
|
85
|
-
],
|
|
86
|
-
"env": {
|
|
87
|
-
"CLAUDE_CLI_NAME": "claude-custom",
|
|
88
|
-
"CODEX_CLI_NAME": "codex-custom"
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
```
|
|
92
|
-
|
|
93
85
|
## Important First-Time Setup
|
|
94
86
|
|
|
95
87
|
### For Claude CLI:
|
|
@@ -123,29 +115,9 @@ macOS might ask for folder permissions the first time any of these tools run. If
|
|
|
123
115
|
|
|
124
116
|
## Connecting to Your MCP Client
|
|
125
117
|
|
|
126
|
-
After setting up the server,
|
|
118
|
+
After setting up the server, add the configuration to your MCP client's settings file (e.g., `mcp.json` for Cursor, `mcp_config.json` for Windsurf).
|
|
127
119
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
The configuration is typically done in a JSON file. The name and location can vary depending on your client.
|
|
131
|
-
|
|
132
|
-
#### Cursor
|
|
133
|
-
|
|
134
|
-
Cursor uses `mcp.json`.
|
|
135
|
-
- **macOS:** `~/.cursor/mcp.json`
|
|
136
|
-
- **Windows:** `%APPDATA%\\Cursor\\mcp.json`
|
|
137
|
-
- **Linux:** `~/.config/cursor/mcp.json`
|
|
138
|
-
|
|
139
|
-
#### Windsurf
|
|
140
|
-
|
|
141
|
-
Windsurf users use `mcp_config.json`
|
|
142
|
-
- **macOS:** `~/.codeium/windsurf/mcp_config.json`
|
|
143
|
-
- **Windows:** `%APPDATA%\\Codeium\\windsurf\\mcp_config.json`
|
|
144
|
-
- **Linux:** `~/.config/.codeium/windsurf/mcp_config.json`
|
|
145
|
-
|
|
146
|
-
(Note: In some mixed setups, if Cursor is also installed, these clients might fall back to using Cursor's `~/.cursor/mcp.json` path. Prioritize the Codeium-specific paths if using the Codeium extension.)
|
|
147
|
-
|
|
148
|
-
Create this file if it doesn't exist. Add or update the configuration for `ai-cli-mcp`:
|
|
120
|
+
If the file doesn't exist, create it and add the `ai-cli-mcp` configuration.
|
|
149
121
|
|
|
150
122
|
## Tools Provided
|
|
151
123
|
|
|
@@ -159,12 +131,21 @@ Executes a prompt using Claude CLI, Codex CLI, or Gemini CLI. The appropriate CL
|
|
|
159
131
|
- `prompt` (string, optional): The prompt to send to the AI agent. Either `prompt` or `prompt_file` is required.
|
|
160
132
|
- `prompt_file` (string, optional): Path to a file containing the prompt. Either `prompt` or `prompt_file` is required. Can be absolute path or relative to `workFolder`.
|
|
161
133
|
- `workFolder` (string, required): The working directory for the CLI execution. Must be an absolute path.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
134
|
+
**Models:**
|
|
135
|
+
- **Ultra Aliases:** `claude-ultra`, `codex-ultra` (defaults to high-reasoning), `gemini-ultra`
|
|
136
|
+
- Claude: `sonnet`, `opus`, `haiku`
|
|
137
|
+
- Codex: `gpt-5.2-codex`, `gpt-5.1-codex-mini`, `gpt-5.1-codex-max`, `gpt-5.2`, `gpt-5.1`, `gpt-5`
|
|
138
|
+
- Gemini: `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-3-pro-preview`, `gemini-3-flash-preview`
|
|
166
139
|
- `reasoning_effort` (string, optional): Codex only. Sets `model_reasoning_effort` (allowed: "low", "medium", "high").
|
|
167
|
-
- `session_id` (string, optional): Optional session ID to resume a previous session. Supported for: haiku, sonnet, opus, gemini-2.5-pro, gemini-2.5-flash, gemini-3-pro-preview.
|
|
140
|
+
- `session_id` (string, optional): Optional session ID to resume a previous session. Supported for: haiku, sonnet, opus, gemini-2.5-pro, gemini-2.5-flash, gemini-3-pro-preview, gemini-3-flash-preview.
|
|
141
|
+
|
|
142
|
+
### `wait`
|
|
143
|
+
|
|
144
|
+
Waits for multiple AI agent processes to complete and returns their combined results. Blocks until all specified PIDs finish or a timeout occurs.
|
|
145
|
+
|
|
146
|
+
**Arguments:**
|
|
147
|
+
- `pids` (array of numbers, required): List of process IDs to wait for (returned by the `run` tool).
|
|
148
|
+
- `timeout` (number, optional): Maximum wait time in seconds. Defaults to 180 (3 minutes).
|
|
168
149
|
|
|
169
150
|
### `list_processes`
|
|
170
151
|
|
|
@@ -184,43 +165,6 @@ Terminates a running AI agent process by PID.
|
|
|
184
165
|
**Arguments:**
|
|
185
166
|
- `pid` (number, required): The process ID to terminate.
|
|
186
167
|
|
|
187
|
-
**Example with Claude:**
|
|
188
|
-
```json
|
|
189
|
-
{
|
|
190
|
-
"toolName": "run",
|
|
191
|
-
"arguments": {
|
|
192
|
-
"prompt": "Refactor the function foo in main.py to be async.",
|
|
193
|
-
"workFolder": "/Users/username/my_project",
|
|
194
|
-
"model": "sonnet"
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
**Example with Codex:**
|
|
200
|
-
```json
|
|
201
|
-
{
|
|
202
|
-
"toolName": "run",
|
|
203
|
-
"arguments": {
|
|
204
|
-
"prompt": "Create a REST API with Express.js",
|
|
205
|
-
"workFolder": "/Users/username/my_project",
|
|
206
|
-
"model": "gpt-5.2-codex",
|
|
207
|
-
"reasoning_effort": "high"
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
**Example with Gemini:**
|
|
213
|
-
```json
|
|
214
|
-
{
|
|
215
|
-
"toolName": "run",
|
|
216
|
-
"arguments": {
|
|
217
|
-
"prompt": "Generate unit tests for the Calculator class",
|
|
218
|
-
"workFolder": "/Users/username/my_project",
|
|
219
|
-
"model": "gemini-2.5-pro"
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
```
|
|
223
|
-
|
|
224
168
|
### Examples
|
|
225
169
|
|
|
226
170
|
Here are some visual examples of the server in action:
|
|
@@ -348,7 +292,7 @@ This will open a web interface where you can:
|
|
|
348
292
|
3. Test different AI models including:
|
|
349
293
|
- Claude models: `sonnet`, `opus`, `haiku`
|
|
350
294
|
- Codex models: `gpt-5.2-codex`, `gpt-5.1-codex-mini`, `gpt-5.1-codex-max`, `gpt-5.2`, `gpt-5.1`, `gpt-5.1-codex`, `gpt-5-codex`, `gpt-5-codex-mini`, `gpt-5`
|
|
351
|
-
- Gemini models: `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-3-pro-preview`
|
|
295
|
+
- Gemini models: `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-3-pro-preview`, `gemini-3-flash-preview`
|
|
352
296
|
|
|
353
297
|
Example test: Select the `run` tool and provide:
|
|
354
298
|
- `prompt`: "What is 2+2?"
|
|
@@ -371,6 +315,36 @@ Contributions are welcome! Please refer to the [Local Installation & Development
|
|
|
371
315
|
|
|
372
316
|
Submit issues and pull requests to the [GitHub repository](https://github.com/mkXultra/claude-code-mcp).
|
|
373
317
|
|
|
318
|
+
## Advanced Configuration (Optional)
|
|
319
|
+
|
|
320
|
+
Normally not required, but useful for customizing CLI paths or debugging.
|
|
321
|
+
|
|
322
|
+
- `CLAUDE_CLI_NAME`: Override the Claude CLI binary name or provide an absolute path (default: `claude`)
|
|
323
|
+
- `CODEX_CLI_NAME`: Override the Codex CLI binary name or provide an absolute path (default: `codex`)
|
|
324
|
+
- `GEMINI_CLI_NAME`: Override the Gemini CLI binary name or provide an absolute path (default: `gemini`)
|
|
325
|
+
- `MCP_CLAUDE_DEBUG`: Enable debug logging (set to `true` for verbose output)
|
|
326
|
+
|
|
327
|
+
**CLI Name Specification:**
|
|
328
|
+
- Command name only: `CLAUDE_CLI_NAME=claude-custom`
|
|
329
|
+
- Absolute path: `CLAUDE_CLI_NAME=/path/to/custom/claude`
|
|
330
|
+
*Relative paths are not supported.*
|
|
331
|
+
|
|
332
|
+
### Example with custom CLI binaries:
|
|
333
|
+
|
|
334
|
+
```json
|
|
335
|
+
"ai-cli-mcp": {
|
|
336
|
+
"command": "npx",
|
|
337
|
+
"args": [
|
|
338
|
+
"-y",
|
|
339
|
+
"ai-cli-mcp@latest"
|
|
340
|
+
],
|
|
341
|
+
"env": {
|
|
342
|
+
"CLAUDE_CLI_NAME": "claude-custom",
|
|
343
|
+
"CODEX_CLI_NAME": "codex-custom"
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
```
|
|
347
|
+
|
|
374
348
|
## License
|
|
375
349
|
|
|
376
350
|
MIT
|
package/dist/server.js
CHANGED
|
@@ -12,7 +12,10 @@ import { parseCodexOutput, parseClaudeOutput, parseGeminiOutput } from './parser
|
|
|
12
12
|
const SERVER_VERSION = "2.2.0";
|
|
13
13
|
// Model alias mappings for user-friendly model names
|
|
14
14
|
const MODEL_ALIASES = {
|
|
15
|
-
'haiku': 'claude-3-5-haiku-20241022'
|
|
15
|
+
'haiku': 'claude-3-5-haiku-20241022',
|
|
16
|
+
'claude-ultra': 'opus',
|
|
17
|
+
'codex-ultra': 'gpt-5.2-codex',
|
|
18
|
+
'gemini-ultra': 'gemini-3-pro-preview'
|
|
16
19
|
};
|
|
17
20
|
const ALLOWED_REASONING_EFFORTS = new Set(['low', 'medium', 'high']);
|
|
18
21
|
function getReasoningEffort(model, rawValue) {
|
|
@@ -266,7 +269,7 @@ export class ClaudeCodeServer {
|
|
|
266
269
|
**IMPORTANT**: This tool now returns immediately with a PID. Use other tools to check status and get results.
|
|
267
270
|
|
|
268
271
|
**Supported models**:
|
|
269
|
-
"sonnet", "opus", "haiku", "gpt-5.2-codex", "gpt-5.1-codex-mini", "gpt-5.1-codex-max", "gpt-5.2", "gpt-5.1", "gpt-5.1-codex", "gpt-5-codex", "gpt-5-codex-mini", "gpt-5", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-3-pro-preview"
|
|
272
|
+
"claude-ultra", "codex-ultra", "gemini-ultra", "sonnet", "opus", "haiku", "gpt-5.2-codex", "gpt-5.1-codex-mini", "gpt-5.1-codex-max", "gpt-5.2", "gpt-5.1", "gpt-5.1-codex", "gpt-5-codex", "gpt-5-codex-mini", "gpt-5", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-3-pro-preview", "gemini-3-flash-preview"
|
|
270
273
|
|
|
271
274
|
**Prompt input**: You must provide EITHER prompt (string) OR prompt_file (file path), but not both.
|
|
272
275
|
|
|
@@ -294,7 +297,7 @@ export class ClaudeCodeServer {
|
|
|
294
297
|
},
|
|
295
298
|
model: {
|
|
296
299
|
type: 'string',
|
|
297
|
-
description: 'The model to use: "
|
|
300
|
+
description: 'The model to use. Aliases: "claude-ultra", "codex-ultra" (auto high-reasoning), "gemini-ultra". Standard: "sonnet", "opus", "haiku", "gpt-5.2-codex", "gpt-5.1-codex-mini", "gpt-5.1", "gemini-2.5-pro", "gemini-3-pro-preview", "gemini-3-flash-preview", etc.',
|
|
298
301
|
},
|
|
299
302
|
reasoning_effort: {
|
|
300
303
|
type: 'string',
|
|
@@ -302,7 +305,7 @@ export class ClaudeCodeServer {
|
|
|
302
305
|
},
|
|
303
306
|
session_id: {
|
|
304
307
|
type: 'string',
|
|
305
|
-
description: 'Optional session ID to resume a previous session. Supported for: haiku, sonnet, opus, gemini-2.5-pro, gemini-2.5-flash, gemini-3-pro-preview.',
|
|
308
|
+
description: 'Optional session ID to resume a previous session. Supported for: haiku, sonnet, opus, gemini-2.5-pro, gemini-2.5-flash, gemini-3-pro-preview, gemini-3-flash-preview.',
|
|
306
309
|
},
|
|
307
310
|
},
|
|
308
311
|
required: ['workFolder'],
|
|
@@ -446,13 +449,19 @@ export class ClaudeCodeServer {
|
|
|
446
449
|
isFirstToolUse = false;
|
|
447
450
|
}
|
|
448
451
|
// Determine which agent to use based on model name
|
|
449
|
-
const
|
|
450
|
-
const
|
|
452
|
+
const rawModel = toolArguments.model || '';
|
|
453
|
+
const resolvedModel = resolveModelAlias(rawModel);
|
|
454
|
+
// Special handling for codex-ultra: default to high reasoning effort if not specified
|
|
455
|
+
let reasoningEffortArg = toolArguments.reasoning_effort;
|
|
456
|
+
if (rawModel === 'codex-ultra' && !reasoningEffortArg) {
|
|
457
|
+
reasoningEffortArg = 'high';
|
|
458
|
+
}
|
|
459
|
+
const reasoningEffort = getReasoningEffort(resolvedModel, reasoningEffortArg);
|
|
451
460
|
let agent;
|
|
452
|
-
if (
|
|
461
|
+
if (resolvedModel.startsWith('gpt-')) {
|
|
453
462
|
agent = 'codex';
|
|
454
463
|
}
|
|
455
|
-
else if (
|
|
464
|
+
else if (resolvedModel.startsWith('gemini')) {
|
|
456
465
|
agent = 'gemini';
|
|
457
466
|
}
|
|
458
467
|
else {
|
|
@@ -474,8 +483,8 @@ export class ClaudeCodeServer {
|
|
|
474
483
|
if (reasoningEffort) {
|
|
475
484
|
processArgs.push('-c', `model_reasoning_effort=${reasoningEffort}`);
|
|
476
485
|
}
|
|
477
|
-
if (
|
|
478
|
-
processArgs.push('--model',
|
|
486
|
+
if (resolvedModel) {
|
|
487
|
+
processArgs.push('--model', resolvedModel);
|
|
479
488
|
}
|
|
480
489
|
processArgs.push('--full-auto', '--json', prompt);
|
|
481
490
|
}
|
|
@@ -488,8 +497,8 @@ export class ClaudeCodeServer {
|
|
|
488
497
|
processArgs.push('-r', toolArguments.session_id);
|
|
489
498
|
}
|
|
490
499
|
// Add model if specified
|
|
491
|
-
if (
|
|
492
|
-
processArgs.push('--model',
|
|
500
|
+
if (resolvedModel) {
|
|
501
|
+
processArgs.push('--model', resolvedModel);
|
|
493
502
|
}
|
|
494
503
|
// Add prompt as positional argument
|
|
495
504
|
processArgs.push(prompt);
|
|
@@ -503,8 +512,7 @@ export class ClaudeCodeServer {
|
|
|
503
512
|
processArgs.push('-r', toolArguments.session_id);
|
|
504
513
|
}
|
|
505
514
|
processArgs.push('-p', prompt);
|
|
506
|
-
if (
|
|
507
|
-
const resolvedModel = resolveModelAlias(toolArguments.model);
|
|
515
|
+
if (resolvedModel) {
|
|
508
516
|
processArgs.push('--model', resolvedModel);
|
|
509
517
|
}
|
|
510
518
|
}
|
|
@@ -38,26 +38,28 @@ BREAKING CHANGE: response structure has changed"
|
|
|
38
38
|
|
|
39
39
|
## Pre-Merge Checklist
|
|
40
40
|
|
|
41
|
-
Before merging to `
|
|
41
|
+
Before merging to `develop`:
|
|
42
42
|
|
|
43
43
|
- [ ] Tests pass locally (`npm test`)
|
|
44
44
|
- [ ] Build succeeds (`npm run build`)
|
|
45
45
|
- [ ] Commit messages follow Conventional Commits format
|
|
46
46
|
- [ ] PR has been reviewed (if applicable)
|
|
47
47
|
|
|
48
|
-
##
|
|
48
|
+
## Important: Git Tags
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
semantic-release uses git tags to determine the current version. **Tags must exist on the `develop` branch.**
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
If releases fail with version errors:
|
|
53
|
+
|
|
54
|
+
1. Check existing tags: `git tag -l 'v*'`
|
|
55
|
+
2. Ensure the latest version tag exists on `develop`
|
|
56
|
+
3. If missing, create it: `git tag vX.X.X && git push origin vX.X.X`
|
|
56
57
|
|
|
57
58
|
## npm Trusted Publishing Setup
|
|
58
59
|
|
|
59
|
-
This project uses OIDC trusted publishing
|
|
60
|
+
This project uses OIDC trusted publishing (no npm token required).
|
|
60
61
|
|
|
62
|
+
Configuration on npmjs.com:
|
|
61
63
|
- Organization/user: `mkXultra`
|
|
62
64
|
- Repository: `claude-code-mcp`
|
|
63
65
|
- Workflow filename: `publish.yml`
|
package/package.json
CHANGED
package/src/server.ts
CHANGED
|
@@ -20,7 +20,10 @@ const SERVER_VERSION = "2.2.0";
|
|
|
20
20
|
|
|
21
21
|
// Model alias mappings for user-friendly model names
|
|
22
22
|
const MODEL_ALIASES: Record<string, string> = {
|
|
23
|
-
'haiku': 'claude-3-5-haiku-20241022'
|
|
23
|
+
'haiku': 'claude-3-5-haiku-20241022',
|
|
24
|
+
'claude-ultra': 'opus',
|
|
25
|
+
'codex-ultra': 'gpt-5.2-codex',
|
|
26
|
+
'gemini-ultra': 'gemini-3-pro-preview'
|
|
24
27
|
};
|
|
25
28
|
|
|
26
29
|
const ALLOWED_REASONING_EFFORTS = new Set(['low', 'medium', 'high']);
|
|
@@ -366,7 +369,7 @@ export class ClaudeCodeServer {
|
|
|
366
369
|
**IMPORTANT**: This tool now returns immediately with a PID. Use other tools to check status and get results.
|
|
367
370
|
|
|
368
371
|
**Supported models**:
|
|
369
|
-
"sonnet", "opus", "haiku", "gpt-5.2-codex", "gpt-5.1-codex-mini", "gpt-5.1-codex-max", "gpt-5.2", "gpt-5.1", "gpt-5.1-codex", "gpt-5-codex", "gpt-5-codex-mini", "gpt-5", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-3-pro-preview"
|
|
372
|
+
"claude-ultra", "codex-ultra", "gemini-ultra", "sonnet", "opus", "haiku", "gpt-5.2-codex", "gpt-5.1-codex-mini", "gpt-5.1-codex-max", "gpt-5.2", "gpt-5.1", "gpt-5.1-codex", "gpt-5-codex", "gpt-5-codex-mini", "gpt-5", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-3-pro-preview", "gemini-3-flash-preview"
|
|
370
373
|
|
|
371
374
|
**Prompt input**: You must provide EITHER prompt (string) OR prompt_file (file path), but not both.
|
|
372
375
|
|
|
@@ -394,7 +397,7 @@ export class ClaudeCodeServer {
|
|
|
394
397
|
},
|
|
395
398
|
model: {
|
|
396
399
|
type: 'string',
|
|
397
|
-
description: 'The model to use: "
|
|
400
|
+
description: 'The model to use. Aliases: "claude-ultra", "codex-ultra" (auto high-reasoning), "gemini-ultra". Standard: "sonnet", "opus", "haiku", "gpt-5.2-codex", "gpt-5.1-codex-mini", "gpt-5.1", "gemini-2.5-pro", "gemini-3-pro-preview", "gemini-3-flash-preview", etc.',
|
|
398
401
|
},
|
|
399
402
|
reasoning_effort: {
|
|
400
403
|
type: 'string',
|
|
@@ -402,7 +405,7 @@ export class ClaudeCodeServer {
|
|
|
402
405
|
},
|
|
403
406
|
session_id: {
|
|
404
407
|
type: 'string',
|
|
405
|
-
description: 'Optional session ID to resume a previous session. Supported for: haiku, sonnet, opus, gemini-2.5-pro, gemini-2.5-flash, gemini-3-pro-preview.',
|
|
408
|
+
description: 'Optional session ID to resume a previous session. Supported for: haiku, sonnet, opus, gemini-2.5-pro, gemini-2.5-flash, gemini-3-pro-preview, gemini-3-flash-preview.',
|
|
406
409
|
},
|
|
407
410
|
},
|
|
408
411
|
required: ['workFolder'],
|
|
@@ -558,13 +561,21 @@ export class ClaudeCodeServer {
|
|
|
558
561
|
}
|
|
559
562
|
|
|
560
563
|
// Determine which agent to use based on model name
|
|
561
|
-
const
|
|
562
|
-
const
|
|
564
|
+
const rawModel = toolArguments.model || '';
|
|
565
|
+
const resolvedModel = resolveModelAlias(rawModel);
|
|
566
|
+
|
|
567
|
+
// Special handling for codex-ultra: default to high reasoning effort if not specified
|
|
568
|
+
let reasoningEffortArg = toolArguments.reasoning_effort;
|
|
569
|
+
if (rawModel === 'codex-ultra' && !reasoningEffortArg) {
|
|
570
|
+
reasoningEffortArg = 'high';
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
const reasoningEffort = getReasoningEffort(resolvedModel, reasoningEffortArg);
|
|
563
574
|
let agent: 'codex' | 'claude' | 'gemini';
|
|
564
575
|
|
|
565
|
-
if (
|
|
576
|
+
if (resolvedModel.startsWith('gpt-')) {
|
|
566
577
|
agent = 'codex';
|
|
567
|
-
} else if (
|
|
578
|
+
} else if (resolvedModel.startsWith('gemini')) {
|
|
568
579
|
agent = 'gemini';
|
|
569
580
|
} else {
|
|
570
581
|
agent = 'claude';
|
|
@@ -588,8 +599,8 @@ export class ClaudeCodeServer {
|
|
|
588
599
|
if (reasoningEffort) {
|
|
589
600
|
processArgs.push('-c', `model_reasoning_effort=${reasoningEffort}`);
|
|
590
601
|
}
|
|
591
|
-
if (
|
|
592
|
-
processArgs.push('--model',
|
|
602
|
+
if (resolvedModel) {
|
|
603
|
+
processArgs.push('--model', resolvedModel);
|
|
593
604
|
}
|
|
594
605
|
|
|
595
606
|
processArgs.push('--full-auto', '--json', prompt);
|
|
@@ -605,8 +616,8 @@ export class ClaudeCodeServer {
|
|
|
605
616
|
}
|
|
606
617
|
|
|
607
618
|
// Add model if specified
|
|
608
|
-
if (
|
|
609
|
-
processArgs.push('--model',
|
|
619
|
+
if (resolvedModel) {
|
|
620
|
+
processArgs.push('--model', resolvedModel);
|
|
610
621
|
}
|
|
611
622
|
|
|
612
623
|
// Add prompt as positional argument
|
|
@@ -623,8 +634,7 @@ export class ClaudeCodeServer {
|
|
|
623
634
|
}
|
|
624
635
|
|
|
625
636
|
processArgs.push('-p', prompt);
|
|
626
|
-
if (
|
|
627
|
-
const resolvedModel = resolveModelAlias(toolArguments.model);
|
|
637
|
+
if (resolvedModel) {
|
|
628
638
|
processArgs.push('--model', resolvedModel);
|
|
629
639
|
}
|
|
630
640
|
}
|
package/docs/local_install.md
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
# Local Installation & Development Setup
|
|
2
|
-
|
|
3
|
-
This guide is for developers who want to contribute to this server, run it directly from a cloned repository, or use `npm link` for local testing.
|
|
4
|
-
|
|
5
|
-
For general users, the recommended methods (global NPM install or `npx`) are covered in the main [README.md](../README.md).
|
|
6
|
-
|
|
7
|
-
## Option 1: Running Directly from a Cloned Repository (using `start.sh`)
|
|
8
|
-
|
|
9
|
-
This method is suitable if you prefer not to install the server globally or want to manage it directly within a specific path for development or testing.
|
|
10
|
-
|
|
11
|
-
1. **Clone the repository:**
|
|
12
|
-
```bash
|
|
13
|
-
git clone https://github.com/steipete/claude-code-mcp.git # Or your fork/actual repo URL
|
|
14
|
-
cd claude-code-mcp
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
2. **Install dependencies:**
|
|
18
|
-
This will also install `tsx` for direct TypeScript execution via `start.sh`.
|
|
19
|
-
```bash
|
|
20
|
-
npm install
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
3. **Make the start script executable:**
|
|
24
|
-
```bash
|
|
25
|
-
chmod +x start.sh
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
4. **Configure MCP Client for `start.sh`:**
|
|
29
|
-
Update your `mcp.json` file (e.g., `~/.codeium/windsurf/mcp_config.json` or `~/.cursor/mcp.json`) to point to the `start.sh` script:
|
|
30
|
-
```json
|
|
31
|
-
{
|
|
32
|
-
"mcpServers": {
|
|
33
|
-
"claude_code": {
|
|
34
|
-
"type": "stdio",
|
|
35
|
-
"command": ["/absolute/path/to/claude-mcp-server/start.sh"],
|
|
36
|
-
"args": []
|
|
37
|
-
}
|
|
38
|
-
// ... other MCP server configurations
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
```
|
|
42
|
-
**Important:** Replace `/absolute/path/to/claude-mcp-server` with the actual absolute path to where you cloned the server.
|
|
43
|
-
|
|
44
|
-
5. **First-Time Claude CLI Permissions:**
|
|
45
|
-
As mentioned in the main README, ensure you've run the Claude CLI once with `--dangerously-skip-permissions` to accept terms:
|
|
46
|
-
```bash
|
|
47
|
-
claude -p "hello" --dangerously-skip-permissions
|
|
48
|
-
# Or ~/.claude/local/claude -p "hello" --dangerously-skip-permissions
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
6. **Environment Variables for `start.sh` (Optional):**
|
|
52
|
-
You can customize the server behavior by setting environment variables before running `start.sh` or by editing the `start.sh` script itself:
|
|
53
|
-
- `CLAUDE_CLI_PATH`: Set a custom absolute path to the Claude CLI executable.
|
|
54
|
-
- `MCP_CLAUDE_DEBUG`: Set to `true` to enable verbose debug logging from the MCP server.
|
|
55
|
-
- `CLAUDE_CLI_TOOLS_DEFAULT`: Comma-separated list of default tools.
|
|
56
|
-
- `CLAUDE_CLI_TOOLS_DANGEROUS`: Comma-separated list of tools to always enable.
|
|
57
|
-
Refer to `start.sh` and the main README's "Configuration via Environment Variables" section for more details.
|
|
58
|
-
|
|
59
|
-
## Option 2: Local Development with `npm link`
|
|
60
|
-
|
|
61
|
-
This method allows you to install the package globally but have it point to your local cloned repository. This is useful for testing the global command (`claude-code-mcp`) with your local changes.
|
|
62
|
-
|
|
63
|
-
1. **Clone the repository (if not already done):**
|
|
64
|
-
```bash
|
|
65
|
-
git clone https://github.com/steipete/claude-code-mcp.git # Or your fork/actual repo URL
|
|
66
|
-
cd claude-code-mcp
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
2. **Install dependencies and build:**
|
|
70
|
-
```bash
|
|
71
|
-
npm install # Install dependencies
|
|
72
|
-
npm run build # Compile TypeScript to the dist/ directory
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
3. **Link the package:**
|
|
76
|
-
This makes `claude-code-mcp` (as defined in `package.json`'s `bin` field) available globally, pointing to your local `dist/server.js`.
|
|
77
|
-
```bash
|
|
78
|
-
npm link
|
|
79
|
-
```
|
|
80
|
-
After linking, running `claude-code-mcp` in your terminal will execute your local build.
|
|
81
|
-
|
|
82
|
-
4. **Configure MCP Client for Linked Command:**
|
|
83
|
-
Update your `mcp.json` file to use the `claude-code-mcp` command (which now points to your local linked version):
|
|
84
|
-
```json
|
|
85
|
-
{
|
|
86
|
-
"mcpServers": {
|
|
87
|
-
"claude_code": {
|
|
88
|
-
"type": "stdio",
|
|
89
|
-
"command": ["claude-code-mcp"],
|
|
90
|
-
"args": [],
|
|
91
|
-
"env": {
|
|
92
|
-
"MCP_CLAUDE_DEBUG": "false" // Or "true" for debugging
|
|
93
|
-
// You can set other ENV VARS here too if needed for the linked command
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
5. **Rebuilding after changes:**
|
|
101
|
-
If you make changes to the TypeScript source (`src/`), you'll need to rebuild for `npm link` to reflect them:
|
|
102
|
-
```bash
|
|
103
|
-
npm run build
|
|
104
|
-
```
|
|
105
|
-
There's no need to run `npm link` again unless `package.json` (especially the `bin` field) changes.
|
|
106
|
-
|
|
107
|
-
## General Development Notes
|
|
108
|
-
|
|
109
|
-
- **TypeScript:** The server is written in TypeScript. Code is in the `src/` directory and compiled to `dist/`.
|
|
110
|
-
- **Prerequisites:** Ensure Node.js v20+ and a working Claude CLI are installed.
|
|
111
|
-
- **Contributing:** Submit issues and pull requests to the main [GitHub repository](https://github.com/steipete/claude-code-mcp).
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Script to check if version print is working correctly
|
|
4
|
-
|
|
5
|
-
LOG_FILE="$HOME/Library/Logs/Claude/mcp-server-claude-code.log"
|
|
6
|
-
|
|
7
|
-
echo "🔍 Checking Claude MCP logs for version print..."
|
|
8
|
-
echo "================================================"
|
|
9
|
-
|
|
10
|
-
# Look for version print in the last 100 lines
|
|
11
|
-
VERSION_LINES=$(tail -100 "$LOG_FILE" | grep "claude_code v")
|
|
12
|
-
|
|
13
|
-
if [ -n "$VERSION_LINES" ]; then
|
|
14
|
-
echo "✅ Found version print:"
|
|
15
|
-
echo "$VERSION_LINES"
|
|
16
|
-
|
|
17
|
-
# Count occurrences
|
|
18
|
-
COUNT=$(echo "$VERSION_LINES" | wc -l)
|
|
19
|
-
echo ""
|
|
20
|
-
echo "📊 Version was printed $COUNT time(s) in recent logs"
|
|
21
|
-
|
|
22
|
-
# Check for errors
|
|
23
|
-
ERROR_LINES=$(tail -100 "$LOG_FILE" | grep -i "error")
|
|
24
|
-
if [ -n "$ERROR_LINES" ]; then
|
|
25
|
-
echo ""
|
|
26
|
-
echo "⚠️ Found errors in recent logs:"
|
|
27
|
-
echo "$ERROR_LINES"
|
|
28
|
-
fi
|
|
29
|
-
else
|
|
30
|
-
echo "❌ No version print found in recent logs"
|
|
31
|
-
echo ""
|
|
32
|
-
echo "Recent log entries:"
|
|
33
|
-
tail -20 "$LOG_FILE"
|
|
34
|
-
fi
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Publish Release Script
|
|
4
|
-
# This script handles the full release process
|
|
5
|
-
|
|
6
|
-
set -e
|
|
7
|
-
|
|
8
|
-
echo "🚀 Publishing MCP Server Release"
|
|
9
|
-
echo "================================"
|
|
10
|
-
|
|
11
|
-
# Ensure we're on main branch
|
|
12
|
-
CURRENT_BRANCH=$(git branch --show-current)
|
|
13
|
-
if [ "$CURRENT_BRANCH" != "main" ]; then
|
|
14
|
-
echo "❌ Error: Must be on main branch to release"
|
|
15
|
-
echo " Current branch: $CURRENT_BRANCH"
|
|
16
|
-
exit 1
|
|
17
|
-
fi
|
|
18
|
-
|
|
19
|
-
# Ensure working directory is clean
|
|
20
|
-
if [ -n "$(git status --porcelain)" ]; then
|
|
21
|
-
echo "❌ Error: Working directory is not clean"
|
|
22
|
-
echo " Please commit or stash your changes"
|
|
23
|
-
exit 1
|
|
24
|
-
fi
|
|
25
|
-
|
|
26
|
-
# Pull latest changes
|
|
27
|
-
echo "📥 Pulling latest changes..."
|
|
28
|
-
git pull
|
|
29
|
-
|
|
30
|
-
# Run tests
|
|
31
|
-
echo "🧪 Running tests..."
|
|
32
|
-
npm test
|
|
33
|
-
|
|
34
|
-
# Build the project
|
|
35
|
-
echo "📦 Building project..."
|
|
36
|
-
npm run build
|
|
37
|
-
|
|
38
|
-
# Get current version
|
|
39
|
-
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
|
40
|
-
echo "📌 Current version: $CURRENT_VERSION"
|
|
41
|
-
|
|
42
|
-
# Ask for new version
|
|
43
|
-
echo ""
|
|
44
|
-
echo "🔢 What type of release is this?"
|
|
45
|
-
echo "1) Patch (bug fixes)"
|
|
46
|
-
echo "2) Minor (new features)"
|
|
47
|
-
echo "3) Major (breaking changes)"
|
|
48
|
-
read -p "Enter choice (1-3): " RELEASE_TYPE
|
|
49
|
-
|
|
50
|
-
case $RELEASE_TYPE in
|
|
51
|
-
1) npm version patch ;;
|
|
52
|
-
2) npm version minor ;;
|
|
53
|
-
3) npm version major ;;
|
|
54
|
-
*) echo "Invalid choice"; exit 1 ;;
|
|
55
|
-
esac
|
|
56
|
-
|
|
57
|
-
# Get new version
|
|
58
|
-
NEW_VERSION=$(node -p "require('./package.json').version")
|
|
59
|
-
|
|
60
|
-
# Update changelog
|
|
61
|
-
echo ""
|
|
62
|
-
echo "📝 Please update CHANGELOG.md with the new version details"
|
|
63
|
-
echo " New version: $NEW_VERSION"
|
|
64
|
-
read -p "Press enter when done..."
|
|
65
|
-
|
|
66
|
-
# Commit version bump
|
|
67
|
-
git add package.json package-lock.json CHANGELOG.md
|
|
68
|
-
git commit -m "Bump version to $NEW_VERSION"
|
|
69
|
-
|
|
70
|
-
# Create git tag
|
|
71
|
-
git tag "v$NEW_VERSION"
|
|
72
|
-
|
|
73
|
-
# Push changes and tags
|
|
74
|
-
echo "⬆️ Pushing changes to GitHub..."
|
|
75
|
-
git push
|
|
76
|
-
git push --tags
|
|
77
|
-
|
|
78
|
-
# Create GitHub release
|
|
79
|
-
echo "📋 Creating GitHub release..."
|
|
80
|
-
gh release create "v$NEW_VERSION" \
|
|
81
|
-
--title "Release v$NEW_VERSION" \
|
|
82
|
-
--notes "See CHANGELOG.md for details" \
|
|
83
|
-
--latest
|
|
84
|
-
|
|
85
|
-
# Publish to npm
|
|
86
|
-
echo "📦 Publishing to npm..."
|
|
87
|
-
npm publish
|
|
88
|
-
|
|
89
|
-
echo ""
|
|
90
|
-
echo "✅ Release v$NEW_VERSION published successfully!"
|
|
91
|
-
echo ""
|
|
92
|
-
echo "📋 Post-release checklist:"
|
|
93
|
-
echo "[ ] Test the new version with: npx @steipete/claude-code-mcp@latest"
|
|
94
|
-
echo "[ ] Update any documentation if needed"
|
|
95
|
-
echo "[ ] Announce the release if significant"
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Restore Original Claude Configuration
|
|
4
|
-
|
|
5
|
-
set -e
|
|
6
|
-
|
|
7
|
-
CONFIG_DIR="$HOME/Library/Application Support/Claude"
|
|
8
|
-
ORIGINAL_CONFIG="$CONFIG_DIR/claude_desktop_config.json"
|
|
9
|
-
BACKUP_CONFIG="$CONFIG_DIR/claude_desktop_config.backup.json"
|
|
10
|
-
|
|
11
|
-
if [ -f "$BACKUP_CONFIG" ]; then
|
|
12
|
-
echo "🔄 Restoring original Claude configuration..."
|
|
13
|
-
cp "$BACKUP_CONFIG" "$ORIGINAL_CONFIG"
|
|
14
|
-
echo "✅ Original configuration restored!"
|
|
15
|
-
echo "♻️ Removing backup file..."
|
|
16
|
-
rm "$BACKUP_CONFIG"
|
|
17
|
-
else
|
|
18
|
-
echo "⚠️ No backup configuration found!"
|
|
19
|
-
fi
|
|
20
|
-
|
|
21
|
-
echo ""
|
|
22
|
-
echo "🔄 Restarting Claude to apply changes..."
|
|
23
|
-
osascript -e 'tell application "Claude" to quit'
|
|
24
|
-
sleep 2
|
|
25
|
-
osascript -e 'tell application "Claude" to activate'
|
|
26
|
-
|
|
27
|
-
echo ""
|
|
28
|
-
echo "✅ Claude has been restarted with original configuration!"
|
package/scripts/test-release.sh
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Test Release Script
|
|
4
|
-
# This script helps test the MCP server locally before publishing
|
|
5
|
-
|
|
6
|
-
set -e
|
|
7
|
-
|
|
8
|
-
echo "🧪 Testing MCP Server Release Process"
|
|
9
|
-
echo "====================================="
|
|
10
|
-
|
|
11
|
-
# Build the project
|
|
12
|
-
echo "📦 Building project..."
|
|
13
|
-
npm run build
|
|
14
|
-
|
|
15
|
-
# Run basic tests
|
|
16
|
-
echo "🧪 Running tests..."
|
|
17
|
-
npm test
|
|
18
|
-
|
|
19
|
-
# Create a backup of the current Claude config
|
|
20
|
-
CONFIG_DIR="$HOME/Library/Application Support/Claude"
|
|
21
|
-
ORIGINAL_CONFIG="$CONFIG_DIR/claude_desktop_config.json"
|
|
22
|
-
BACKUP_CONFIG="$CONFIG_DIR/claude_desktop_config.backup.json"
|
|
23
|
-
TEST_CONFIG="$CONFIG_DIR/claude_desktop_config_local_test.json"
|
|
24
|
-
|
|
25
|
-
echo "💾 Backing up current Claude configuration..."
|
|
26
|
-
cp "$ORIGINAL_CONFIG" "$BACKUP_CONFIG"
|
|
27
|
-
|
|
28
|
-
echo "🔄 Switching to local test configuration..."
|
|
29
|
-
cp "$TEST_CONFIG" "$ORIGINAL_CONFIG"
|
|
30
|
-
|
|
31
|
-
echo "✅ Local test configuration activated!"
|
|
32
|
-
echo ""
|
|
33
|
-
|
|
34
|
-
# Restart Claude using AppleScript
|
|
35
|
-
echo "🔄 Restarting Claude Desktop app..."
|
|
36
|
-
osascript -e 'tell application "Claude" to quit'
|
|
37
|
-
sleep 2
|
|
38
|
-
osascript -e 'tell application "Claude" to activate'
|
|
39
|
-
sleep 5
|
|
40
|
-
|
|
41
|
-
# Monitor the logs
|
|
42
|
-
LOG_FILE="$HOME/Library/Logs/Claude/mcp-server-claude-code.log"
|
|
43
|
-
echo "📊 Monitoring MCP server logs..."
|
|
44
|
-
echo " Waiting for server initialization..."
|
|
45
|
-
echo ""
|
|
46
|
-
|
|
47
|
-
# Clear previous log entries (optional - comment out if you want to keep history)
|
|
48
|
-
# > "$LOG_FILE"
|
|
49
|
-
|
|
50
|
-
# Start monitoring logs in background
|
|
51
|
-
tail -f "$LOG_FILE" | grep -E "(Initializing server|Server started|version|error|Error)" &
|
|
52
|
-
TAIL_PID=$!
|
|
53
|
-
|
|
54
|
-
echo "📋 Next steps:"
|
|
55
|
-
echo "1. Claude has been restarted automatically"
|
|
56
|
-
echo "2. Watch the log output above for any errors"
|
|
57
|
-
echo "3. Test the claude-code-local MCP server in Claude"
|
|
58
|
-
echo "4. Verify the version print feature works"
|
|
59
|
-
echo "5. Press Ctrl+C to stop monitoring logs"
|
|
60
|
-
echo ""
|
|
61
|
-
echo "⚠️ To restore original configuration, run:"
|
|
62
|
-
echo " ./scripts/restore-config.sh"
|
|
63
|
-
echo ""
|
|
64
|
-
echo "📝 Once testing is complete, run:"
|
|
65
|
-
echo " ./scripts/publish-release.sh"
|
|
66
|
-
|
|
67
|
-
# Wait for user to press Ctrl+C
|
|
68
|
-
trap "kill $TAIL_PID 2>/dev/null; exit" INT
|
|
69
|
-
wait
|