Skip to content

fix: .mcp.json path fallback so the server also starts from a plain clone - #3

Merged
BenKalsky merged 2 commits into
mainfrom
claude/add-tools-cloud-env-vj458p
Jul 21, 2026
Merged

fix: .mcp.json path fallback so the server also starts from a plain clone#3
BenKalsky merged 2 commits into
mainfrom
claude/add-tools-cloud-env-vj458p

Conversation

@BenKalsky

Copy link
Copy Markdown
Member

Why

${CLAUDE_PLUGIN_ROOT} only expands when the repo is loaded as an installed plugin. claude.ai cloud sessions load a repo's .mcp.json straight from the clone, where the variable is unset — so the committed config could not resolve dist/bundle.mjs there.

What

  • args becomes ${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.
  • README notes the dual-context behavior and that SUMIT_* values come from the environment (cloud environments: the environment's env vars). Without the required SUMIT_MAIN_COMPANY_ID/SUMIT_MAIN_API_KEY the 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.json deliberately does not enable enableAllProjectMcpServers here — 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

…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
Copilot AI review requested due to automatic review settings July 21, 2026 11:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.json to fall back to ./dist/bundle.mjs when CLAUDE_PLUGIN_ROOT is 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.

Comment thread README.md Outdated

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
Copilot AI review requested due to automatic review settings July 21, 2026 11:54

Copy link
Copy Markdown
Member Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: b86dddaa2c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.json now 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).

@BenKalsky
BenKalsky merged commit 8509765 into main Jul 21, 2026
6 checks passed
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.

3 participants