mirror of
https://github.com/mksglu/context-mode.git
synced 2026-10-02 04:14:38 +08:00
Root cause: .mcp.json source template has flip-flopped 3 times (d114a19placeholder →1106e03relative →728d841placeholder →aea633c#253 relative →2a9cabfplaceholder restore) because it serves two conflicting masters: 1. Contributors developing context-mode: cwd = repo root, so 'args: ["./start.mjs"]' (relative) works AND avoids Claude Code's 'Missing environment variable: CLAUDE_PLUGIN_ROOT' warning during local dev. 2. End-users via marketplace install: cwd = arbitrary session dir, so 'args: ["${CLAUDE_PLUGIN_ROOT}/start.mjs"]' (placeholder) is the only form that resolves correctly. Every attempt to satisfy one role broke the other. The asymmetric heal in v1.0.119 #523 (healPluginJsonMcpServers covered .claude-plugin/ plugin.json but missed sibling .mcp.json) made the regression invisible on /ctx-upgrade flow while breaking every fresh npm install. Architectural fix: stop tracking .mcp.json as source-of-truth. - git rm --cached .mcp.json (kept on disk for contributor dev mode) - Add .mcp.json to .gitignore — can never regress again - Remove .mcp.json from package.json files[] — never ships to npm - Add .mcp.json.example with the placeholder form as the canonical template; contributors copy it to .mcp.json for local dev End-user flow stays clean: - .claude-plugin/plugin.json mcpServers (Claude Code's primary read path for installed plugins) always uses ${CLAUDE_PLUGIN_ROOT} - cli.ts upgrade() still writes .mcp.json to plugin cache with placeholder (#411 fix, unchanged) — the only path that puts a .mcp.json into a fresh end-user install location - scripts/heal-installed-plugins.mjs Layer 5 can self-heal any poisoned .mcp.json from v1.0.115-v1.0.121 installs (continuation agent slices 2-10) This commit closes the architectural class permanently. The earlier commit2a9cabf(restore placeholder in source) is preserved in history as the immediate one-line revert, but this commit removes the file from the source ledger so the dual-purpose conflict no longer applies.
9 lines
129 B
JSON
9 lines
129 B
JSON
{
|
|
"mcpServers": {
|
|
"context-mode": {
|
|
"command": "node",
|
|
"args": ["${CLAUDE_PLUGIN_ROOT}/start.mjs"]
|
|
}
|
|
}
|
|
}
|