mempalace-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mempalace-mcpsearch my memory palace for the discussion about vector databases"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mempalace-mcp
A lightweight LM Studio Plugin wrapper around the
MemPalace MCP server. It re-exposes
all 45 MemPalace MCP tools in two complementary ways, without ever editing
the original Python source tree (so git pull inside MemPalace/ keeps working):
As a native LM Studio Plugin tools provider — usable directly inside LM Studio's tool-calling loop (
src/toolsProvider.ts).As a standalone MCP server — connectable from any MCP client, including Claude Code, Gemini CLI, Cursor, and Antigravity (
dist/mcp.js, seenpm run mcp).
Both entry points share one catalog (src/core/tools-catalog.ts) and one
long-lived bridge (src/core/python-bridge.ts). The TypeScript layer is purely
a thin, type-safe proxy in front of the real Python server.
Bottom line: you write nothing about MemPalace's internals here. The wrapper only spawns, talks, and forwards. MemPalace stays the source of truth and stays updatable.
What MemPalace is
MemPalace is a local-first AI memory store. It keeps your conversation history as verbatim text and retrieves it with semantic search — it does not summarize, extract, or paraphrase. The index is structured: people and projects become wings, topics become rooms, and original content lives in drawers. Retrieval is pluggable (ChromaDB by default) and nothing leaves your machine unless you opt in.
mempalace-mcp simply makes that palace reachable from LM Studio and any other
MCP client through a consistent 45-tool surface.
Related MCP server: mempalace-mcp-http
Architecture
LM Studio Plugin tool loop Any MCP client
│ │
└──────────┬───────────────────┘
│
┌────────────────▼─────────────────┐
│ src/index.ts → main(context) │ (registers both)
└───────────────┬──────────────────┘
┌──────────────┴──────────────┐
▼ ▼
src/toolsProvider.ts src/mcp.ts
(LM Studio Tool API, zod params) (standalone MCP server)
│ │
└───────────────┬──────────────┘
│
src/core/tools-catalog.ts ← single source of truth
(name + description + JSON schema for all 45 tools)
│
src/core/python-bridge.ts
(spawns the Python server once, reuses the connection)
│
┌───────────────┴───────────────┐
▼ ▼
python -m mempalace.mcp_server MemPalace palace
(stdio JSON-RPC, unmodified) (ChromaDB / SQLite / KG / logstream)Key design decisions:
Concern | Decision | Why |
Tool definitions | Transcribed verbatim from Python | One source of truth for both entry points; re-derivable on demand. |
Talking to Python | A persistent MCP client over stdio ( | One spawn reused across calls instead of spawning per tool. |
Parameter typing | Each tool's JSON schema is mapped to a Zod schema ( | Type safety + automatic |
Python environment | Provisioned by | Keeps |
Palace path / read-only | Configured via Plugin global config, passed to the Python server at spawn time | No secrets baked into source; per-user palace location. |
Repository layout
mempalace-mcp/
├── manifest.json # LM Studio Plugin manifest (owner kebab-case)
├── package.json # deps, scripts ("postinstall" provisions the venv), bin
├── tsconfig.json # NodeNext ESM-style TS → compiled to dist/
├── README.md
├── scripts/
│ └── setup.cjs # postinstall: clone + venv + pip install MemPalace
├── src/
│ ├── index.ts # Plugin entry → exports main(pluginContext)
│ ├── toolsProvider.ts # LM Studio tool provider (all 45 tools)
│ ├── config.ts # Global config schematics (Palace Path, Read-only)
│ ├── mcp.ts # Standalone MCP server entry (npm run mcp)
│ └── core/
│ ├── python-bridge.ts # Spawns + talks to the Python MCP server
│ ├── tools-catalog.ts # Authoritative list of all 45 tools
│ ├── zod-from-json.ts # JSON schema → Zod conversion
│ └── format-result.ts # Result shaping for both surfaces
└── dist/ # Compiled JavaScript (output of `npm run build`)Development process
This project was built as a port, not a rewrite. The steps that mattered:
Enumerate the source of truth. The Python server declares every tool in
MemPalace/mempalace/mcp_server/schemas.py(TOOLS). We transcribed each tool's name, description, and JSON schema verbatim intosrc/core/tools-catalog.ts. Nothing is hand-rolled per tool.Wrap, don't reimplement. Rather than translate the MCP protocol by hand,
python-bridge.tsuses@modelcontextprotocol/sdkas an MCP client and spawnspython -m mempalace.mcp_serveronce, reusing that connection. The wrapper only forwards arguments and shapes results.Share one catalog across two entry points.
toolsProvider.ts(LM Studio) andmcp.ts(standalone MCP) iterate the same catalog, so the two surfaces can never drift apart.Keep the Python tree pristine.
MemPalace/is a git clone managed byscripts/setup.cjs. We never edit it, so upstream fixes and new tools land through a plaingit pulland this catalog can be regenerated.Provision at install time. The
postinstallscript clones MemPalace, builds a Python venv, and installs the package (pluschromadb,numpy,onnxruntime, …) into it — sonpm installleaves a working palace behind.
The plugin is CommonJS on purpose:
lms dev/Hub bundles it with esbuild as CJS, so the package must load as CJS too. The source therefore uses__dirname(notimport.meta) to locate.venv, and the entry exports amain(pluginContext)function thatlmsinvokes to register the provider.
Installation
From the LM Studio Hub (recommended)
Once published, install straight from the Hub. On first load, npm runs the
postinstall hook, which:
clones
https://github.com/MemPalace/mempalaceintoMemPalace/,creates a Python venv at
.venv/,runs
pip install -e ./MemPalaceto provision the palace + deps.
Then open Plugins → mempalace-mcp, enable it, and set Palace Path in its global configuration. The first tool call spawns the Python server; the connection is cached for subsequent calls.
From a source checkout
npm install # runs postinstall: clone + venv + pip install
npm run typecheck # tsc --noEmit
npm run build # tsc → dist/
lms dev # load into LM Studio (hot-reload)
lms push # publish to the Hubnpm install alone is not proof that MCP is connected — see Verifying the
connection below.
The 45 MCP tools
Every tool mirrors its Python counterpart exactly. They fall into eight groups.
Overview (7)
Tool | Purpose |
| Palace overview — total drawers, wing/room counts |
| List all wings with drawer counts |
| List rooms within a wing (or all rooms) |
| Full wing → room → count tree |
| The AAAK compressed-memory dialect spec |
| Graph overview: rooms, tunnels, edges |
| Shared-brain replica/mesh estate snapshot (RFC 004) |
Graph navigation (8)
mempalace_traverse, mempalace_find_tunnels, mempalace_create_tunnel,
mempalace_list_tunnels, mempalace_delete_tunnel, mempalace_list_hallways,
mempalace_delete_hallway, mempalace_follow_tunnels
Search & read drawers (4)
mempalace_search, mempalace_check_duplicate, mempalace_get_drawer,
mempalace_list_drawers
Write drawers (7)
mempalace_add_drawer, mempalace_update_drawer, mempalace_delete_drawer,
mempalace_delete_by_source, mempalace_mine, mempalace_checkpoint,
mempalace_sync
Knowledge graph (6)
mempalace_kg_query, mempalace_kg_add, mempalace_kg_invalidate,
mempalace_kg_supersede, mempalace_kg_timeline, mempalace_kg_stats
Diary (4)
mempalace_diary_write, mempalace_diary_read, mempalace_hook_settings,
mempalace_memories_filed_away
Coordination — logstream & artifacts (RFC 003/004) (8)
mempalace_event_append, mempalace_task_create, mempalace_event_list,
mempalace_event_wait, mempalace_event_ack, mempalace_artifact_put,
mempalace_artifact_get, mempalace_patch_submit
Maintenance (1)
mempalace_reconnect — force a reconnect to the palace DB after external writes.
Need the exact argument schema for a tool? It is defined in
src/core/tools-catalog.tsand validated by Zod on both surfaces.
Usage
1. Inside LM Studio (Plugin)
Enable the plugin, set Palace Path (and optionally Read-only mode) in its global config, then let the model call tools during a session. The provider registers all 45 tools automatically; the model sees their descriptions and can invoke any of them.
2. As a standalone MCP server
Add it to any MCP client via stdio:
{
"mcpServers": {
"mempalace-mcp-lms": {
"command": "node",
"args": ["/absolute/path/to/project/dist/mcp.js"]
}
}
}Or run it directly and talk to it over stdio:
npm run build && npm run mcpmcp.ts reads MEMPALACE_PALACE_PATH / MEMPALACE_MCP_READ_ONLY from the
environment when no explicit config is supplied.
Verifying the connection
Package installation alone does not prove MCP is connected. Confirm the live tool list:
# standalone
node dist/mcp.js # then call tools/list over stdio
# or, inside LM Studio, open the tool panel and confirm all 45 tools appearThe first call spawns python -m mempalace.mcp_server; a healthy response
(mempalace_status returning counts, or a graceful "no palace yet" message)
means the bridge is wired correctly.
Using MemPalace's own examples & skills through mempalace-mcp
MemPalace ships examples and skills that describe how agents should set
up, recall from, and coordinate via the palace. mempalace-mcp is the transport
that lets your agent actually execute those patterns — whether you run them in
LM Studio or through another MCP harness. The sections below map each upstream
resource to the concrete tool calls it triggers.
MemPalace/examples/ — runnable recipes & wiring guides
File | What it shows | Tool surface used |
| Mine a project folder: init → mine → search |
|
| Import Claude Code / ChatGPT transcripts ( |
|
| Route Chroma embeddings + post-retrieval rerank through a local MX3 public-shim endpoint (opt-in, hardware-backed) |
|
| Wire MemPalace into the Antigravity CLI over MCP |
|
| Cursor IDE hooks + recall rules that run before context compression | auto-save hooks → |
| Set up MemPalace from the Gemini CLI | MCP stdio registration |
| Minimal Claude Code MCP integration ( | live tool list ( |
| Auto-save hook configuration across harnesses | hook-driven writes to the palace |
How to use them with mempalace-mcp:
Mine a project first. Point
mempalace_mineat the directory you want the agent to remember (code, docs, or transcripts). For Claude Code sessions:mempalace_minewithmode="convos"over your~/.claude/projects/tree — the shape matchesconvo_import.py.Search before answering. Run
mempalace_searchwith a short, keyword-onlyquery(≤ 250 chars — never paste a whole conversation or system prompt). Usewing/roomfilters to scope, andlimit(default 5) to bound results.Prefer the MX3 shim only on backed hardware. The
mx3_public_shimrecipe is opt-in and requires the accelerator behind the endpoint; enable it via the documentedMEMPALACE_MX3_PUBLIC_SHIM_*env vars, then callmempalace_searchas usual.
MemPalace/skills/ — agent runbooks
MemPalace exposes three skills (agent-runbook markdown consumed by coding
agents). mempalace-mcp is the MCP surface each skill assumes is connected.
skills/mempalace/SKILL.md— Install, configure, and operate. Guided setup for a private local palace, a shared-brain hub, or a client joining an existing hub. Covers detecting the harness, choosing topology, configuring MCP, and reporting readiness. Throughmempalace-mcpthis becomes: spawn the Python server, verifytools/listshows the 45 tools, then operate viamempalace_status,mempalace_mine,mempalace_list_wings, etc.skills/mempalace-recall/SKILL.md— Search-before-answer recall. The core agent discipline: read the palace instead of guessing from model memory. Key mappings throughmempalace-mcp:Wake-up: call
mempalace_search; usemempalace_kg_queryfor relational or time-bound facts (as_of).Always return the drawer's verbatim text — never summarize stored content.
Record continuity with
mempalace_diary_write; when a fact changes, usemempalace_kg_supersede(single-valued replacement),mempalace_kg_invalidate(ended without replacement), ormempalace_kg_add(independent/coexisting).Anti-patterns to enforce: don't search on greenfield tasks with no memory relevance, don't answer from model memory when the palace might know, and don't paraphrase what
mempalace_searchreturns.
skills/mempalace-task/SKILL.md— Logstream task delegation. Move work between agents via the logstream (not memory drawers). Throughmempalace-mcp:Create a handoff with
mempalace_task_create(returns a ready-to-paste line).Monitor the inbox with
mempalace_event_list/mempalace_event_wait, carryingsince_event_idforward as a resume cursor.Claim with
mempalace_event_ack(status="claimed"), deliver patches viamempalace_patch_submit, and reference stored files withmempalace_artifact_put/mempalace_artifact_get.Remember: logstream events are immutable — show the user the exact task content and get approval before appending.
Recommended workflow (any harness)
Set up — follow
skills/mempalace/SKILL.md; confirm the 45 tools are live.Mine —
mempalace_mineyour corpus (code, convos, or office docs).Recall — follow
skills/mempalace-recall/SKILL.md: search first, quote verbatim, write diary continuity withmempalace_diary_write.Coordinate — when delegating across agents, switch to
skills/mempalace-task/SKILL.mdand the logstream tools.
Requirements
Python 3.9+ (provisioned automatically into
.venv/byscripts/setup.cjs).A vector-store backend — ChromaDB is bundled and needs no configuration.
~300 MB disk for the embedding model. The first embedding-backed call downloads the model (~80 MB default
minilm, ~300 MBembeddinggemma); read-only sqlite-backed tools (mempalace_status, list, taxonomy, KG) stay fast.Optional: route embeddings/rerank through an OpenAI-compatible endpoint by setting
embedding_model: "openai-compat"in MemPalace's config — no content leaves your network when the endpoint is local.
No API key is required for the core recall path.
Notes & limitations
Python is required at install and runtime. The bridge spawns the venv's Python. On machines where
python3on PATH is a broken symlink (emptysys.executable),setup.cjsfalls back to absolute interpreter paths under/usr/bin/python3.*.First embedding-backed call is slow and needs network. The embedder model downloads once per palace; subsequent calls are fast.
Read-only mode spawns the Python server with
--read-only; mutating tools (writes, mine, checkpoint, coordination) are refused, which is useful for pure recall sessions.
References
MemPalace repo: https://github.com/MemPalace/mempalace
Full MCP tool reference: https://mempalaceofficial.com/reference/mcp-tools.html
The palace concept: https://mempalaceofficial.com/concepts/the-palace.html
Knowledge graph: https://mempalaceofficial.com/concepts/knowledge-graph
Contributing
PRs welcome. When adding or renaming a tool, update src/core/tools-catalog.ts
to match MemPalace/mempalace/mcp_server/schemas.py so both entry points stay
in sync.
License
MIT — see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Private-by-default, local-first memory/context/task orchestrator for MCP apps and agents.
Persistent, portable memory for AI assistants — your private memory graph, from any MCP client.
Governed personal world model and memory for your AI agent. Pair once, connect over MCP.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides a local, persistent long-term memory service for MCP-compatible AI agents, enabling them to store, search, and recall information across sessions.1GPL 3.0
- FlicenseNot gradedqualityDmaintenanceEnables remote access to the MemPalace MCP server via HTTP, supporting bearer token authentication and concurrent clients while exposing all mempalace tools.-
- FlicenseNot gradedqualityDmaintenanceExposes your local machine's filesystem, git, shell, network, databases, and system to any MCP-compatible LLM client over HTTP.6-
- FlicenseNot gradedqualityCmaintenanceEnables tool-calling over TCP for a local RAG pipeline, allowing document ingestion and querying via MCP tools, fully offline with no cloud dependencies.-