Environment
- OS: Windows 11 (bash shell via Claude Code)
- Python: 3.12 (via uvx)
- MemPalace: 3.1.0
- ChromaDB: 0.6.3
- Claude Code: 2.1.100
- MCP transport: stdio
Bug
When calling mempalace_add_drawer or mempalace_kg_add via the MCP server (stdio transport), operations are logged in the WAL (~/.mempalace/wal/write_log.jsonl) with "result": null, but no data is written to ChromaDB or the Knowledge Graph SQLite.
Calling the same functions directly from Python works correctly:
from mempalace.mcp_server import tool_add_drawer, tool_kg_add
# This works — drawer is written and searchable
result = tool_add_drawer('myproject', 'general', 'test content')
# {'success': True, 'drawer_id': '...'}
# This works — triple is written
result = tool_kg_add('User', 'prefers', 'dark mode', '2026-04-10')
# {'success': True, 'triple_id': '...'}
But via MCP stdio (Claude Code session), the WAL shows:
{"timestamp": "...", "operation": "kg_add", "params": {"subject": "peter", "predicate": "preferred_temperature", "object": "21 Grad Celsius"}, "result": null}
{"timestamp": "...", "operation": "add_drawer", "params": {"drawer_id": "...", "wing": "personalai", "room": "kira", "content_length": 417}, "result": null}
After the session:
mempalace status shows unchanged drawer counts
mempalace search does not find MCP-added content
- Knowledge Graph SQLite has 0 entities, 0 triples
- Direct Python calls to the same functions DO write successfully
Steps to Reproduce
- Install mempalace plugin:
claude plugin install --scope user mempalace
- Mine a project:
mempalace mine /path/to/project
- Start Claude Code session, ask Claude to save a fact (triggers
mempalace_kg_add)
- Check WAL:
cat ~/.mempalace/wal/write_log.jsonl — shows "result": null
- Check KG:
mempalace search — fact not found
- Direct Python test (same function, same palace path) — works
Suspected Cause
The MCP server runs as a stdio subprocess. Possible issues:
- ChromaDB connection not being committed/flushed in the stdio event loop
- SQLite WAL mode not syncing before process exit
_get_collection() creates a new client per call that doesn't persist
- Async/sync mismatch in the FastMCP stdio transport
Workaround
WAL entries can be replayed via direct Python calls:
import json
from mempalace.mcp_server import tool_add_drawer, tool_kg_add
with open('~/.mempalace/wal/write_log.jsonl') as f:
for line in f:
entry = json.loads(line)
if entry['result'] is None:
if entry['operation'] == 'add_drawer':
p = entry['params']
tool_add_drawer(p['wing'], p['room'], p.get('content_preview',''), p.get('source_file'), p.get('added_by'))
elif entry['operation'] == 'kg_add':
p = entry['params']
tool_kg_add(p['subject'], p['predicate'], p['object'], p.get('valid_from'))
Environment
Bug
When calling
mempalace_add_drawerormempalace_kg_addvia the MCP server (stdio transport), operations are logged in the WAL (~/.mempalace/wal/write_log.jsonl) with"result": null, but no data is written to ChromaDB or the Knowledge Graph SQLite.Calling the same functions directly from Python works correctly:
But via MCP stdio (Claude Code session), the WAL shows:
{"timestamp": "...", "operation": "kg_add", "params": {"subject": "peter", "predicate": "preferred_temperature", "object": "21 Grad Celsius"}, "result": null} {"timestamp": "...", "operation": "add_drawer", "params": {"drawer_id": "...", "wing": "personalai", "room": "kira", "content_length": 417}, "result": null}After the session:
mempalace statusshows unchanged drawer countsmempalace searchdoes not find MCP-added contentSteps to Reproduce
claude plugin install --scope user mempalacemempalace mine /path/to/projectmempalace_kg_add)cat ~/.mempalace/wal/write_log.jsonl— shows"result": nullmempalace search— fact not foundSuspected Cause
The MCP server runs as a stdio subprocess. Possible issues:
_get_collection()creates a new client per call that doesn't persistWorkaround
WAL entries can be replayed via direct Python calls: