feat: single-instance daemon for shared hyperd across MCP clients#26
Open
StefanSteiner wants to merge 1 commit into
Open
feat: single-instance daemon for shared hyperd across MCP clients#26StefanSteiner wants to merge 1 commit into
StefanSteiner wants to merge 1 commit into
Conversation
A lightweight daemon manages one shared hyperd process per user so
multiple AI clients (Claude Code, Cursor, VS Code, etc.) can access the
same persistent databases simultaneously with reduced resource overhead.
Architecture:
- TCP port binding as cross-platform single-instance lock
- Discovery file at ~/.hyperdb/daemon.json (overridable via HYPERDB_STATE_DIR)
- Health protocol (PING/HEARTBEAT/STOP/STATUS) for liveness and idle tracking
- Auto-spawn: MCP clients transparently start the daemon if none is running
- Idle timeout (default 30 min) with heartbeat-based keep-alive
- Ephemeral databases DETACH + delete on session end (Windows-safe)
- --no-daemon flag to opt out and use legacy per-client hyperd
New files:
- hyperdb-mcp/src/daemon/{mod,discovery,health,run,spawn}.rs
- hyperdb-mcp/tests/daemon_tests.rs (26 tests: unit + integration)
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.
Summary
hyperdprocess per user, so multiple AI clients (Claude Code, Cursor, VS Code Copilot, etc.) share one database engine instead of each spawning their ownArchitecture
Key design decisions:
~/.hyperdb/daemon.json(overridable viaHYPERDB_STATE_DIR)--no-daemonflag to opt out and use legacy per-clienthyperdNew CLI commands
Test plan
daemon_tests.rscovering:cargo clippyandcargo fmtclean--no-daemonspawns private hyperd