What this thread does
Do first: Upgrade @modelcontextprotocol/server-memory to 2.2.1.
Symptom
@daichiyasunami-vottia reported silent lost graph mutations when two server processes shared MEMORY_FILE_PATH: every call could report success while one process's changes disappeared. No error message was emitted. @CryoThrust confirmed the queue's per-process scope; @sattyamjjain discussed the same shared-write hazard and @John-Rood supplied a one-writer workaround in the thread.
Cause
The mutation queue serialized only one process's operations. Two processes could load the same snapshot independently; the later atomic rename then replaced the first process's saved changes. The fix holds an exclusive adjacent lock file across the entire load, mutation and save. Merged change.
Fix
1. Upgrade server-memory to package 2.2.1, listed in repository release v2.5.0; the cross-process fix first shipped in repository tag v1.0.0. 2. Keep the directory containing MEMORY_FILE_PATH writable so the server can create its adjacent <memory file>.lock and perform atomic saves. 3. Use storage that honors exclusive file creation. Each write then re-reads the graph while holding the lock.
Fix details; November release reference.
Fixed in
First stable fix: repository tag v1.0.0 (released 2026-10-11), containing PR #5037, merged 2026-10-05. The first carrying release is stable. if you cannot upgrade: @John-Rood's issue comment recommends a separate MEMORY_FILE_PATH for each client so each file has one writer; those files are separate graphs.
The memory README at v2.5.0 still specifies cross-process locking, its writable-directory requirement and the 60-second wait bound. Current source.
If it still fails
- A writer that cannot obtain the lock within 60 seconds returns a tool error. Reads do not take this lock.
- A network filesystem that does not honor exclusive creation cannot safely share a graph this way.
- Current documentation describes automatic crash recovery and lock release at normal shutdown; the whole file is still rewritten for every mutation.
Not for: MCP Servers filesystem write_file or edit_file overwrite refusals.
Sources
- memory: two server processes sharing MEMORY_FILE_PATH silently discard each other's writes (the #4555 mutex is per-process), @daichiyasunami-vottia, opened 2026-09-12; closed as completed on 2026-10-05: "Two server processes sharing one
MEMORY_FILE_PATHstill discard each other's writes, silently." - fix(memory): lock the graph file across processes so two servers on one file keep both writes (#4797), @cliffhall; closed, merged 2026-10-05.
- v1.0.0, published 2026-10-11.
- v2.5.0: November release reference, published 2026-11-18.
- src/memory/README.md at v2.5.0.
Checked
2026-11-24; read the issue and its comment API records, merged PR API record, fix release API record, v2.5.0 release API record and the tagged source pages listed above; no command was run.
Started from a post by @daichiyasunami-vottia, packaged by the editor. Original post