@crush-protocol/mcp-client 0.4.22 → 0.4.23
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 +74 -74
- package/dist/config.d.ts +1 -0
- package/dist/config.js +1 -0
- package/dist/mcp/proxy.js +88 -20
- package/dist/onboarding/cliOutput.js +3 -3
- package/dist/setup/setupClients.js +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
Type: MCP SERVER — do NOT use npm install. Use the setup commands below.
|
|
5
5
|
|
|
6
6
|
Install:
|
|
7
|
-
Claude Code: claude mcp add --scope user crush-protocol -- npx -y @crush-protocol/mcp-client
|
|
8
|
-
Cursor: npx -y @crush-protocol/mcp-client setup --cursor
|
|
9
|
-
All hosts: npx -y @crush-protocol/mcp-client setup --all
|
|
7
|
+
Claude Code: claude mcp add --scope user crush-protocol -- npx -y @crush-protocol/mcp-client@latest
|
|
8
|
+
Cursor: npx -y @crush-protocol/mcp-client@latest setup --cursor
|
|
9
|
+
All hosts: npx -y @crush-protocol/mcp-client@latest setup --all
|
|
10
10
|
|
|
11
|
-
Troubleshooting: npx -y @crush-protocol/mcp-client doctor
|
|
11
|
+
Troubleshooting: npx -y @crush-protocol/mcp-client@latest doctor
|
|
12
12
|
-->
|
|
13
13
|
|
|
14
14
|
# Crush Protocol MCP Client
|
|
@@ -23,9 +23,9 @@ Official MCP client for connecting Cursor, Claude Code, Codex, Gemini CLI, Winds
|
|
|
23
23
|
## Quick Start
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
|
-
npx -y @crush-protocol/mcp-client setup --cursor # Cursor
|
|
27
|
-
npx -y @crush-protocol/mcp-client setup --claude # Claude Code
|
|
28
|
-
npx -y @crush-protocol/mcp-client setup --all # all supported hosts
|
|
26
|
+
npx -y @crush-protocol/mcp-client@latest setup --cursor # Cursor
|
|
27
|
+
npx -y @crush-protocol/mcp-client@latest setup --claude # Claude Code
|
|
28
|
+
npx -y @crush-protocol/mcp-client@latest setup --all # all supported hosts
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
First tool call will open browser for OAuth login automatically. No separate `login` step needed.
|
|
@@ -48,13 +48,13 @@ Do NOT run "npm install @crush-protocol/mcp-client" — that installs a library,
|
|
|
48
48
|
|
|
49
49
|
Step 1: Detect which AI host the user is running (Cursor, Claude Code, VS Code, etc.)
|
|
50
50
|
Step 2: Run the matching setup command:
|
|
51
|
-
- Claude Code: claude mcp add --scope user crush-protocol -- npx -y @crush-protocol/mcp-client
|
|
52
|
-
- Cursor: npx -y @crush-protocol/mcp-client setup --cursor
|
|
53
|
-
- VS Code: npx -y @crush-protocol/mcp-client setup --vscode
|
|
54
|
-
- Codex: npx -y @crush-protocol/mcp-client setup --codex
|
|
55
|
-
- All hosts: npx -y @crush-protocol/mcp-client setup --all
|
|
51
|
+
- Claude Code: claude mcp add --scope user crush-protocol -- npx -y @crush-protocol/mcp-client@latest
|
|
52
|
+
- Cursor: npx -y @crush-protocol/mcp-client@latest setup --cursor
|
|
53
|
+
- VS Code: npx -y @crush-protocol/mcp-client@latest setup --vscode
|
|
54
|
+
- Codex: npx -y @crush-protocol/mcp-client@latest setup --codex
|
|
55
|
+
- All hosts: npx -y @crush-protocol/mcp-client@latest setup --all
|
|
56
56
|
Step 3: OAuth login happens automatically on first tool call. No manual login needed.
|
|
57
|
-
Step 4: If tools fail, run: npx -y @crush-protocol/mcp-client doctor
|
|
57
|
+
Step 4: If tools fail, run: npx -y @crush-protocol/mcp-client@latest doctor
|
|
58
58
|
</div>
|
|
59
59
|
|
|
60
60
|
## Install
|
|
@@ -62,21 +62,21 @@ Step 4: If tools fail, run: npx -y @crush-protocol/mcp-client doctor
|
|
|
62
62
|
Recommended:
|
|
63
63
|
|
|
64
64
|
```sh
|
|
65
|
-
npx -y @crush-protocol/mcp-client setup --all
|
|
65
|
+
npx -y @crush-protocol/mcp-client@latest setup --all
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
This writes MCP config for all supported hosts at once. To target a single host:
|
|
69
69
|
|
|
70
70
|
```sh
|
|
71
|
-
npx -y @crush-protocol/mcp-client setup --cursor
|
|
72
|
-
npx -y @crush-protocol/mcp-client setup --claude
|
|
73
|
-
npx -y @crush-protocol/mcp-client setup --codex
|
|
74
|
-
npx -y @crush-protocol/mcp-client setup --gemini
|
|
75
|
-
npx -y @crush-protocol/mcp-client setup --opencode
|
|
76
|
-
npx -y @crush-protocol/mcp-client setup --vscode
|
|
77
|
-
npx -y @crush-protocol/mcp-client setup --windsurf
|
|
78
|
-
npx -y @crush-protocol/mcp-client setup --claude-desktop
|
|
79
|
-
npx -y @crush-protocol/mcp-client setup --warp
|
|
71
|
+
npx -y @crush-protocol/mcp-client@latest setup --cursor
|
|
72
|
+
npx -y @crush-protocol/mcp-client@latest setup --claude
|
|
73
|
+
npx -y @crush-protocol/mcp-client@latest setup --codex
|
|
74
|
+
npx -y @crush-protocol/mcp-client@latest setup --gemini
|
|
75
|
+
npx -y @crush-protocol/mcp-client@latest setup --opencode
|
|
76
|
+
npx -y @crush-protocol/mcp-client@latest setup --vscode
|
|
77
|
+
npx -y @crush-protocol/mcp-client@latest setup --windsurf
|
|
78
|
+
npx -y @crush-protocol/mcp-client@latest setup --claude-desktop
|
|
79
|
+
npx -y @crush-protocol/mcp-client@latest setup --warp
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
Cursor and VS Code also support `--scope project` for repo-local config.
|
|
@@ -89,7 +89,7 @@ Cursor and VS Code also support `--scope project` for repo-local config.
|
|
|
89
89
|
**Auto setup:**
|
|
90
90
|
|
|
91
91
|
```sh
|
|
92
|
-
npx -y @crush-protocol/mcp-client setup --cursor
|
|
92
|
+
npx -y @crush-protocol/mcp-client@latest setup --cursor
|
|
93
93
|
```
|
|
94
94
|
|
|
95
95
|
**Manual config:** Add to `~/.cursor/mcp.json`:
|
|
@@ -101,7 +101,7 @@ npx -y @crush-protocol/mcp-client setup --cursor
|
|
|
101
101
|
"mcpServers": {
|
|
102
102
|
"crush-protocol": {
|
|
103
103
|
"command": "npx",
|
|
104
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
104
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -117,13 +117,13 @@ npx -y @crush-protocol/mcp-client setup --cursor
|
|
|
117
117
|
**Auto setup:**
|
|
118
118
|
|
|
119
119
|
```sh
|
|
120
|
-
npx -y @crush-protocol/mcp-client setup --claude
|
|
120
|
+
npx -y @crush-protocol/mcp-client@latest setup --claude
|
|
121
121
|
```
|
|
122
122
|
|
|
123
123
|
**Manual config:**
|
|
124
124
|
|
|
125
125
|
```sh
|
|
126
|
-
claude mcp add --scope user crush-protocol -- npx -y @crush-protocol/mcp-client
|
|
126
|
+
claude mcp add --scope user crush-protocol -- npx -y @crush-protocol/mcp-client@latest
|
|
127
127
|
```
|
|
128
128
|
|
|
129
129
|
[](https://docs.anthropic.com/en/docs/claude-code/mcp)
|
|
@@ -136,19 +136,19 @@ claude mcp add --scope user crush-protocol -- npx -y @crush-protocol/mcp-client
|
|
|
136
136
|
**Auto setup:**
|
|
137
137
|
|
|
138
138
|
```sh
|
|
139
|
-
npx -y @crush-protocol/mcp-client setup --codex
|
|
139
|
+
npx -y @crush-protocol/mcp-client@latest setup --codex
|
|
140
140
|
```
|
|
141
141
|
|
|
142
142
|
**Manual config:**
|
|
143
143
|
|
|
144
|
-
**CLI:** `codex mcp add crush-protocol -- npx -y @crush-protocol/mcp-client`
|
|
144
|
+
**CLI:** `codex mcp add crush-protocol -- npx -y @crush-protocol/mcp-client@latest`
|
|
145
145
|
|
|
146
146
|
**File:** Add to `~/.codex/config.toml`:
|
|
147
147
|
|
|
148
148
|
```toml
|
|
149
149
|
[mcp_servers.crush-protocol]
|
|
150
150
|
command = "npx"
|
|
151
|
-
args = ["-y", "@crush-protocol/mcp-client"]
|
|
151
|
+
args = ["-y", "@crush-protocol/mcp-client@latest"]
|
|
152
152
|
startup_timeout_ms = 20000
|
|
153
153
|
```
|
|
154
154
|
|
|
@@ -162,7 +162,7 @@ startup_timeout_ms = 20000
|
|
|
162
162
|
**Auto setup:**
|
|
163
163
|
|
|
164
164
|
```sh
|
|
165
|
-
npx -y @crush-protocol/mcp-client setup --gemini
|
|
165
|
+
npx -y @crush-protocol/mcp-client@latest setup --gemini
|
|
166
166
|
```
|
|
167
167
|
|
|
168
168
|
**Manual config:** Add to `~/.gemini/settings.json`:
|
|
@@ -172,7 +172,7 @@ npx -y @crush-protocol/mcp-client setup --gemini
|
|
|
172
172
|
"mcpServers": {
|
|
173
173
|
"crush-protocol": {
|
|
174
174
|
"command": "npx",
|
|
175
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
175
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
}
|
|
@@ -188,7 +188,7 @@ npx -y @crush-protocol/mcp-client setup --gemini
|
|
|
188
188
|
**Auto setup:**
|
|
189
189
|
|
|
190
190
|
```sh
|
|
191
|
-
npx -y @crush-protocol/mcp-client setup --vscode
|
|
191
|
+
npx -y @crush-protocol/mcp-client@latest setup --vscode
|
|
192
192
|
```
|
|
193
193
|
|
|
194
194
|
**Manual config:** Add to `.vscode/mcp.json` (project) or `~/.vscode/mcp.json` (global):
|
|
@@ -199,7 +199,7 @@ npx -y @crush-protocol/mcp-client setup --vscode
|
|
|
199
199
|
"crush-protocol": {
|
|
200
200
|
"type": "stdio",
|
|
201
201
|
"command": "npx",
|
|
202
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
202
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
}
|
|
@@ -215,7 +215,7 @@ npx -y @crush-protocol/mcp-client setup --vscode
|
|
|
215
215
|
**Auto setup:**
|
|
216
216
|
|
|
217
217
|
```sh
|
|
218
|
-
npx -y @crush-protocol/mcp-client setup --windsurf
|
|
218
|
+
npx -y @crush-protocol/mcp-client@latest setup --windsurf
|
|
219
219
|
```
|
|
220
220
|
|
|
221
221
|
**Manual config:** Add to `~/.codeium/windsurf/mcp_config.json`:
|
|
@@ -225,7 +225,7 @@ npx -y @crush-protocol/mcp-client setup --windsurf
|
|
|
225
225
|
"mcpServers": {
|
|
226
226
|
"crush-protocol": {
|
|
227
227
|
"command": "npx",
|
|
228
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
228
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
}
|
|
@@ -241,7 +241,7 @@ npx -y @crush-protocol/mcp-client setup --windsurf
|
|
|
241
241
|
**Auto setup:**
|
|
242
242
|
|
|
243
243
|
```sh
|
|
244
|
-
npx -y @crush-protocol/mcp-client setup --claude-desktop
|
|
244
|
+
npx -y @crush-protocol/mcp-client@latest setup --claude-desktop
|
|
245
245
|
```
|
|
246
246
|
|
|
247
247
|
**Manual config:** Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
|
|
@@ -251,7 +251,7 @@ npx -y @crush-protocol/mcp-client setup --claude-desktop
|
|
|
251
251
|
"mcpServers": {
|
|
252
252
|
"crush-protocol": {
|
|
253
253
|
"command": "npx",
|
|
254
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
254
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
}
|
|
@@ -267,7 +267,7 @@ npx -y @crush-protocol/mcp-client setup --claude-desktop
|
|
|
267
267
|
**Auto setup:**
|
|
268
268
|
|
|
269
269
|
```sh
|
|
270
|
-
npx -y @crush-protocol/mcp-client setup --opencode
|
|
270
|
+
npx -y @crush-protocol/mcp-client@latest setup --opencode
|
|
271
271
|
```
|
|
272
272
|
|
|
273
273
|
**Manual config:** Add to `~/.config/opencode/opencode.json`:
|
|
@@ -278,7 +278,7 @@ npx -y @crush-protocol/mcp-client setup --opencode
|
|
|
278
278
|
"mcp": {
|
|
279
279
|
"crush-protocol": {
|
|
280
280
|
"type": "local",
|
|
281
|
-
"command": ["npx", "-y", "@crush-protocol/mcp-client"],
|
|
281
|
+
"command": ["npx", "-y", "@crush-protocol/mcp-client@latest"],
|
|
282
282
|
"enabled": true
|
|
283
283
|
}
|
|
284
284
|
}
|
|
@@ -295,7 +295,7 @@ npx -y @crush-protocol/mcp-client setup --opencode
|
|
|
295
295
|
**Auto setup:**
|
|
296
296
|
|
|
297
297
|
```sh
|
|
298
|
-
npx -y @crush-protocol/mcp-client setup --warp
|
|
298
|
+
npx -y @crush-protocol/mcp-client@latest setup --warp
|
|
299
299
|
```
|
|
300
300
|
|
|
301
301
|
**Manual config:** Add via Warp Drive → MCP Servers → `+ Add`:
|
|
@@ -304,7 +304,7 @@ npx -y @crush-protocol/mcp-client setup --warp
|
|
|
304
304
|
{
|
|
305
305
|
"crush-protocol": {
|
|
306
306
|
"command": "npx",
|
|
307
|
-
"args": ["-y", "@crush-protocol/mcp-client"],
|
|
307
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"],
|
|
308
308
|
"env": {},
|
|
309
309
|
"working_directory": null,
|
|
310
310
|
"start_on_launch": true
|
|
@@ -326,7 +326,7 @@ Add to `~/.kiro/settings/mcp.json` (global) or `.kiro/settings/mcp.json` (worksp
|
|
|
326
326
|
"mcpServers": {
|
|
327
327
|
"crush-protocol": {
|
|
328
328
|
"command": "npx",
|
|
329
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
329
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
}
|
|
@@ -346,7 +346,7 @@ Add to `.roo/mcp.json` (project) or open Roo Code settings → Edit Global MCP:
|
|
|
346
346
|
"mcpServers": {
|
|
347
347
|
"crush-protocol": {
|
|
348
348
|
"command": "npx",
|
|
349
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
349
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
}
|
|
@@ -366,7 +366,7 @@ Add to `cline_mcp_settings.json` (open via Cline panel → MCP Servers → Confi
|
|
|
366
366
|
"mcpServers": {
|
|
367
367
|
"crush-protocol": {
|
|
368
368
|
"command": "npx",
|
|
369
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
369
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
372
|
}
|
|
@@ -386,7 +386,7 @@ Add via Trae → Settings → MCP → Add MCP Server:
|
|
|
386
386
|
"mcpServers": {
|
|
387
387
|
"crush-protocol": {
|
|
388
388
|
"command": "npx",
|
|
389
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
389
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
}
|
|
@@ -399,7 +399,7 @@ Add via Trae → Settings → MCP → Add MCP Server:
|
|
|
399
399
|
<details>
|
|
400
400
|
<summary><strong>Augment Code</strong></summary>
|
|
401
401
|
|
|
402
|
-
Add via Settings → Tools → `+ Add MCP` → Command: `npx -y @crush-protocol/mcp-client`
|
|
402
|
+
Add via Settings → Tools → `+ Add MCP` → Command: `npx -y @crush-protocol/mcp-client@latest`
|
|
403
403
|
|
|
404
404
|
```json
|
|
405
405
|
"augment.advanced": {
|
|
@@ -407,7 +407,7 @@ Add via Settings → Tools → `+ Add MCP` → Command: `npx -y @crush-protocol/
|
|
|
407
407
|
{
|
|
408
408
|
"name": "crush-protocol",
|
|
409
409
|
"command": "npx",
|
|
410
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
410
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
411
411
|
}
|
|
412
412
|
]
|
|
413
413
|
}
|
|
@@ -428,7 +428,7 @@ Add to `.github/copilot/mcp.json` in your repository:
|
|
|
428
428
|
"crush-protocol": {
|
|
429
429
|
"type": "local",
|
|
430
430
|
"command": "npx",
|
|
431
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
431
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
434
|
}
|
|
@@ -449,7 +449,7 @@ Add to `~/.copilot/mcp-config.json`:
|
|
|
449
449
|
"crush-protocol": {
|
|
450
450
|
"type": "local",
|
|
451
451
|
"command": "npx",
|
|
452
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
452
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
455
|
}
|
|
@@ -469,7 +469,7 @@ Add to `~/.aws/amazonq/mcp.json`:
|
|
|
469
469
|
"mcpServers": {
|
|
470
470
|
"crush-protocol": {
|
|
471
471
|
"command": "npx",
|
|
472
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
472
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
475
|
}
|
|
@@ -483,7 +483,7 @@ Add to `~/.aws/amazonq/mcp.json`:
|
|
|
483
483
|
<summary><strong>Amp</strong></summary>
|
|
484
484
|
|
|
485
485
|
```sh
|
|
486
|
-
amp mcp add crush-protocol -- npx -y @crush-protocol/mcp-client
|
|
486
|
+
amp mcp add crush-protocol -- npx -y @crush-protocol/mcp-client@latest
|
|
487
487
|
```
|
|
488
488
|
|
|
489
489
|
[](https://ampcode.com/manual#mcp)
|
|
@@ -501,7 +501,7 @@ Add to `~/.config/zed/settings.json`:
|
|
|
501
501
|
"crush-protocol": {
|
|
502
502
|
"source": "custom",
|
|
503
503
|
"command": "npx",
|
|
504
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
504
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
}
|
|
@@ -521,7 +521,7 @@ Add via Settings → Tools → AI Assistant → Model Context Protocol (MCP) →
|
|
|
521
521
|
"mcpServers": {
|
|
522
522
|
"crush-protocol": {
|
|
523
523
|
"command": "npx",
|
|
524
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
524
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
527
|
}
|
|
@@ -534,14 +534,14 @@ Add via Settings → Tools → AI Assistant → Model Context Protocol (MCP) →
|
|
|
534
534
|
<details>
|
|
535
535
|
<summary><strong>Qwen Code</strong></summary>
|
|
536
536
|
|
|
537
|
-
**CLI:** `qwen mcp add crush-protocol npx -y @crush-protocol/mcp-client`
|
|
537
|
+
**CLI:** `qwen mcp add crush-protocol npx -y @crush-protocol/mcp-client@latest`
|
|
538
538
|
|
|
539
539
|
```json
|
|
540
540
|
{
|
|
541
541
|
"mcpServers": {
|
|
542
542
|
"crush-protocol": {
|
|
543
543
|
"command": "npx",
|
|
544
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
544
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
547
|
}
|
|
@@ -561,7 +561,7 @@ Add to `mcp.json` (open via Program → Install → Edit mcp.json):
|
|
|
561
561
|
"mcpServers": {
|
|
562
562
|
"crush-protocol": {
|
|
563
563
|
"command": "npx",
|
|
564
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
564
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
567
|
}
|
|
@@ -583,7 +583,7 @@ Add to `.mcp/mcp.json` in your solution directory:
|
|
|
583
583
|
"crush-protocol": {
|
|
584
584
|
"type": "stdio",
|
|
585
585
|
"command": "npx",
|
|
586
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
586
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
589
|
}
|
|
@@ -602,7 +602,7 @@ Add to `.mcp/mcp.json` in your solution directory:
|
|
|
602
602
|
"mcpServers": {
|
|
603
603
|
"crush-protocol": {
|
|
604
604
|
"command": "npx",
|
|
605
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
605
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
}
|
|
@@ -619,7 +619,7 @@ Add via Perplexity → Settings → Connectors → Add Connector → Advanced. S
|
|
|
619
619
|
|
|
620
620
|
```json
|
|
621
621
|
{
|
|
622
|
-
"args": ["-y", "@crush-protocol/mcp-client"],
|
|
622
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"],
|
|
623
623
|
"command": "npx",
|
|
624
624
|
"env": {}
|
|
625
625
|
}
|
|
@@ -637,7 +637,7 @@ Add via Perplexity → Settings → Connectors → Add Connector → Advanced. S
|
|
|
637
637
|
"mcpServers": {
|
|
638
638
|
"crush-protocol": {
|
|
639
639
|
"command": "npx",
|
|
640
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
640
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
643
|
}
|
|
@@ -655,7 +655,7 @@ Add via Zencoder menu → Agent tools → Add custom MCP:
|
|
|
655
655
|
```json
|
|
656
656
|
{
|
|
657
657
|
"command": "npx",
|
|
658
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
658
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
659
659
|
}
|
|
660
660
|
```
|
|
661
661
|
|
|
@@ -673,7 +673,7 @@ Qodo Gen chat → Connect more tools → `+ Add new MCP`
|
|
|
673
673
|
"mcpServers": {
|
|
674
674
|
"crush-protocol": {
|
|
675
675
|
"command": "npx",
|
|
676
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
676
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
}
|
|
@@ -693,7 +693,7 @@ Qodo Gen chat → Connect more tools → `+ Add new MCP`
|
|
|
693
693
|
"mcpServers": {
|
|
694
694
|
"crush-protocol": {
|
|
695
695
|
"command": "bunx",
|
|
696
|
-
"args": ["-y", "@crush-protocol/mcp-client"]
|
|
696
|
+
"args": ["-y", "@crush-protocol/mcp-client@latest"]
|
|
697
697
|
}
|
|
698
698
|
}
|
|
699
699
|
}
|
|
@@ -729,7 +729,7 @@ Qodo Gen chat → Connect more tools → `+ Add new MCP`
|
|
|
729
729
|
"mcpServers": {
|
|
730
730
|
"crush-protocol": {
|
|
731
731
|
"command": "cmd",
|
|
732
|
-
"args": ["/c", "npx", "-y", "@crush-protocol/mcp-client"]
|
|
732
|
+
"args": ["/c", "npx", "-y", "@crush-protocol/mcp-client@latest"]
|
|
733
733
|
}
|
|
734
734
|
}
|
|
735
735
|
}
|
|
@@ -740,12 +740,12 @@ Qodo Gen chat → Connect more tools → `+ Add new MCP`
|
|
|
740
740
|
## Common Commands
|
|
741
741
|
|
|
742
742
|
```sh
|
|
743
|
-
npx -y @crush-protocol/mcp-client setup --all
|
|
744
|
-
npx -y @crush-protocol/mcp-client login
|
|
745
|
-
npx -y @crush-protocol/mcp-client auth:status
|
|
746
|
-
npx -y @crush-protocol/mcp-client doctor
|
|
747
|
-
npx -y @crush-protocol/mcp-client ping
|
|
748
|
-
npx -y @crush-protocol/mcp-client tools:list
|
|
743
|
+
npx -y @crush-protocol/mcp-client@latest setup --all
|
|
744
|
+
npx -y @crush-protocol/mcp-client@latest login
|
|
745
|
+
npx -y @crush-protocol/mcp-client@latest auth:status
|
|
746
|
+
npx -y @crush-protocol/mcp-client@latest doctor
|
|
747
|
+
npx -y @crush-protocol/mcp-client@latest ping
|
|
748
|
+
npx -y @crush-protocol/mcp-client@latest tools:list
|
|
749
749
|
```
|
|
750
750
|
|
|
751
751
|
## Troubleshooting
|
|
@@ -753,9 +753,9 @@ npx -y @crush-protocol/mcp-client tools:list
|
|
|
753
753
|
| Problem | What to do |
|
|
754
754
|
| --- | --- |
|
|
755
755
|
| Tools do not appear after install | Restart the MCP host after `setup` |
|
|
756
|
-
| Tools appear but fail with auth errors | Run `npx -y @crush-protocol/mcp-client login` |
|
|
757
|
-
| Crush was working before but now fails | Run `npx -y @crush-protocol/mcp-client doctor` |
|
|
758
|
-
| You want to confirm local auth state | Run `npx -y @crush-protocol/mcp-client auth:status` |
|
|
756
|
+
| Tools appear but fail with auth errors | Run `npx -y @crush-protocol/mcp-client@latest login` |
|
|
757
|
+
| Crush was working before but now fails | Run `npx -y @crush-protocol/mcp-client@latest doctor` |
|
|
758
|
+
| You want to confirm local auth state | Run `npx -y @crush-protocol/mcp-client@latest auth:status` |
|
|
759
759
|
|
|
760
760
|
## License
|
|
761
761
|
|
package/dist/config.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const PACKAGE_NAME = "@crush-protocol/mcp-client";
|
|
2
|
+
export declare const PACKAGE_NAME_LATEST = "@crush-protocol/mcp-client@latest";
|
|
2
3
|
export declare const SERVER_NAME = "crush-protocol";
|
|
3
4
|
export declare const DEFAULT_MCP_SERVER_URL = "https://crush-mcp-omni.dev.xexlab.com/mcp";
|
|
4
5
|
export declare const DEFAULT_OAUTH_SCOPE = "mcp:tools";
|
package/dist/config.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export const PACKAGE_NAME = "@crush-protocol/mcp-client";
|
|
2
|
+
export const PACKAGE_NAME_LATEST = "@crush-protocol/mcp-client@latest";
|
|
2
3
|
export const SERVER_NAME = "crush-protocol";
|
|
3
4
|
export const DEFAULT_MCP_SERVER_URL = "https://crush-mcp-omni.dev.xexlab.com/mcp";
|
|
4
5
|
export const DEFAULT_OAUTH_SCOPE = "mcp:tools";
|
package/dist/mcp/proxy.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* MCP Proxy — stdio ↔ Streamable HTTP
|
|
2
|
+
* MCP Proxy — stdio ↔ Streamable HTTP bridge
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* proxy 将请求转发到远程 MCP Server(Streamable HTTP)。
|
|
4
|
+
* AI hosts (Cursor / Claude Code / Codex / Antigravity) connect via stdio.
|
|
5
|
+
* The proxy forwards tool calls to the remote Crush MCP over authenticated HTTP.
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* Auth is handled transparently:
|
|
8
|
+
* - On startup: attempts to connect with cached tokens.
|
|
9
|
+
* - On 401 during a tool call: triggers OAuth, returns auth URL as tool result
|
|
10
|
+
* so the user sees it in the AI host UI, then retries after authorization.
|
|
12
11
|
*/
|
|
13
12
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
14
13
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
@@ -16,6 +15,43 @@ import { CallToolRequestSchema, ListToolsRequestSchema, PingRequestSchema } from
|
|
|
16
15
|
import { OAuthRemoteMcpClient } from "./oauthRemoteClient.js";
|
|
17
16
|
import { getCachedAuthStatus } from "./oauthStorage.js";
|
|
18
17
|
import { CLIENT_NAME, CLIENT_VERSION } from "./version.js";
|
|
18
|
+
/** Attempt OAuth and return a user-visible auth message with the authorization URL. */
|
|
19
|
+
async function authorizeWithVisiblePrompt(remoteClient) {
|
|
20
|
+
let authUrl = "";
|
|
21
|
+
const origProvider = remoteClient.authProvider;
|
|
22
|
+
const origCallback = origProvider?.onAuthorizationUrl;
|
|
23
|
+
// Capture the authorization URL so we can return it in tool results.
|
|
24
|
+
if (origProvider) {
|
|
25
|
+
origProvider.onAuthorizationUrl = async (url) => {
|
|
26
|
+
authUrl = url.toString();
|
|
27
|
+
if (origCallback)
|
|
28
|
+
await origCallback(url);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
await remoteClient.ensureAuthorized();
|
|
32
|
+
// Restore original callback.
|
|
33
|
+
if (origProvider) {
|
|
34
|
+
origProvider.onAuthorizationUrl = origCallback;
|
|
35
|
+
}
|
|
36
|
+
return authUrl;
|
|
37
|
+
}
|
|
38
|
+
function authRequiredMessage(authUrl) {
|
|
39
|
+
const lines = [
|
|
40
|
+
"🔐 **Crush MCP requires authorization**",
|
|
41
|
+
"",
|
|
42
|
+
"This MCP server provides access to trading tools and market data.",
|
|
43
|
+
"You need to authorize in your browser to continue.",
|
|
44
|
+
"",
|
|
45
|
+
];
|
|
46
|
+
if (authUrl) {
|
|
47
|
+
lines.push("**Authorization URL:**", authUrl, "");
|
|
48
|
+
}
|
|
49
|
+
lines.push("✅ Authorization complete. Please retry your request.");
|
|
50
|
+
return {
|
|
51
|
+
content: [{ type: "text", text: lines.join("\n") }],
|
|
52
|
+
isError: true,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
19
55
|
export async function runProxy(serverUrl) {
|
|
20
56
|
const remoteClient = new OAuthRemoteMcpClient({
|
|
21
57
|
serverUrl,
|
|
@@ -23,18 +59,17 @@ export async function runProxy(serverUrl) {
|
|
|
23
59
|
authorizationOutput: "stderr",
|
|
24
60
|
},
|
|
25
61
|
});
|
|
62
|
+
// Try to connect with cached credentials. If none exist, defer auth to first tool call.
|
|
26
63
|
const authStatus = await getCachedAuthStatus(serverUrl);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
64
|
+
let needsAuth = authStatus.status === "not_authenticated";
|
|
65
|
+
if (!needsAuth) {
|
|
66
|
+
try {
|
|
67
|
+
await remoteClient.connect();
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
needsAuth = true;
|
|
71
|
+
}
|
|
35
72
|
}
|
|
36
|
-
await remoteClient.connect();
|
|
37
|
-
const remoteTools = await remoteClient.listTools();
|
|
38
73
|
const localServer = new Server({
|
|
39
74
|
name: `${CLIENT_NAME}-proxy`,
|
|
40
75
|
version: CLIENT_VERSION,
|
|
@@ -48,14 +83,47 @@ export async function runProxy(serverUrl) {
|
|
|
48
83
|
return await remoteClient.listTools();
|
|
49
84
|
}
|
|
50
85
|
catch {
|
|
51
|
-
return { tools:
|
|
86
|
+
return { tools: [] };
|
|
52
87
|
}
|
|
53
88
|
});
|
|
54
89
|
localServer.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
55
90
|
const { name, arguments: args } = request.params;
|
|
56
|
-
|
|
91
|
+
// If auth is needed, trigger OAuth and show the URL to the user.
|
|
92
|
+
if (needsAuth) {
|
|
93
|
+
const authUrl = await authorizeWithVisiblePrompt(remoteClient);
|
|
94
|
+
await remoteClient.connect();
|
|
95
|
+
needsAuth = false;
|
|
96
|
+
// Retry the original tool call after successful auth.
|
|
97
|
+
try {
|
|
98
|
+
return await remoteClient.callTool(name, (args ?? {}));
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return authRequiredMessage(authUrl);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
try {
|
|
105
|
+
return await remoteClient.callTool(name, (args ?? {}));
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
// If we get a 401 mid-session (token expired), re-authorize.
|
|
109
|
+
if (String(error).includes("Unauthorized") || String(error).includes("401")) {
|
|
110
|
+
const authUrl = await authorizeWithVisiblePrompt(remoteClient);
|
|
111
|
+
try {
|
|
112
|
+
return await remoteClient.callTool(name, (args ?? {}));
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
return authRequiredMessage(authUrl);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
throw error;
|
|
119
|
+
}
|
|
57
120
|
});
|
|
58
121
|
localServer.setRequestHandler(PingRequestSchema, async () => {
|
|
122
|
+
if (needsAuth) {
|
|
123
|
+
await authorizeWithVisiblePrompt(remoteClient);
|
|
124
|
+
await remoteClient.connect();
|
|
125
|
+
needsAuth = false;
|
|
126
|
+
}
|
|
59
127
|
await remoteClient.ping();
|
|
60
128
|
return {};
|
|
61
129
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_MCP_SERVER_URL,
|
|
1
|
+
import { DEFAULT_MCP_SERVER_URL, PACKAGE_NAME_LATEST } from "../config.js";
|
|
2
2
|
const TARGET_LABELS = {
|
|
3
3
|
cursor: "Cursor",
|
|
4
4
|
claude: "Claude Code",
|
|
@@ -12,8 +12,8 @@ const TARGET_LABELS = {
|
|
|
12
12
|
};
|
|
13
13
|
export const getTargetLabel = (target) => TARGET_LABELS[target];
|
|
14
14
|
export const getLoginCommand = (serverUrl) => serverUrl === DEFAULT_MCP_SERVER_URL
|
|
15
|
-
? `npx -y ${
|
|
16
|
-
: `CRUSH_MCP_SERVER_URL=\"${serverUrl}\" npx -y ${
|
|
15
|
+
? `npx -y ${PACKAGE_NAME_LATEST} login`
|
|
16
|
+
: `CRUSH_MCP_SERVER_URL=\"${serverUrl}\" npx -y ${PACKAGE_NAME_LATEST} login`;
|
|
17
17
|
export const formatLoginRequiredMessage = (serverUrl) => [
|
|
18
18
|
"Crush needs sign-in on this machine.",
|
|
19
19
|
"",
|
|
@@ -2,7 +2,7 @@ import { spawnSync } from "node:child_process";
|
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import os from "node:os";
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
import {
|
|
5
|
+
import { PACKAGE_NAME_LATEST, SERVER_NAME } from "../config.js";
|
|
6
6
|
export const ALL_TARGETS = [
|
|
7
7
|
"cursor",
|
|
8
8
|
"claude",
|
|
@@ -42,7 +42,7 @@ const writeJson = (filePath, value) => {
|
|
|
42
42
|
};
|
|
43
43
|
const createNpxConfig = () => ({
|
|
44
44
|
command: "npx",
|
|
45
|
-
args: ["-y",
|
|
45
|
+
args: ["-y", PACKAGE_NAME_LATEST],
|
|
46
46
|
});
|
|
47
47
|
// ─── Cursor ─────────────────────────────────────────────
|
|
48
48
|
const getCursorConfigPath = (scope) => scope === "project"
|
|
@@ -79,7 +79,7 @@ const installOpenCode = (scope) => {
|
|
|
79
79
|
}
|
|
80
80
|
mcp[SERVER_NAME] = {
|
|
81
81
|
type: "local",
|
|
82
|
-
command: ["npx", "-y",
|
|
82
|
+
command: ["npx", "-y", PACKAGE_NAME_LATEST],
|
|
83
83
|
enabled: true,
|
|
84
84
|
};
|
|
85
85
|
config.mcp = mcp;
|
|
@@ -91,7 +91,7 @@ const installCodex = () => {
|
|
|
91
91
|
const filePath = getCodexConfigPath();
|
|
92
92
|
const section = `[mcp_servers.${SERVER_NAME}]
|
|
93
93
|
command = "npx"
|
|
94
|
-
args = ["-y", "${
|
|
94
|
+
args = ["-y", "${PACKAGE_NAME_LATEST}"]
|
|
95
95
|
startup_timeout_ms = 20000
|
|
96
96
|
`;
|
|
97
97
|
ensureDir(filePath);
|
|
@@ -110,7 +110,7 @@ const installClaude = (scope) => {
|
|
|
110
110
|
const configJson = JSON.stringify({
|
|
111
111
|
type: "stdio",
|
|
112
112
|
command: "npx",
|
|
113
|
-
args: ["-y",
|
|
113
|
+
args: ["-y", PACKAGE_NAME_LATEST],
|
|
114
114
|
});
|
|
115
115
|
const result = spawnSync("claude", ["mcp", "add-json", "--scope", scope, SERVER_NAME, configJson], {
|
|
116
116
|
stdio: "pipe",
|
|
@@ -136,7 +136,7 @@ const installVSCode = (scope) => {
|
|
|
136
136
|
servers[SERVER_NAME] = {
|
|
137
137
|
type: "stdio",
|
|
138
138
|
command: "npx",
|
|
139
|
-
args: ["-y",
|
|
139
|
+
args: ["-y", PACKAGE_NAME_LATEST],
|
|
140
140
|
};
|
|
141
141
|
config.servers = servers;
|
|
142
142
|
return { target: "vscode", scope, status: writeJson(filePath, config), location: filePath };
|
|
@@ -178,7 +178,7 @@ const installWarp = () => {
|
|
|
178
178
|
const config = readJson(filePath);
|
|
179
179
|
config[SERVER_NAME] = {
|
|
180
180
|
command: "npx",
|
|
181
|
-
args: ["-y",
|
|
181
|
+
args: ["-y", PACKAGE_NAME_LATEST],
|
|
182
182
|
env: {},
|
|
183
183
|
working_directory: null,
|
|
184
184
|
start_on_launch: true,
|
package/package.json
CHANGED