From 7f0286dc40477ea04733a1fdb269028447d53b91 Mon Sep 17 00:00:00 2001 From: Riz Ashraf Date: Wed, 9 Sep 2026 14:14:55 +0100 Subject: [PATCH] docs: Update shutdown instructions and wake-cmd paths --- README.md | 7 ++++++- design.md | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dc6c1a6..1197918 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,11 @@ Copy-Item target\release\mcp-memory-stub.exe C:\Users\reazul.ashraf\.local\bin\m # Add this to your PowerShell profile: if (-not (Get-Process mcp-memory-server -ErrorAction SilentlyContinue)) { Start-Process -FilePath "C:\Users\reazul.ashraf\.local\bin\mcp-memory-server.exe" -ArgumentList "--daemon" -WindowStyle Hidden -ErrorAction SilentlyContinue } ``` + +**Shutting Down:** If you need to stop the background daemon (e.g., to replace the executable after a recompile), use the built-in `--exit` flag instead of forcefully killing the process. +```powershell +mcp-memory-server.exe --exit +``` ` **Step 2:** Update your Windows ~/.gemini/config/mcp_config.json to point the CLI to the ultra-lightweight stub (since the server is already running in the background): `json @@ -51,7 +56,7 @@ Update your WSL ~/.gemini/config/mcp_config.json: "command": "/home/riz/.local/bin/mcp-memory-stub", "args": [ "--target", "http://127.0.0.1:3000", - "--wake-cmd", "/mnt/c/Windows/System32/cmd.exe /c start /B C:\\Users\\reazul.ashraf\\.local\\bin\\mcp-memory-server.exe --daemon" + "--wake-cmd", "/mnt/c/Users/reazul.ashraf/.local/bin/mcp-memory-server.exe --daemon" ] } } diff --git a/design.md b/design.md index e431ccb..927f682 100644 --- a/design.md +++ b/design.md @@ -97,7 +97,7 @@ Every time a Windows gy session starts, it blindly spawns mcp-memory-stub.exe a To provide a seamless experience without complex configuration drift, the WSL environment utilizes a native Linux binary (`/home/riz/.local/bin/mcp-memory-stub`) that acts as a **Permanent Stub**. * **Transparent Proxying:** The WSL `agy` CLI spawns this Linux binary via standard `stdio`. The binary immediately proxies all `stdio` JSON-RPC requests over HTTP to the Windows Leader at `http://127.0.0.1:3000/messages`, handling SSE streams transparently. * **MPSC Queue Resilience:** The stub utilizes an asynchronous multi-producer, single-consumer (MPSC) channel queue. If the Windows Leader daemon restarts or momentarily drops, the proxy buffers incoming JSON-RPC tool calls and infinitely retries them until the connection is restored. This guarantees **zero message loss** and **zero thread leaks** without crashing the active `agy` session. -* **Startup via Interop:** Upon launch, the Linux Stub pings the Windows host. If port 3000 is dead, the Linux binary automatically executes WSL interop (`cmd.exe /c start /B C:\Users\reazul.ashraf\.local\bin\mcp-memory-server.exe --daemon`) to silently wake up the Windows Leader before commencing the proxy loop. +* **Startup via Interop:** Upon launch, the Linux Stub pings the Windows host. If port 3000 is dead, the Linux binary automatically executes the provided `wake-cmd` (e.g. `/mnt/c/Users/reazul.ashraf/.local/bin/mcp-memory-server.exe --daemon`) to silently wake up the Windows Leader before commencing the proxy loop. * **Zero I/O Penalty:** This ensures the Linux binary never directly touches the Windows NTFS files, reserving all heavy disk operations for the native Windows host. ## 13. Cargo Workspace & Binary Artifacts To optimize for different environments, the codebase is structured as a Cargo Workspace containing two distinct crates: