fix: .mcp.json path fallback so the server also starts from a plain clone - #3
Conversation
…lone
${CLAUDE_PLUGIN_ROOT} only expands when the repo is loaded as a plugin; with the :-. fallback the same committed config resolves dist/bundle.mjs from the repo root too, which is how claude.ai cloud sessions load a repo's .mcp.json. Placeholders-only policy unchanged - SUMIT_* values still come from the environment, and the server does not start without the required ones. README documents the cloud route.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wNQYbS2Umgd7RWV8CAyYa
There was a problem hiding this comment.
Pull request overview
Adjusts the MCP server configuration so the repo’s committed .mcp.json can start the built server bundle both when used as an installed Claude plugin (with CLAUDE_PLUGIN_ROOT set) and when used directly from a plain git clone (including claude.ai cloud sessions).
Changes:
- Update
.mcp.jsonto fall back to./dist/bundle.mjswhenCLAUDE_PLUGIN_ROOTis unset. - Add README documentation describing the dual plugin-vs-clone behavior and env-var sourcing in cloud sessions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Documents the dual-context .mcp.json behavior and env-var requirements. |
| .mcp.json | Adds a ${CLAUDE_PLUGIN_ROOT:-.} fallback so the bundle path resolves from a plain clone. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| See [`.claude/skills/sumit-mcp/references/installation.md`](.claude/skills/sumit-mcp/references/installation.md): clone, `pnpm install && pnpm build`, set `SUMIT_*` env, connect via `claude mcp add` or `.mcp.json`. | ||
|
|
||
| The committed [`.mcp.json`](.mcp.json) holds env-var placeholders only and runs the committed `dist/bundle.mjs`, so it works both as the plugin's MCP config (`${CLAUDE_PLUGIN_ROOT}` set by the plugin cache) and straight from a clone — including claude.ai cloud sessions, where the `SUMIT_*` values come from the cloud environment's env vars. Without `SUMIT_MAIN_COMPANY_ID`/`SUMIT_MAIN_API_KEY` set, the server simply doesn't start; charging additionally stays behind its own env opt-ins (below). |
…ilot round-1)
The README implied the server process fails to boot without the required vars; actually Claude Code rejects the config with bare unset ${VAR} placeholders and never launches it, while the process itself would boot with zero accounts and error at tool-call time. Reworded to state both layers and why the bare placeholders are deliberate (fail closed for the billing server).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wNQYbS2Umgd7RWV8CAyYa
|
@codex review Generated by Claude Code |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
README.md:24
- README references the plugin config as using
${CLAUDE_PLUGIN_ROOT}, but.mcp.jsonnow uses${CLAUDE_PLUGIN_ROOT:-.}. Updating this wording avoids confusion about the fallback-to-clone behavior this PR introduces.
The committed [`.mcp.json`](.mcp.json) holds env-var placeholders only and runs the committed `dist/bundle.mjs`, so it works both as the plugin's MCP config (`${CLAUDE_PLUGIN_ROOT}` set by the plugin cache) and straight from a clone — including claude.ai cloud sessions, where the `SUMIT_*` values come from the cloud environment's env vars. `SUMIT_MAIN_COMPANY_ID`/`SUMIT_MAIN_API_KEY` are deliberately bare `${VAR}` placeholders: when they're unset, Claude Code rejects the config and never launches the server (fail closed) — the server process itself would boot with zero accounts and only error at tool-call time. Charging additionally stays behind its own env opt-ins (below).
Why
${CLAUDE_PLUGIN_ROOT}only expands when the repo is loaded as an installed plugin. claude.ai cloud sessions load a repo's.mcp.jsonstraight from the clone, where the variable is unset — so the committed config could not resolvedist/bundle.mjsthere.What
argsbecomes${CLAUDE_PLUGIN_ROOT:-.}/dist/bundle.mjs— plugin installs keep resolving from the plugin cache; a plain clone (including cloud sessions) resolves the committed bundle from the repo root.SUMIT_*values come from the environment (cloud environments: the environment's env vars). Without the requiredSUMIT_MAIN_COMPANY_ID/SUMIT_MAIN_API_KEYthe server simply doesn't start.Safety
No change to the safety model: placeholders-only policy in the tracked file is unchanged, charge gating (
SUMIT_ALLOW_CHARGE,SUMIT_CONFIRM_SECRET, amount cap) untouched, no secrets anywhere in the diff..claude/settings.jsondeliberately does not enableenableAllProjectMcpServershere — the money-moving server keeps explicit approval.Part of the toolbox cloud-connectivity rollout — sibling PRs in cloudways-mcp, hostinger-mcp, aura-mcp, siteagent-elementor-studio, and the env-var onboarding table in agent-skills.
🤖 Generated with Claude Code
https://claude.ai/code/session_014wNQYbS2Umgd7RWV8CAyYa
Generated by Claude Code