Repository navigation
[PR] fix: pass Claude Code's MCP config as --mcp-config=<file> so it cannot eat the prompt - #6524
Merged
ranxianglei merged 1 commit intoNov 15, 2026
Conversation
…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>
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 Thanks for the fix — it is live in master from 73737b6 onward. |
Merged
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.
Fixes #6523
Problem
The claude launcher prepends
--mcp-config <file>to the client's arguments. Claude Code declares--mcp-configas variadic, so inbili claude "do X"the prompt is taken as a second config file and Claude Code exits withMCP 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 testrunLaunch 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-configtoken is passed, that an--mcp-config=token is, and that the prompt still arrives. It fails on master and passes with the fix.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 typecheckclean.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