MemPalace MCP server
Local MCP server that files conversation history and project files verbatim into wings, rooms and drawers, then searches them semantically.
MemPalace keeps conversation history and project files as verbatim text and retrieves them with semantic search; it does not summarize or extract. Each piece of original content is a drawer, filed into a room (a topic) inside a wing (a person or project), so a search can be scoped to one wing or room instead of the whole corpus. ChromaDB is the default vector store, with Milvus, Qdrant and pgvector as alternatives, and embeddings run locally with embeddinggemma-300m or all-MiniLM-L6-v2 unless you point it at an OpenAI-compatible endpoint. Alongside the drawers sits a temporal knowledge graph in SQLite, subject-predicate-object facts with validity windows, and every agent gets its own diary.
The MCP server ships in the mempalace PyPI package as mempalace-mcp and exposes 47 tools: browsing and search, drawer reads and writes, mining a directory or a folder of transcripts, knowledge-graph queries with supersession, tunnels between wings, diaries, and an append-only coordination log that agents use to hand each other tasks and patches. Hooks for Claude Code, Codex CLI and Cursor save sessions automatically; elsewhere the agent saves when it calls a tool. By default a palace lives on one machine. You can instead run a self-hosted hub over HTTP with a bearer token and point several clients at it, and a read-only mode hides the write tools. It is MIT-licensed and free.
Quick install
Copy-paste configs are provided for all 8 supported clients. Pick your client below.
Add to ~/.claude.json
{
"mcpServers": {
"mempalace": {
"command": "uvx",
"args": [
"--from",
"mempalace",
"mempalace-mcp"
],
"env": {
"MEMPALACE_PALACE_PATH": "<MEMPALACE_PALACE_PATH>"
}
}
}
}claude mcp add mempalace -- uvx --from mempalace mempalace-mcpAvailable tools
| Tool | Description |
|---|---|
| mempalace_status | Palace overview: total drawers, wing and room counts. |
| mempalace_list_wings | List all wings with their drawer counts. |
| mempalace_list_rooms | List rooms within a wing, or every room if no wing is given. |
| mempalace_get_taxonomy | Full wing, room and drawer-count taxonomy. |
| mempalace_get_aaak_spec | Return the spec for AAAK, the compressed dialect MemPalace uses for diaries and compressed memories. |
| mempalace_kg_query | Query an entity's relationships in the knowledge graph, optionally as of a past date. |
| mempalace_kg_add | Add a subject-predicate-object fact with an optional validity window. |
| mempalace_kg_invalidate | Mark a fact as no longer true. |
| mempalace_kg_supersede | Atomically replace a single-valued fact with its successor at a shared boundary. |
| mempalace_kg_timeline | Paged chronological timeline of facts for one entity or the whole graph. |
| mempalace_kg_stats | Knowledge graph overview: entities, triples, current versus expired facts, relationship types. |
| mempalace_traverse | Walk the palace graph from a room to find connected rooms in other wings. |
| mempalace_find_tunnels | Find rooms that bridge two wings. |
| mempalace_graph_stats | Palace graph overview: rooms, tunnel connections, edges between wings. |
| mempalace_mesh_peers | Show this replica's identity and version vector plus each configured sync peer's reachability and last sync outcome. |
| mempalace_create_tunnel | Create an explicit tunnel linking locations in two wings. |
| mempalace_list_tunnels | List explicit cross-wing tunnels, optionally filtered by wing. |
| mempalace_delete_tunnel | Delete an explicit tunnel by ID. |
| mempalace_list_hallways | List within-wing entity co-occurrence links built at mine time, strongest first, paged. |
| mempalace_delete_hallway | Delete a hallway record by ID. |
| mempalace_follow_tunnels | Follow tunnels from a room and return connected rooms with drawer previews. |
| mempalace_search | Semantic search over past-session memories, returning matching drawers. |
| mempalace_ | Check whether content already exists in the palace before filing it. |
| mempalace_add_drawer | File verbatim content as a new drawer, checking for duplicates first. |
| mempalace_checkpoint | Save a whole session in one call: dedupe each item, file the new ones as drawers, then write one diary entry. |
| mempalace_delete_drawer | Irreversibly delete a drawer and its earlier revisions. |
| mempalace_delete_drawers | Bulk-delete up to 500 drawers by ID, reporting per-ID results. |
| mempalace_mine | Mine a directory into the palace as project files, chat transcripts or office documents. |
| mempalace_ | Delete every drawer mined from one source file, dry-run by default. |
| mempalace_sync | Prune drawers whose source files were deleted, moved or gitignored, dry-run by default. |
| mempalace_get_drawer | Fetch one drawer's full content and metadata by ID. |
| mempalace_get_drawers | Fetch many drawers by ID in one call. |
| mempalace_list_drawers | Paged list of drawers with optional wing, room and filed-at date filters. |
| mempalace_update_drawer | Update a drawer's content or wing and room, keeping the replaced text as a revision. |
| mempalace_diary_write | Append an entry to the calling agent's own diary, written in AAAK. |
| mempalace_diary_read | Read the calling agent's recent diary entries. |
| mempalace_hook_settings | View or set auto-save hook behavior such as silent saving and desktop notifications. |
| mempalace_ | Check whether a recent checkpoint was saved, with message count and timestamp. |
| mempalace_reconnect | Force a reconnect to the palace database after outside changes left the in-memory index stale. |
| mempalace_event_append | Append an immutable coordination event (task request, reply, patch ready) to the logstream. |
| mempalace_task_create | Create a complete task request for another agent and return a one-line handoff. |
| mempalace_event_list | List coordination events with structured filters and a resume cursor. |
| mempalace_event_wait | Block until a matching coordination event arrives or a timeout of up to five minutes expires. |
| mempalace_event_ack | Acknowledge a coordination event by appending an ack routed back to its writer. |
| mempalace_artifact_put | Store exact handoff content (patch, file, log, JSON, note) up to 4 MiB and return its ID and sha256. |
| mempalace_artifact_get | Fetch a stored coordination artifact with its sha256. |
| mempalace_patch_submit | Store a patch artifact and announce it with a patch.ready event in one call. |
Required configuration
- MEMPALACE_PALACE_PATHOptional
Directory the palace is stored in. Defaults to ~/.mempalace/palace.
- MEMPALACE_EMBEDDING_API_URLOptional
OpenAI-compatible /v1/embeddings endpoint, used when embedding_model is set to openai-compat.
What you can do with it
Recover the exact wording of an old session
Mine ~/.claude/projects with mode convos, then mempalace_search scoped to one project's wing returns the original exchange, not a summary of it.
Track facts that change over time
When a project switches database or a teammate changes role, mempalace_kg_supersede closes the old fact and opens the new one at the same date, so an as-of query returns whichever was true then.
Hand work between agents on a shared hub
One agent posts a task with mempalace_task_create, another waits on it with mempalace_event_wait and replies with mempalace_patch_submit, all through the palace's append-only logstream.
FAQ
- Is it free?
- Yes. MemPalace is open source under the MIT license, installs from PyPI or as a Docker image, and has no paid tier. Embeddings run locally unless you configure a remote endpoint.
- Does it support remote or OAuth?
- There is no hosted service and no OAuth. The default is a local stdio server; for sharing you run your own hub that serves MCP over HTTP behind a bearer token, and clients' mempalace-mcp processes forward to it.
- Can a team share one palace, and how does that compare to Glen?
- Yes, by running a hub that several clients connect to, which you host and keep running. Content arrives through hooks or tool calls from those agents. Glen is a managed service that records agent sessions, Slack, GitHub, tickets, docs and calls into one org memory and filters each recall to what the asking user is cleared to see.
