fix(standalone): use mcp__context-mode__ prefix when CLAUDE_PLUGIN_ROOT is absent#913
Open
eejd wants to merge 1 commit into
Open
fix(standalone): use mcp__context-mode__ prefix when CLAUDE_PLUGIN_ROOT is absent#913eejd wants to merge 1 commit into
eejd wants to merge 1 commit into
Conversation
…OT is absent Standalone installs (MacPorts, npm global) register the MCP server as "context-mode" via settings.json, which yields mcp__context-mode__<tool> names. Plugin installs set CLAUDE_PLUGIN_ROOT and yield the plugin- namespaced form. Guidance text and ToolSearch bootstraps now use the correct prefix based on the install mode at runtime. - hooks/core/tool-naming.mjs: claude-code branch checks CLAUDE_PLUGIN_ROOT - src/adapters/claude-code/hooks.ts: comment explaining mcp__ covers both - tests: updated to assert standalone form (no CLAUDE_PLUGIN_ROOT in env) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Complements #810 (merged) which fixed standalone installs (MacPorts, npm global) silently skipping
settings.jsonhook wiring.Problem
Standalone installs register the MCP server as
context-modeviasettings.json, which yieldsmcp__context-mode__<tool>names. Plugin installs setCLAUDE_PLUGIN_ROOTand yield the plugin-namespaced form instead. Guidance text and ToolSearch bootstraps were hardcoded to the plugin-namespaced form regardless of install mode, so standalone installs got incorrect tool-name references.Fix
hooks/core/tool-naming.mjs's claude-code branch now checksCLAUDE_PLUGIN_ROOTat runtime and emits the correct prefix for the actual install mode.src/adapters/claude-code/hooks.tsgets a clarifying comment thatmcp__covers both forms. Tests updated to assert the standalone form (noCLAUDE_PLUGIN_ROOTin env).Testing
tests/core/routing.test.ts,tests/hooks/integration.test.ts,tests/hooks/tool-naming.test.ts) to cover both plugin and standalone install modes.mcp__context-mode__ctx_*.Affected platforms
Checklist
npm testpassesnpm run typecheckpassesnextbranch