fix: stop obsidian-mcp orphaning when Claude Code exits (v1.1.0)#14
Merged
Conversation
The provisioned obsidian-mcp server piled up as orphaned processes, one per Claude Code session, and tool calls could appear to hang. Root cause was two-fold: the server never exits on stdin EOF (its chokidar file watcher keeps the Node event loop alive), and the `npx -y obsidian-mcp` wrapper chain swallowed the termination signal before it reached Node. `omind setup` now registers the server as a direct `node --require <eof-guard> <obsidian-mcp> <vault>/OMI` command instead of `npx -y obsidian-mcp`. obsidian-mcp is installed to a stable prefix (~/.claude/mcp-servers/obsidian) rather than the garbage-collectable npx cache, and a small stdin-EOF guard preload makes the server exit cleanly on disconnect. Existing npx-form registrations are migrated automatically on the next `omind setup`. `omind doctor` now flags a registration still using the leak-prone npx form and a missing stdin-EOF guard, pointing to `omind setup` to repair. The prerequisite check now requires `npm` (used to install the pinned server) rather than `npx`. Full diagnosis in docs/troubleshooting.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Closes #13.
Summary
Fixes a process leak in the provisioned MCP server:
obsidian-mcpinstances piled up as orphans, one per Claude Code session, and tool calls could appear to hang.omind setupnow registers the server as a directnode --require <eof-guard> <obsidian-mcp> <vault>/OMIcommand instead ofnpx -y obsidian-mcp.obsidian-mcpis installed to a stable prefix (~/.claude/mcp-servers/obsidian) rather than the garbage-collectable npx cache.omind setup.npmrather thannpx.omind doctorflags a registration still using the leak-prone npx form and a missing stdin-EOF guard, pointing toomind setupto repair.Full diagnosis in
docs/troubleshooting.md. Bumps version to 1.1.0.Test plan
pytest— 63 passedruff check .— cleanmypy src/omind— cleanomind doctoragainst the live vault — all checks pass, recognizes the already-migrated direct-node config and stdin-EOF guardProudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/