Problem
runMCP includes the root defineGroup name in every tool path. For:
const root = defineGroup({
name: "todos-mcp",
children: [defineGroup({ name: "slack", … })],
});
runMCP(root, { name: "todos-mcp", version: "0.1.0" });
tools are exposed as todos_mcp__slack__fetch_messages. The MCP host already prepends its own mcp__<server>__, so the root name is redundant prefixing. Today the only workaround is name: "" on the root group, which also nukes the commander program name in CLI mode (program.name("")).
Source: packages/toolcraft/dist/mcp.js:
const rootPath = root.name.length === 0 ? [] : [root.name];
Proposal
Change enumerateTools to always start with rootPath = []. The root group's name stays a CLI concept (program name, help breadcrumb); MCP tool paths are built only from child groups and commands. Result above becomes slack__fetch_messages.
The MCP server name is already passed separately via runMCP(root, { name, version }), so nothing is lost.
Problem
runMCPincludes the rootdefineGroupname in every tool path. For:tools are exposed as
todos_mcp__slack__fetch_messages. The MCP host already prepends its ownmcp__<server>__, so the root name is redundant prefixing. Today the only workaround isname: ""on the root group, which also nukes the commander program name in CLI mode (program.name("")).Source:
packages/toolcraft/dist/mcp.js:Proposal
Change
enumerateToolsto always start withrootPath = []. The root group'snamestays a CLI concept (program name, help breadcrumb); MCP tool paths are built only from child groups and commands. Result above becomesslack__fetch_messages.The MCP server name is already passed separately via
runMCP(root, { name, version }), so nothing is lost.