Effect CommunityEC
Effect Community6mo ago
12 replies
vivi

Issues with `layerStdio` in @effect/ai McpServer causing orphaned processes when using Claude Code

The @effect/ai McpServer with 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:

{
  "mcpServers": {
    "effect_docs": {
      "type": "stdio",
      "command": "docker",
      "args": ["run", "--rm", "-i", "timsmart/effect-mcp"]
    }
  }
}


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
Was this page helpful?