kibi-mcp 2.3.0 → 3.0.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.
@@ -17,30 +17,51 @@
17
17
  */
18
18
  import { getSpec } from "kibi-runtime";
19
19
  import { DIAGNOSTIC_MODE_ENABLED, DIAGNOSTIC_TELEMETRY_SCHEMA, } from "./diagnostics.js";
20
+ import { withWorkspaceRootSchema } from "./server/workspace-router.js";
21
+ // implements REQ-kibi-mcp-tool-consolidation
22
+ /**
23
+ * The agent-facing tool list. Narrower operations (kb_skills_list,
24
+ * kb_semantic_advisor, kb_model_requirement, kb_suggest_predicates,
25
+ * kb_validate_upsert) stay in the operation catalog and on the CLI; MCP
26
+ * reaches them through kb_skills, kb_model and kb_upsert dryRun so hosts
27
+ * load fewer tool definitions.
28
+ */
20
29
  const MCP_TOOL_ORDER = [
21
30
  "kb_query",
22
31
  "kb_search",
23
32
  "kb_status",
24
- "kb_skills_list",
25
- "kb_skills_load",
26
- "kb_skills_read",
33
+ "kb_skills",
27
34
  "kb_find_gaps",
28
35
  "kb_coverage",
29
36
  "kb_graph",
30
- "kb_sparql_remote",
31
- "kb_semantic_advisor",
37
+ "kb_model",
32
38
  "kb_upsert",
33
- "kb_validate_upsert",
34
39
  "kb_delete",
35
40
  "kb_check",
36
41
  "kb_prepare_impact_review",
37
- "kb_model_requirement",
38
- "kb_suggest_predicates",
39
42
  "kb_plan_bootstrap",
40
43
  "kb_compile_intent",
41
44
  "kb_apply_plan",
42
45
  "kb_ingest_proof",
43
46
  ];
47
+ /** Tools registered only when named in KIBI_MCP_OPTIONAL_TOOLS. */
48
+ // implements REQ-kibi-mcp-tool-consolidation
49
+ export const OPTIONAL_TOOL_NAMES = [
50
+ "kb_sparql_remote",
51
+ "kb_job_status",
52
+ ];
53
+ /**
54
+ * Parse KIBI_MCP_OPTIONAL_TOOLS: a comma-separated list of optional tool
55
+ * names, or "all".
56
+ */
57
+ // implements REQ-kibi-mcp-tool-consolidation
58
+ export function enabledOptionalTools(value = process.env.KIBI_MCP_OPTIONAL_TOOLS) {
59
+ const requested = new Set((value ?? "")
60
+ .split(",")
61
+ .map((entry) => entry.trim())
62
+ .filter(Boolean));
63
+ return new Set(OPTIONAL_TOOL_NAMES.filter((name) => requested.has("all") || requested.has(name)));
64
+ }
44
65
  // implements REQ-002
45
66
  const TOOL_ANNOTATIONS = {
46
67
  kb_query: {
@@ -56,6 +77,20 @@ const TOOL_ANNOTATIONS = {
56
77
  idempotentHint: true,
57
78
  openWorldHint: false,
58
79
  },
80
+ kb_skills: {
81
+ title: "Read bundled Kibi skills",
82
+ readOnlyHint: true,
83
+ destructiveHint: false,
84
+ idempotentHint: true,
85
+ openWorldHint: false,
86
+ },
87
+ kb_model: {
88
+ title: "Model Kibi requirement prose",
89
+ readOnlyHint: true,
90
+ destructiveHint: false,
91
+ idempotentHint: true,
92
+ openWorldHint: false,
93
+ },
59
94
  kb_skills_list: {
60
95
  title: "List bundled Kibi skills",
61
96
  readOnlyHint: true,
@@ -150,7 +185,15 @@ const TOOL_ANNOTATIONS = {
150
185
  openWorldHint: false,
151
186
  },
152
187
  };
153
- const BASE_TOOLS = MCP_TOOL_ORDER.map((name) => {
188
+ function exposedToolNames(optional) {
189
+ return [
190
+ ...MCP_TOOL_ORDER,
191
+ ...(optional.has("kb_sparql_remote")
192
+ ? ["kb_sparql_remote"]
193
+ : []),
194
+ ];
195
+ }
196
+ function toolConfig(name) {
154
197
  const spec = getSpec(name);
155
198
  const effects = spec.declaredEffects;
156
199
  const derived = {
@@ -172,7 +215,13 @@ const BASE_TOOLS = MCP_TOOL_ORDER.map((name) => {
172
215
  ...derived,
173
216
  },
174
217
  };
175
- });
218
+ }
219
+ /** Catalog tool configs for the base list plus the given optional tools. */
220
+ // implements REQ-kibi-mcp-tool-consolidation
221
+ export function buildBaseTools(optional = enabledOptionalTools()) {
222
+ return exposedToolNames(optional).map(toolConfig);
223
+ }
224
+ const BASE_TOOLS = buildBaseTools();
176
225
  /**
177
226
  * Inject _diagnostic_telemetry schema into tool inputs when diagnostic mode is enabled.
178
227
  * Exported for unit coverage; TOOLS still applies it only when the server starts
@@ -200,6 +249,6 @@ export function withDiagnosticTelemetrySchema(tools) {
200
249
  * Active tools list.
201
250
  * In diagnostic mode, all tools include the _diagnostic_telemetry parameter.
202
251
  */
203
- export const TOOLS = DIAGNOSTIC_MODE_ENABLED
252
+ export const TOOLS = withWorkspaceRootSchema(DIAGNOSTIC_MODE_ENABLED
204
253
  ? withDiagnosticTelemetrySchema(BASE_TOOLS)
205
- : [...BASE_TOOLS];
254
+ : [...BASE_TOOLS]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kibi-mcp",
3
- "version": "2.3.0",
3
+ "version": "3.0.0",
4
4
  "mcpName": "io.github.Looted/kibi-mcp",
5
5
  "dependencies": {
6
6
  "@modelcontextprotocol/sdk": "^1.30.0",
@@ -10,8 +10,8 @@
10
10
  "fast-glob": "^3.2.12",
11
11
  "gray-matter": "^4.0.3",
12
12
  "js-yaml": "^4.1.0",
13
- "kibi-runtime": "^2.1.0",
14
- "kibi-core": "^0.14.1",
13
+ "kibi-runtime": "^2.3.0",
14
+ "kibi-core": "^0.15.0",
15
15
  "mcpcat": "^0.1.12",
16
16
  "zod": "^4.3.6"
17
17
  },
@@ -29,7 +29,10 @@
29
29
  "typecheck": "tsc -p tsconfig.json --noEmit",
30
30
  "prepack": "npm run build && node ../../scripts/verify-package-contract.mjs kibi-mcp"
31
31
  },
32
- "files": ["dist", "bin"],
32
+ "files": [
33
+ "dist",
34
+ "bin"
35
+ ],
33
36
  "engines": {
34
37
  "node": ">=22"
35
38
  },