Skip to content

[PR] fix: pass Claude Code's MCP config as --mcp-config=<file> so it cannot eat the prompt - #6524

Merged
ranxianglei merged 1 commit into
ranxianglei:masterfrom
MohammadErfan-Jabbari:2026-11-13_claude-mcp-config-prompt
Nov 15, 2026
Merged

ranxianglei merged 1 commit into
ranxianglei:masterfrom
MohammadErfan-Jabbari:2026-11-13_claude-mcp-config-prompt

Conversation

@MohammadErfan-Jabbari

Copy link
Copy Markdown
Contributor

Fixes #6523

Problem

The claude launcher prepends --mcp-config <file> to the client's arguments. Claude Code declares --mcp-config as variadic, so in bili claude "do X" the prompt is taken as a second config file and Claude Code exits with MCP config file not found: <cwd>/do X.

Fix

src/launcher.ts: one line, ["--mcp-config", mcpFile, ...] becomes [`--mcp-config=${mcpFile}`, ...]. One token carries the file, so the variadic list ends there and every later argument keeps its meaning. Claude Code reads the = form the same way as the two-token form.

Both compression modes

The change touches only the arguments the launcher hands to Claude Code; the MCP file, its contents and the request path are unchanged, so neither plugin mode nor proxy mode sees a difference on the wire.

Tests

  • tests/launcher.test.ts: new test runLaunch claude: the injected --mcp-config does not swallow a positional prompt. It launches a fake claude binary with a positional prompt and asserts that no bare --mcp-config token is passed, that an --mcp-config= token is, and that the prompt still arrives. It fails on master and passes with the fix.
  • The rest of tests/launcher.test.ts: 353 of 355 pass on this branch. runLaunch aider: nothing declared → default hosts whitelisted for cert-MITM (#1048) fails the same way on master without this change.
  • npm run typecheck clean.

Small fix: in one module with a regression test and no config, wire or kernel change, so it fits the §7.4 auto-merge gate.

🤖 Generated with Claude Code

…t eat the prompt

Claude Code's --mcp-config is variadic, so 'bili claude "do X"' failed with 'MCP config file not found: <cwd>/do X'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ranxianglei ranxianglei changed the title fix: pass Claude Code's MCP config as --mcp-config=<file> so it cannot eat the prompt [PR] fix: pass Claude Code's MCP config as --mcp-config=<file> so it cannot eat the prompt Nov 13, 2026
@ranxianglei
ranxianglei merged commit 73737b6 into ranxianglei:master Nov 15, 2026
48 checks passed
@ranxianglei

Copy link
Copy Markdown
Owner

Closes pair #6523 was auto-closed by the batch merge.

Superseded by #6765 (merged to master as 73737b6).

Your commit d86082e is in master verbatim — same content, same authorship, only the object ID changed (the batch used a real git merge, no rebase or cherry-pick rewrite). Merged under a different branch name, so GitHub does not flip this PR by itself.

Thanks for the fix — it is live in master from 73737b6 onward.

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.

bili claude "<prompt>" fails: the injected --mcp-config swallows the positional prompt

2 participants