fix: run MCP tool commands with stdin redirected to /dev/null - #159
Merged
Merged
Conversation
The exec layer shared by the MCP servers ran every wrapped tool command via `eval` with the server's stdin inherited. That stdin is the JSON-RPC pipe from the MCP client, and the docker wrappers forward it into the container through `docker exec -i`, so a tool child that reads stdin blocked forever on the open, never-delivering pipe and the whole tool call hung with no result. Observed with a shopware PHPUnit test whose Symfony confirm prompt falls back to reading STDIN. A reading child could also have consumed protocol bytes meant for the server. `exec_command` and `exec_npm_command` in `templates/mcp-shared/environment.sh` now redirect the eval's stdin to /dev/null, propagated byte-identically to the dev-tooling and shopware-env copies. Children get immediate EOF, so interactive prompts fall back to their defaults instead of waiting. Regression tests feed data on the call's stdin and assert it is not consumed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Agent Skills ExportBuilt 7 skill packages: |
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.
No description provided.