Skip to content

fix: run MCP tool commands with stdin redirected to /dev/null - #159

Merged
Martin Bens (SpiGAndromeda) merged 1 commit into
mainfrom
fix/mcp-exec-stdin-hang
Aug 27, 2026
Merged

Martin Bens (SpiGAndromeda) merged 1 commit into
mainfrom
fix/mcp-exec-stdin-hang

Conversation

@SpiGAndromeda

Copy link
Copy Markdown
Collaborator

No description provided.

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>
@github-actions

Copy link
Copy Markdown

@SpiGAndromeda
Martin Bens (SpiGAndromeda) merged commit 3e54791 into main Aug 27, 2026
13 checks passed
@SpiGAndromeda
Martin Bens (SpiGAndromeda) deleted the fix/mcp-exec-stdin-hang branch August 27, 2026 00:48
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.

1 participant