toolcraft 0.0.10 → 0.0.11

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 CHANGED
@@ -459,6 +459,7 @@ If you have an existing MCP server you want to keep running, use the MCP proxy:
459
459
  - `services?` / `humanInLoop?` / `apiVersion?`
460
460
  - `projectRoot?: string` — root used for MCP proxy cache files (`.toolcraft/mcp/*.json`).
461
461
  - `tools?: string[]` — allowlist of MCP tool names or group prefixes. Tool names are `__`-joined snake_case path segments (`root__bot__create`); a prefix like `root__bot` includes every descendant tool.
462
+ - `omitRootToolNamePrefix?: boolean` — defaults to `false`. Set to `true` to omit the root group name from single-root MCP tool names (`bot__create`).
462
463
  - `casing?: "snake" | "camel"` — affects MCP **input-schema property names** only. Tool names always stay `__`-joined snake_case.
463
464
 
464
465
  ### `HumanInLoopRuntimeOptions`
package/dist/mcp.d.ts CHANGED
@@ -20,6 +20,12 @@ export interface RunMCPOptions<TServices extends object = Record<string, unknown
20
20
  * that subtree.
21
21
  */
22
22
  tools?: string[];
23
+ /**
24
+ * Omit the root group name from MCP tool names for a single root group.
25
+ *
26
+ * Defaults to false, so existing MCP tool names keep the root group prefix.
27
+ */
28
+ omitRootToolNamePrefix?: boolean;
23
29
  services?: TServices;
24
30
  /**
25
31
  * Controls MCP input-schema key casing and accepted argument-key casing.
package/dist/mcp.js CHANGED
@@ -162,7 +162,7 @@ function matchesAllowlist(toolName, allowlist) {
162
162
  function formatToolName(path) {
163
163
  return path.map((segment) => formatSegment(segment, "snake")).join("__");
164
164
  }
165
- function enumerateTools(root, casing, allowlist) {
165
+ function enumerateTools(root, casing, allowlist, omitRootToolNamePrefix) {
166
166
  const tools = [];
167
167
  function visit(node, toolPath, commandPath) {
168
168
  if (node.kind === "command") {
@@ -192,7 +192,7 @@ function enumerateTools(root, casing, allowlist) {
192
192
  visit(child, nextToolPath, nextCommandPath);
193
193
  }
194
194
  }
195
- const rootPath = root.name.length === 0 ? [] : [root.name];
195
+ const rootPath = omitRootToolNamePrefix || root.name.length === 0 ? [] : [root.name];
196
196
  for (const child of root.children) {
197
197
  visit(child, rootPath, []);
198
198
  }
@@ -365,7 +365,7 @@ function createResolvedMCPServer(root, options) {
365
365
  root,
366
366
  };
367
367
  validateServices(services);
368
- const tools = enumerateTools(root, casing, options.tools);
368
+ const tools = enumerateTools(root, casing, options.tools, options.omitRootToolNamePrefix ?? false);
369
369
  const version = resolveMCPVersion(options.version);
370
370
  const server = createServer({ name: options.name, version });
371
371
  for (const tool of tools) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolcraft",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -45,7 +45,7 @@
45
45
  "commander": "^14.0.3",
46
46
  "console-table-printer": "^2.15.0",
47
47
  "tiny-stdio-mcp-server": "^0.1.0",
48
- "toolcraft-schema": "^0.0.10"
48
+ "toolcraft-schema": "^0.0.11"
49
49
  },
50
50
  "files": [
51
51
  "dist"