mcp-probe-kit 3.0.12 → 3.0.14
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 +82 -20
- package/build/lib/__tests__/gitnexus-bridge.unit.test.js +37 -1
- package/build/lib/gitnexus-bridge.d.ts +35 -2
- package/build/lib/gitnexus-bridge.js +410 -41
- package/build/tools/__tests__/code_insight.unit.test.js +58 -5
- package/build/tools/code_insight.d.ts +31 -1
- package/build/tools/code_insight.js +193 -75
- package/docs/i18n/en.json +20 -0
- package/docs/i18n/ja.json +20 -0
- package/docs/i18n/ko.json +20 -0
- package/docs/i18n/zh-CN.json +20 -0
- package/docs/pages/getting-started.html +71 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -316,10 +316,10 @@ No installation needed, use the latest version directly.
|
|
|
316
316
|
}
|
|
317
317
|
```
|
|
318
318
|
|
|
319
|
-
### Method 2: Global Installation
|
|
320
|
-
|
|
321
|
-
```bash
|
|
322
|
-
npm install -g mcp-probe-kit
|
|
319
|
+
### Method 2: Global Installation
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
npm install -g mcp-probe-kit
|
|
323
323
|
```
|
|
324
324
|
|
|
325
325
|
Use in config file:
|
|
@@ -330,12 +330,50 @@ Use in config file:
|
|
|
330
330
|
"command": "mcp-probe-kit"
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
|
-
}
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
###
|
|
337
|
-
|
|
338
|
-
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Windows Notes for Graph Tools
|
|
337
|
+
|
|
338
|
+
Applies to `code_insight`, `start_feature`, `start_bugfix`, and `init_project_context`.
|
|
339
|
+
|
|
340
|
+
- The GitNexus bridge uses `npx -y gitnexus@latest mcp` by default.
|
|
341
|
+
- On Windows, the first cold start can take 20+ seconds because `npx` may check/download packages.
|
|
342
|
+
- Some GitNexus dependencies use `tree-sitter-*` native modules. If your machine lacks Visual Studio Build Tools, the first install may fail with errors like `gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use`.
|
|
343
|
+
|
|
344
|
+
Recommended on Windows:
|
|
345
|
+
|
|
346
|
+
1. Install Visual Studio Build Tools with the C++ workload if you use graph-aware tools regularly.
|
|
347
|
+
2. Prefer stable local/global CLI usage for GitNexus when your MCP client supports `env`.
|
|
348
|
+
3. Increase GitNexus connect/call timeouts on slower or first-run environments.
|
|
349
|
+
|
|
350
|
+
Quick install command (Windows):
|
|
351
|
+
|
|
352
|
+
```powershell
|
|
353
|
+
winget install Microsoft.VisualStudio.2022.BuildTools
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
Example config using a preinstalled `gitnexus` CLI:
|
|
357
|
+
|
|
358
|
+
```json
|
|
359
|
+
{
|
|
360
|
+
"mcpServers": {
|
|
361
|
+
"mcp-probe-kit": {
|
|
362
|
+
"command": "mcp-probe-kit",
|
|
363
|
+
"env": {
|
|
364
|
+
"MCP_GITNEXUS_COMMAND": "gitnexus",
|
|
365
|
+
"MCP_GITNEXUS_ARGS": "mcp",
|
|
366
|
+
"MCP_GITNEXUS_CONNECT_TIMEOUT_MS": "30000",
|
|
367
|
+
"MCP_GITNEXUS_TIMEOUT_MS": "45000"
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### Restart Client
|
|
375
|
+
|
|
376
|
+
After configuration, **completely quit and reopen** your MCP client.
|
|
339
377
|
|
|
340
378
|
**👉 [Detailed Installation Guide](https://mcp-probe-kit.bytezonex.com/pages/getting-started.html)**
|
|
341
379
|
|
|
@@ -426,17 +464,41 @@ npx -y mcp-probe-kit@latest 2>&1 | tee ./mcp-probe-kit.log
|
|
|
426
464
|
3. Confirm JSON format is correct, no syntax errors
|
|
427
465
|
4. Check client developer tools or logs for error messages
|
|
428
466
|
|
|
429
|
-
### Q3: How to update to latest version?
|
|
430
|
-
|
|
431
|
-
**npx method (Recommended):**
|
|
432
|
-
Use `@latest` tag in config, automatically uses latest version.
|
|
433
|
-
|
|
434
|
-
**Global installation method:**
|
|
435
|
-
```bash
|
|
436
|
-
npm update -g mcp-probe-kit
|
|
437
|
-
```
|
|
467
|
+
### Q3: How to update to latest version?
|
|
468
|
+
|
|
469
|
+
**npx method (Recommended):**
|
|
470
|
+
Use `@latest` tag in config, automatically uses latest version.
|
|
438
471
|
|
|
439
|
-
|
|
472
|
+
**Global installation method:**
|
|
473
|
+
```bash
|
|
474
|
+
npm update -g mcp-probe-kit
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
### Q4: Why are graph-aware tools slow or timing out on Windows the first time?
|
|
478
|
+
|
|
479
|
+
This usually affects `code_insight`, `start_feature`, `start_bugfix`, and `init_project_context`.
|
|
480
|
+
|
|
481
|
+
Common causes:
|
|
482
|
+
|
|
483
|
+
1. `npx -y gitnexus@latest mcp` performs a cold start and may spend 20+ seconds checking/downloading packages.
|
|
484
|
+
2. GitNexus may need native `tree-sitter-*` modules, which can require Visual Studio Build Tools on Windows.
|
|
485
|
+
|
|
486
|
+
If you see logs like:
|
|
487
|
+
|
|
488
|
+
```text
|
|
489
|
+
gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
|
|
490
|
+
gyp ERR! find VS - missing any VC++ toolset
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
Try this:
|
|
494
|
+
|
|
495
|
+
1. Install Visual Studio Build Tools with the C++ workload.
|
|
496
|
+
2. Retry once after dependencies finish installing.
|
|
497
|
+
3. If your client supports `env`, switch the bridge to a preinstalled `gitnexus` CLI and raise:
|
|
498
|
+
`MCP_GITNEXUS_CONNECT_TIMEOUT_MS`
|
|
499
|
+
`MCP_GITNEXUS_TIMEOUT_MS`
|
|
500
|
+
|
|
501
|
+
**👉 [More FAQ](https://mcp-probe-kit.bytezonex.com/pages/getting-started.html)**
|
|
440
502
|
|
|
441
503
|
---
|
|
442
504
|
|
|
@@ -3,7 +3,7 @@ import * as os from "node:os";
|
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import spawn from "cross-spawn";
|
|
5
5
|
import { afterEach, describe, expect, test } from "vitest";
|
|
6
|
-
import { prepareBridgeWorkspace, resolveExecutableCommand, resolveSpawnCommand } from "../gitnexus-bridge.js";
|
|
6
|
+
import { prepareBridgeWorkspace, resolveExecutableCommand, resolveGitNexusBridgeCommand, resolveSpawnCommand, rerankQueryStructuredContent, } from "../gitnexus-bridge.js";
|
|
7
7
|
const tempRoots = [];
|
|
8
8
|
afterEach(() => {
|
|
9
9
|
while (tempRoots.length > 0) {
|
|
@@ -51,6 +51,42 @@ describe("gitnexus-bridge workspace preparation", () => {
|
|
|
51
51
|
expect(wrapped.command.toLowerCase()).toContain("npx");
|
|
52
52
|
expect(wrapped.args).toEqual(["-y", "gitnexus@latest", "mcp"]);
|
|
53
53
|
});
|
|
54
|
+
test("优先使用本地 gitnexus CLI 启动 bridge", () => {
|
|
55
|
+
const root = makeTempDir("gitnexus-cli-");
|
|
56
|
+
const executable = path.join(root, "gitnexus.cmd");
|
|
57
|
+
fs.writeFileSync(executable, "@echo off\r\necho gitnexus %*\r\n", "utf-8");
|
|
58
|
+
const resolved = resolveGitNexusBridgeCommand({
|
|
59
|
+
PATH: root,
|
|
60
|
+
PATHEXT: ".CMD;.EXE;.BAT",
|
|
61
|
+
}, "win32");
|
|
62
|
+
expect(resolved.strategy).toBe("local");
|
|
63
|
+
expect(resolved.command).toBe(executable);
|
|
64
|
+
expect(resolved.args).toEqual(["mcp"]);
|
|
65
|
+
});
|
|
66
|
+
test("显式 MCP_GITNEXUS_COMMAND 配置优先于本地 CLI 自动发现", () => {
|
|
67
|
+
const resolved = resolveGitNexusBridgeCommand({
|
|
68
|
+
MCP_GITNEXUS_COMMAND: "npx",
|
|
69
|
+
MCP_GITNEXUS_ARGS: "-y gitnexus@1.4.1 mcp",
|
|
70
|
+
PATH: "",
|
|
71
|
+
}, "win32");
|
|
72
|
+
expect(resolved.strategy).toBe("env");
|
|
73
|
+
expect(resolved.command.toLowerCase()).toContain("npx");
|
|
74
|
+
expect(resolved.args).toEqual(["-y", "gitnexus@1.4.1", "mcp"]);
|
|
75
|
+
});
|
|
76
|
+
test("query 结果会按关键词对流程做轻量重排", () => {
|
|
77
|
+
const reranked = rerankQueryStructuredContent({
|
|
78
|
+
processes: [
|
|
79
|
+
{ heuristicLabel: "Main -> Sleep", priority: 0.12, summary: "background idle loop" },
|
|
80
|
+
{ heuristicLabel: "Login -> GenerateToken", priority: 0.08, filePath: "src/auth/login.ts" },
|
|
81
|
+
],
|
|
82
|
+
}, {
|
|
83
|
+
query: "login authentication user signin auth",
|
|
84
|
+
goal: "理解登录流程",
|
|
85
|
+
});
|
|
86
|
+
expect(reranked.changed).toBe(true);
|
|
87
|
+
expect(reranked.structuredContent.processes[0].heuristicLabel).toBe("Login -> GenerateToken");
|
|
88
|
+
expect(reranked.note).toMatch(/Top matches/i);
|
|
89
|
+
});
|
|
54
90
|
test.runIf(process.platform === "win32")("Windows 下带空格路径的 cmd 可执行文件可以真实启动", async () => {
|
|
55
91
|
const root = makeTempDir("gitnexus-space-");
|
|
56
92
|
const executable = path.join(root, "Program Files", "tool.cmd");
|
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
export type CodeInsightMode = "auto" | "query" | "context" | "impact";
|
|
2
2
|
export type CodeInsightDirection = "upstream" | "downstream";
|
|
3
|
+
export type GitNexusLaunchStrategy = "local" | "npx" | "env";
|
|
4
|
+
export interface CodeInsightCandidate {
|
|
5
|
+
uid?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
file_path?: string;
|
|
8
|
+
kind?: string;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
export interface CodeInsightAmbiguity {
|
|
12
|
+
tool: string;
|
|
13
|
+
message?: string;
|
|
14
|
+
candidates: CodeInsightCandidate[];
|
|
15
|
+
}
|
|
3
16
|
export interface CodeInsightRequest {
|
|
4
17
|
mode?: CodeInsightMode;
|
|
5
18
|
query?: string;
|
|
6
19
|
target?: string;
|
|
20
|
+
uid?: string;
|
|
21
|
+
filePath?: string;
|
|
7
22
|
repo?: string;
|
|
8
23
|
projectRoot?: string;
|
|
9
24
|
goal?: string;
|
|
@@ -11,6 +26,7 @@ export interface CodeInsightRequest {
|
|
|
11
26
|
direction?: CodeInsightDirection;
|
|
12
27
|
maxDepth?: number;
|
|
13
28
|
includeTests?: boolean;
|
|
29
|
+
includeContent?: boolean;
|
|
14
30
|
signal?: AbortSignal;
|
|
15
31
|
}
|
|
16
32
|
export interface CodeInsightExecution {
|
|
@@ -20,6 +36,7 @@ export interface CodeInsightExecution {
|
|
|
20
36
|
args: Record<string, unknown>;
|
|
21
37
|
text?: string;
|
|
22
38
|
structuredContent?: unknown;
|
|
39
|
+
status?: string;
|
|
23
40
|
error?: string;
|
|
24
41
|
}
|
|
25
42
|
export interface CodeInsightBridgeResult {
|
|
@@ -33,6 +50,8 @@ export interface CodeInsightBridgeResult {
|
|
|
33
50
|
executions: CodeInsightExecution[];
|
|
34
51
|
warnings: string[];
|
|
35
52
|
repo?: string;
|
|
53
|
+
launcherStrategy: GitNexusLaunchStrategy;
|
|
54
|
+
ambiguities: CodeInsightAmbiguity[];
|
|
36
55
|
workspaceMode: "direct" | "temp-repo";
|
|
37
56
|
sourceRoot: string;
|
|
38
57
|
analysisRoot: string;
|
|
@@ -48,11 +67,25 @@ export interface EmbeddedGraphContext {
|
|
|
48
67
|
mode: "query" | "context" | "impact";
|
|
49
68
|
highlights: string[];
|
|
50
69
|
}
|
|
51
|
-
export declare function
|
|
52
|
-
|
|
70
|
+
export declare function resolveGitNexusBridgeCommand(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform): {
|
|
71
|
+
command: string;
|
|
72
|
+
args: string[];
|
|
73
|
+
strategy: GitNexusLaunchStrategy;
|
|
74
|
+
};
|
|
75
|
+
export declare function resolveExecutableCommand(command: string, platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv): string;
|
|
76
|
+
export declare function resolveSpawnCommand(command: string, args: string[], platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv): {
|
|
53
77
|
command: string;
|
|
54
78
|
args: string[];
|
|
55
79
|
};
|
|
80
|
+
export declare function rerankQueryStructuredContent(structuredContent: unknown, hints: {
|
|
81
|
+
query?: string;
|
|
82
|
+
goal?: string;
|
|
83
|
+
taskContext?: string;
|
|
84
|
+
}): {
|
|
85
|
+
structuredContent: unknown;
|
|
86
|
+
changed: boolean;
|
|
87
|
+
note?: string;
|
|
88
|
+
};
|
|
56
89
|
export interface BridgeWorkspace {
|
|
57
90
|
workspaceMode: "direct" | "temp-repo";
|
|
58
91
|
sourceRoot: string;
|