Summary
mempalace_status (and by extension the MCP mempalace_status tool) returns {"error": "No palace found", "hint": "Run: mempalace init <dir> && mempalace mine <dir>"} even when the palace is correctly configured, as long as no drawers have ever been added. The hint is misleading because mempalace init has already been run successfully.
Reproduction
mempalace init <vault_dir> --yes (produces mempalace.yaml, creates ~/.mempalace/config.json and ~/.mempalace/palace/chroma.sqlite3)
- Register the MCP server:
claude mcp add mempalace --scope user -- /path/to/venv/bin/python -m mempalace.mcp_server
- From a Claude Code session, call
mempalace_status.
- Observe:
{"error": "No palace found", "hint": "Run: mempalace init <dir> && mempalace mine <dir>"}
- Call
mempalace_add_drawer with any content.
- Call
mempalace_status again. Now returns a normal response with total_drawers: 1.
Root cause
tool_status() in mempalace/mcp_server.py:261 calls _get_collection() with the default create=False. That helper at mcp_server.py:181 calls client.get_collection(_config.collection_name), which raises when the collection does not yet exist in ChromaDB (the zero-drawer state). The exception is swallowed and _get_collection returns None, so status falls through to _no_palace() at mcp_server.py:201.
The palace is actually fine: config.json, mempalace.yaml, and chroma.sqlite3 are all present and valid. The ChromaDB collection just hasn't been created yet because nothing has been stored. The first mempalace_add_drawer call bootstraps the collection (via get_or_create_collection in the write path) and status then works correctly.
Impact
- For users following an "accrete from live conversations" seeding strategy (no
mempalace mine), the first status call after setup is misleading. It suggests the palace is broken and that init needs to be re-run, when in fact everything is wired correctly.
- The MCP protocol doc (in the
PALACE_PROTOCOL constant shown in the status response) tells the AI to call mempalace_status on wake-up. On a fresh palace, that first call returns an error the AI then has to reason around.
Suggested fix
Either:
- In
tool_status(), call _get_collection(create=True) so an empty collection is created on first status call, then report total_drawers: 0 normally. Low risk, matches what add_drawer already does.
- Or distinguish "no palace config" (truly uninitialized —
config.json missing, palace_path does not exist) from "palace configured but collection empty" and return a dedicated response for the latter, e.g. {"status": "empty", "palace_path": ..., "total_drawers": 0} with guidance to add a drawer or run mine.
Option 1 is the smaller change. Option 2 is clearer for tooling that wants to distinguish the two states.
Environment
- MemPalace installed from git (editable install)
- Python 3.13 (Homebrew), dedicated venv
- macOS 15.4 (Darwin 25.4.0)
- MCP server registered globally via Claude Code, no
--palace arg (defaults to ~/.mempalace/palace/ via config.json)
Summary
mempalace_status(and by extension the MCPmempalace_statustool) returns{"error": "No palace found", "hint": "Run: mempalace init <dir> && mempalace mine <dir>"}even when the palace is correctly configured, as long as no drawers have ever been added. The hint is misleading becausemempalace inithas already been run successfully.Reproduction
mempalace init <vault_dir> --yes(producesmempalace.yaml, creates~/.mempalace/config.jsonand~/.mempalace/palace/chroma.sqlite3)claude mcp add mempalace --scope user -- /path/to/venv/bin/python -m mempalace.mcp_servermempalace_status.{"error": "No palace found", "hint": "Run: mempalace init <dir> && mempalace mine <dir>"}mempalace_add_drawerwith any content.mempalace_statusagain. Now returns a normal response withtotal_drawers: 1.Root cause
tool_status()inmempalace/mcp_server.py:261calls_get_collection()with the defaultcreate=False. That helper atmcp_server.py:181callsclient.get_collection(_config.collection_name), which raises when the collection does not yet exist in ChromaDB (the zero-drawer state). The exception is swallowed and_get_collectionreturnsNone, so status falls through to_no_palace()atmcp_server.py:201.The palace is actually fine:
config.json,mempalace.yaml, andchroma.sqlite3are all present and valid. The ChromaDB collection just hasn't been created yet because nothing has been stored. The firstmempalace_add_drawercall bootstraps the collection (viaget_or_create_collectionin the write path) and status then works correctly.Impact
mempalace mine), the first status call after setup is misleading. It suggests the palace is broken and thatinitneeds to be re-run, when in fact everything is wired correctly.PALACE_PROTOCOLconstant shown in the status response) tells the AI to callmempalace_statuson wake-up. On a fresh palace, that first call returns an error the AI then has to reason around.Suggested fix
Either:
tool_status(), call_get_collection(create=True)so an empty collection is created on first status call, then reporttotal_drawers: 0normally. Low risk, matches whatadd_draweralready does.config.jsonmissing,palace_pathdoes not exist) from "palace configured but collection empty" and return a dedicated response for the latter, e.g.{"status": "empty", "palace_path": ..., "total_drawers": 0}with guidance to add a drawer or runmine.Option 1 is the smaller change. Option 2 is clearer for tooling that wants to distinguish the two states.
Environment
--palacearg (defaults to~/.mempalace/palace/viaconfig.json)