Skip to content

fix(toolcraft): add opt-in mcp root prefix omission#277

Merged
kamilio merged 2 commits intomainfrom
fix/toolcraft-mcp-root-prefix
May 4, 2026
Merged

fix(toolcraft): add opt-in mcp root prefix omission#277
kamilio merged 2 commits intomainfrom
fix/toolcraft-mcp-root-prefix

Conversation

@poe-code-agent
Copy link
Copy Markdown
Contributor

@poe-code-agent poe-code-agent Bot commented May 3, 2026

Summary

  • Keep Toolcraft's default MCP tool names root-prefixed.
  • Add omitRootToolNamePrefix: true as an opt-in for single-root MCP servers that want rootless tool names.
  • Opt terminal-pilot-mcp and markdown-reader MCP entrypoints/tests into rootless names and update related docs/tests.

Fixes #276.

Tests

  • npm run test:unit -- packages/toolcraft/src/toolcraft.test.ts packages/toolcraft/src/entrypoints-mcp-proxy.test.ts packages/toolcraft/src/human-in-loop/approvals-commands.test.ts packages/toolcraft/src/human-in-loop/mcp-runtime.integration.test.ts packages/toolcraft/src/mcp-proxy-integration.test.ts packages/toolcraft/src/mcp-runtime-options.test.ts packages/toolcraft-openapi/src/define-client.test.ts packages/toolcraft-openapi/src/runtime.test.ts packages/markdown-reader/src/mcp/tools.test.ts packages/terminal-pilot-mcp/src/mcp-tools.test.ts --reporter=dot
  • npm run test:unit -- packages/terminal-pilot-mcp/src/mcp-server.test.ts packages/markdown-reader/src/mcp/run.test.ts packages/terminal-pilot-mcp/src/mcp-tools.test.ts packages/markdown-reader/src/mcp/tools.test.ts --reporter=dot
  • npm run lint:types
  • npx eslint packages/toolcraft/src/mcp.ts packages/toolcraft/src/toolcraft.test.ts packages/toolcraft/src/entrypoints-mcp-proxy.test.ts packages/toolcraft/src/human-in-loop/approvals-commands.test.ts packages/toolcraft/src/human-in-loop/mcp-runtime.integration.test.ts packages/toolcraft/src/mcp-proxy-integration.test.ts packages/toolcraft/src/mcp-runtime-options.test.ts packages/toolcraft-openapi/src/define-client.test.ts packages/toolcraft-openapi/src/runtime.test.ts packages/markdown-reader/src/mcp/run.ts packages/markdown-reader/src/mcp/tools.test.ts packages/terminal-pilot-mcp/src/index.ts packages/terminal-pilot-mcp/src/mcp-tools.test.ts
  • pre-push: npm run test

Copy link
Copy Markdown
Contributor Author

@poe-code-agent poe-code-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -154,8 +154,8 @@ Agent-side configuration example (Claude Code `~/.claude.json` or `.mcp.json`):

MCP tool names exposed by this server (derived by toolcraft from `group.name + command.name`):
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This explanatory text still describes the old root-prefixed derivation.

Suggested change
MCP tool names exposed by this server (derived by toolcraft from `group.name + command.name`):
MCP tool names exposed by this server (derived by toolcraft from command path segments below the root group):

@kamilio
Copy link
Copy Markdown
Collaborator

kamilio commented May 4, 2026

@poe-code-agent actually, don't change the default

@poe-code-agent poe-code-agent Bot changed the title fix(toolcraft): omit root group from mcp tool names fix(toolcraft): add opt-in mcp root prefix omission May 4, 2026
@poe-code-agent
Copy link
Copy Markdown
Contributor Author

poe-code-agent Bot commented May 4, 2026

@kamilio done — the default is unchanged now.

I updated the PR so Toolcraft still keeps the root group prefix by default, and added omitRootToolNamePrefix: true as the explicit opt-in for rootless single-root MCP tool names. I also updated the affected MCP entrypoints/tests to opt in where rootless names are expected.

Verified with targeted unit tests, lint:types, targeted ESLint, and pre-push npm run test.

Copy link
Copy Markdown
Contributor Author

@poe-code-agent poe-code-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kamilio kamilio merged commit b1b8875 into main May 4, 2026
4 checks passed
@kamilio kamilio deleted the fix/toolcraft-mcp-root-prefix branch May 4, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

toolcraft: drop root group name from MCP tool prefix

1 participant