MCP memory path resolver
#2631 — the knowledge-graph silently never persisted. Flip the config and the launch env to see exactly where the path resolution breaks, and why the fix lands.
.mcp.json memory config
before · env MEMORY_FILE_PATH = "${CLAUDE_PROJECT_DIR:-.}/…"
after · sh -c wrapper (runtime)
CLAUDE_PROJECT_DIR in the server's launch env
present (CC docs: yes)
absent
Two independent facts cause the bug: (1) ${CLAUDE_PROJECT_DIR} does NOT expand inside a project .mcp.json — CC expands it against its own env, which lacks the var, so the :-. default wins. (2) server-memory joins a RELATIVE MEMORY_FILE_PATH to its own dist/ dir (not CWD), so ./… lands in the npx cache → ENOENT. The fix defers resolution to a shell wrapper that reads the server-env $CLAUDE_PROJECT_DIR (fallback $PWD) and exports an ABSOLUTE path.