Skip to content

/exit hangs MCP Server #515

Description

@kawaxi

Summary

/exit hangs when an stdio MCP server is connected. On /exit, the graceful shutdown awaits the MCP child process exit but never calls the stdio transport's close() (which does stdin.end() + kill()), so the server stays alive waiting for input → deadlock.

Expected Behavior

/exit should close()/SIGTERM MCP children (with SIGKILL escalation) before awaiting, or just process.exit() and let killTrackedChildren handle them.

Actual Behavior

Killing the MCP process manually lets /exit complete instantly. Ctrl-C works because SIGINT reaches the whole process group.

Steps to reproduce the issue

any stdio MCP server that doesn't self-exit on idle; e.g. obsidian-mcp-server.

Command Code Version

0.40.2

Operating System

macOS

Terminal/IDE

iTerm2

Shell

zsh

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions