kibi-mcp 0.7.0 → 0.7.1
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/bin/kibi-mcp +39 -11
- package/package.json +7 -4
package/bin/kibi-mcp
CHANGED
|
@@ -16,9 +16,36 @@
|
|
|
16
16
|
You should have received a copy of the GNU Affero General Public License
|
|
17
17
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
const args = globalThis.Bun?.argv?.slice(2) ?? process.argv.slice(2);
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
function printHelp() {
|
|
22
|
+
process.stdout.write(`Usage: kibi-mcp [options]
|
|
23
|
+
|
|
24
|
+
Starts the Kibi MCP server over stdio.
|
|
25
|
+
|
|
26
|
+
Options:
|
|
27
|
+
--diagnostic-mode enable diagnostic logging to .kb/usage.log
|
|
28
|
+
-h, --help show help
|
|
29
|
+
`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (args.includes("-h") || args.includes("--help")) {
|
|
33
|
+
printHelp();
|
|
34
|
+
process.exitCode = 0;
|
|
35
|
+
} else {
|
|
36
|
+
if (args.includes("--diagnostic-mode") && !process.argv.includes("--diagnostic-mode")) {
|
|
37
|
+
process.argv.push("--diagnostic-mode");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (args.includes("--diagnostic-mode")) {
|
|
41
|
+
globalThis.__KIBI_MCP_DIAGNOSTIC_MODE = true;
|
|
42
|
+
process.env.KIBI_WORKSPACE = process.cwd();
|
|
43
|
+
process.env.KIBI_MCP_DIAGNOSTIC_MODE = "1";
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const { startServer } = await import("../dist/server.js");
|
|
47
|
+
|
|
48
|
+
if (process.env.KIBI_MCP_DEBUG) {
|
|
22
49
|
const originalStdoutWrite = process.stdout.write.bind(process.stdout);
|
|
23
50
|
const originalStderrWrite = process.stderr.write.bind(process.stderr);
|
|
24
51
|
|
|
@@ -36,24 +63,25 @@ if (process.env.KIBI_MCP_DEBUG) {
|
|
|
36
63
|
originalStderrWrite(`[KIBI-MCP-IN] ${str}\n`);
|
|
37
64
|
}
|
|
38
65
|
});
|
|
39
|
-
}
|
|
66
|
+
}
|
|
40
67
|
|
|
41
|
-
process.on('unhandledRejection', (reason, promise) => {
|
|
68
|
+
process.on('unhandledRejection', (reason, promise) => {
|
|
42
69
|
console.error('[KIBI-MCP] Unhandled rejection at promise:', promise);
|
|
43
70
|
console.error('[KIBI-MCP] Reason:', reason);
|
|
44
71
|
if (reason instanceof Error) {
|
|
45
72
|
console.error('[KIBI-MCP] Stack:', reason.stack);
|
|
46
73
|
}
|
|
47
74
|
process.exit(1);
|
|
48
|
-
});
|
|
75
|
+
});
|
|
49
76
|
|
|
50
|
-
process.on('uncaughtException', (error) => {
|
|
77
|
+
process.on('uncaughtException', (error) => {
|
|
51
78
|
console.error('[KIBI-MCP] Uncaught exception:', error.message);
|
|
52
79
|
console.error('[KIBI-MCP] Stack:', error.stack);
|
|
53
80
|
process.exit(1);
|
|
54
|
-
});
|
|
81
|
+
});
|
|
55
82
|
|
|
56
|
-
startServer().catch((error) => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
});
|
|
83
|
+
startServer().catch((error) => {
|
|
84
|
+
console.error("Fatal error:", error);
|
|
85
|
+
process.exit(1);
|
|
86
|
+
});
|
|
87
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kibi-mcp",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
6
6
|
"ajv": "^8.18.0",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"fast-glob": "^3.2.12",
|
|
10
10
|
"gray-matter": "^4.0.3",
|
|
11
11
|
"js-yaml": "^4.1.0",
|
|
12
|
-
"kibi-cli": "^0.6.
|
|
13
|
-
"kibi-core": "^0.5.
|
|
12
|
+
"kibi-cli": "^0.6.1",
|
|
13
|
+
"kibi-core": "^0.5.1",
|
|
14
14
|
"mcpcat": "^0.1.12",
|
|
15
15
|
"ts-morph": "^23.0.0",
|
|
16
16
|
"zod": "^4.3.6"
|
|
@@ -27,7 +27,10 @@
|
|
|
27
27
|
"build": "tsc -p tsconfig.json",
|
|
28
28
|
"prepack": "npm run build"
|
|
29
29
|
},
|
|
30
|
-
"files": [
|
|
30
|
+
"files": [
|
|
31
|
+
"dist",
|
|
32
|
+
"bin"
|
|
33
|
+
],
|
|
31
34
|
"engines": {
|
|
32
35
|
"node": ">=18",
|
|
33
36
|
"bun": ">=1.0"
|