Skip to content

fix: stop obsidian-mcp orphaning when Claude Code exits (v1.1.0)#14

Merged
CryptoJones merged 1 commit into
mainfrom
fix/mcp-orphan-leak
Jun 4, 2026
Merged

fix: stop obsidian-mcp orphaning when Claude Code exits (v1.1.0)#14
CryptoJones merged 1 commit into
mainfrom
fix/mcp-orphan-leak

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Closes #13.

Summary

Fixes a process leak in the provisioned MCP server: obsidian-mcp instances piled up as orphans, one per Claude Code session, and tool calls could appear to hang.

  • 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.
  • 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.
  • The prerequisite check now requires npm rather than npx.
  • omind doctor flags a registration still using the leak-prone npx form and a missing stdin-EOF guard, pointing to omind setup to repair.

Full diagnosis in docs/troubleshooting.md. Bumps version to 1.1.0.

Test plan

  • pytest — 63 passed
  • ruff check . — clean
  • mypy src/omind — clean
  • omind doctor against the live vault — all checks pass, recognizes the already-migrated direct-node config and stdin-EOF guard

Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/

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>
@CryptoJones CryptoJones merged commit 79a3b18 into main Jun 4, 2026
3 checks passed
@CryptoJones CryptoJones deleted the fix/mcp-orphan-leak branch June 4, 2026 10:00
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.

obsidian-mcp orphans on Claude Code exit; tool calls can appear to hang

1 participant