Issues with `layerStdio` in @effect/ai McpServer causing orphaned processes when using Claude Code
The @effect/ai McpServer with
This happens for both my Effect-based MCP and @Tim Smart's Effect docs MCP: https://github.com/tim-smart/effect-mcp
For example, if I set up this
And then run any claude non-interactive command, like
layerStdio doesn't seem to consistently shut down properly with Claude Code, especially when run with the --print/-p flag or via the Claude Code SDK. So I'm getting hundreds of orphaned node processes.This happens for both my Effect-based MCP and @Tim Smart's Effect docs MCP: https://github.com/tim-smart/effect-mcp
For example, if I set up this
.mcp.json file:And then run any claude non-interactive command, like
claude -p "hello" --output-format stream-json --verbose, the docker container stays running afterward, and new ones are created for every claude command until there are hundreds of orphaned containers