diff --git a/.claude-plugin/README.md b/.claude-plugin/README.md index b6708bb2b..e9e6468e9 100644 --- a/.claude-plugin/README.md +++ b/.claude-plugin/README.md @@ -1,6 +1,6 @@ # MemPalace Claude Code Plugin -A Claude Code plugin that gives your AI a persistent memory system. Mine projects and conversations into a searchable palace backed by ChromaDB, with 19 MCP tools, auto-save hooks, and 5 guided skills. +A Claude Code plugin that gives your AI a persistent memory system. Mine projects and conversations into a searchable palace backed by ChromaDB, with 33 MCP tools, auto-save hooks, and 5 guided skills. ## Prerequisites @@ -50,7 +50,7 @@ Set the `MEMPAL_DIR` environment variable to a directory path to automatically r ## MCP Server -The plugin automatically configures a local MCP server with 19 tools for storing, searching, and managing memories. No manual MCP setup is required -- `/mempalace:init` handles everything. +The plugin automatically configures a local MCP server with 33 tools for storing, searching, and managing memories. No manual MCP setup is required -- `/mempalace:init` handles everything. ## Full Documentation diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 3b8179eb0..52226cb36 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -8,7 +8,7 @@ { "name": "mempalace", "source": "./.claude-plugin", - "description": "AI memory system — mine projects and conversations into a searchable palace. 19 MCP tools, auto-save hooks, guided setup.", + "description": "AI memory system — mine projects and conversations into a searchable palace. 33 MCP tools, auto-save hooks, guided setup.", "version": "3.4.1", "author": { "name": "milla-jovovich" diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 9a0f75dcf..aa0cba686 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "mempalace", "version": "3.4.1", - "description": "Give your AI a memory — mine projects and conversations into a searchable palace. 19 MCP tools, auto-save hooks, and guided setup.", + "description": "Give your AI a memory — mine projects and conversations into a searchable palace. 33 MCP tools, auto-save hooks, and guided setup.", "author": { "name": "milla-jovovich" }, diff --git a/.codex-plugin/README.md b/.codex-plugin/README.md index 2af714c36..2d2478bb3 100644 --- a/.codex-plugin/README.md +++ b/.codex-plugin/README.md @@ -1,6 +1,6 @@ # MemPalace - Codex CLI Plugin -Give your AI a persistent memory -- mine projects and conversations into a searchable palace backed by ChromaDB, with 19 MCP tools, auto-save hooks, and guided skills. +Give your AI a persistent memory -- mine projects and conversations into a searchable palace backed by ChromaDB, with 33 MCP tools, auto-save hooks, and guided skills. ## Prerequisites diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index 57c23481e..462f401b3 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "mempalace", "version": "3.4.1", - "description": "Give your AI a memory — mine projects and conversations into a searchable palace. 19 MCP tools, auto-save hooks, and guided setup.", + "description": "Give your AI a memory — mine projects and conversations into a searchable palace. 33 MCP tools, auto-save hooks, and guided setup.", "author": { "name": "milla-jovovich" }, @@ -27,7 +27,7 @@ "interface": { "displayName": "MemPalace", "shortDescription": "AI memory system for Codex", - "longDescription": "Give your AI a persistent memory — mine projects and conversations into a searchable palace backed by ChromaDB, with 19 MCP tools, auto-save hooks, and guided skills.", + "longDescription": "Give your AI a persistent memory — mine projects and conversations into a searchable palace backed by ChromaDB, with 33 MCP tools, auto-save hooks, and guided skills.", "developerName": "milla-jovovich", "category": "Coding", "capabilities": [ diff --git a/.cursor-plugin/README.md b/.cursor-plugin/README.md index 547023e82..6ba9ba48e 100644 --- a/.cursor-plugin/README.md +++ b/.cursor-plugin/README.md @@ -1,6 +1,6 @@ # MemPalace Cursor Plugin -A Cursor IDE plugin that gives your agent a persistent memory system. Auto-registers the `mempalace-mcp` server (19 MCP tools), ships 5 slash commands, two model-invocable skills (setup/mining/search and a recall protocol), and an optional recall rule. +A Cursor IDE plugin that gives your agent a persistent memory system. Auto-registers the `mempalace-mcp` server (33 MCP tools), ships 5 slash commands, two model-invocable skills (setup/mining/search and a recall protocol), and an optional recall rule. > Hooks (auto-save + session-start memory recall) are shipped separately under `hooks/cursor/` so the plugin is safe to install in any Cursor workspace without touching the agent loop. See [Hooks](#hooks-optional) below. @@ -79,13 +79,15 @@ This plugin ships `mcp.json` at the plugin root, so Cursor auto-loads the `mempa ```json { - "mempalace": { - "command": "mempalace-mcp" + "mcpServers": { + "mempalace": { + "command": "mempalace-mcp" + } } } ``` -All 19 MemPalace MCP tools (`mempalace_search`, `mempalace_add_drawer`, `mempalace_diary_write`, `mempalace_check_duplicate`, `mempalace_diary_read`, …) become available to the agent immediately. No manual `~/.cursor/mcp.json` edit required. +All 33 MemPalace MCP tools (`mempalace_search`, `mempalace_add_drawer`, `mempalace_diary_write`, `mempalace_check_duplicate`, `mempalace_diary_read`, …) become available to the agent immediately. No manual `~/.cursor/mcp.json` edit required. If the server doesn't appear, confirm `mempalace-mcp` is on the user `$PATH`: diff --git a/.cursor-plugin/marketplace.json b/.cursor-plugin/marketplace.json index 36f2f04c9..bd3ed05e2 100644 --- a/.cursor-plugin/marketplace.json +++ b/.cursor-plugin/marketplace.json @@ -8,7 +8,7 @@ { "name": "mempalace", "source": ".", - "description": "AI memory system — mine projects and conversations into a searchable palace. 19 MCP tools, slash commands, and a guided skill for Cursor.", + "description": "AI memory system — mine projects and conversations into a searchable palace. 33 MCP tools, slash commands, and a guided skill for Cursor.", "author": { "name": "milla-jovovich" } diff --git a/.cursor-plugin/plugin.json b/.cursor-plugin/plugin.json index aa7761997..b3be76b3d 100644 --- a/.cursor-plugin/plugin.json +++ b/.cursor-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "mempalace", - "description": "Give your AI a memory — mine projects and conversations into a searchable palace. 19 MCP tools, slash commands, and a guided skill for Cursor.", + "description": "Give your AI a memory — mine projects and conversations into a searchable palace. 33 MCP tools, slash commands, and a guided skill for Cursor.", "author": { "name": "milla-jovovich" }, diff --git a/CHANGELOG.md b/CHANGELOG.md index c32cf188c..4f10ef293 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), ### Features -- **Cursor IDE plugin (`.cursor-plugin/`).** Drops into `~/.cursor/plugins/local/mempalace` (or installs from the Cursor marketplace once published) and auto-registers the `mempalace-mcp` server, five slash commands (`/mempalace-help`, `/mempalace-init`, `/mempalace-mine`, `/mempalace-search`, `/mempalace-status`), and the model-invocable [`mempalace` skill](.cursor-plugin/skills/mempalace/SKILL.md) — no manual `~/.cursor/mcp.json` edit required. The plugin manifest deliberately omits a hardcoded `version` field — `mempalace/version.py` is the single source of truth, so there is nothing to drift on the next release (a contract test enforces the field stays absent). The canonical plugin components (`commands/`, `skills/`, `mcp.json`) are real files at the plugin root; no symlinks are committed (committed symlinks materialise as broken text files on Windows clones with `core.symlinks=false`). Mirrors the surface of [`.claude-plugin/`](.claude-plugin/) and [`.codex-plugin/`](.codex-plugin/) without duplicating their hook scripts: the Cursor hook scripts under [`hooks/cursor/`](hooks/cursor/) (shipped in the same release) remain the canonical install path for `stop` / `preCompact` / `sessionStart`, wired separately by [`hooks/cursor/install.sh`](hooks/cursor/install.sh). Contract tests in [`tests/test_cursor_plugin_manifest.py`](tests/test_cursor_plugin_manifest.py) cover manifest JSON validity, kebab-case naming, `..`-free relative paths, on-disk path resolution, marketplace alignment, MCP config shape (`mcpServers` wrapper required by Cursor, unlike Claude's flat `.mcp.json`), the version-field-absent guard, the no-symlink guard, and every skill/command frontmatter — all pure file inspection so they run on any CI platform without Cursor itself. +- **Cursor IDE plugin (`.cursor-plugin/`).** Drops into `~/.cursor/plugins/local/mempalace` (or installs from the Cursor marketplace once published) and auto-registers the `mempalace-mcp` server, five slash commands (`/mempalace-help`, `/mempalace-init`, `/mempalace-mine`, `/mempalace-search`, `/mempalace-status`), and the model-invocable [`mempalace` skill](skills/mempalace/SKILL.md) — no manual `~/.cursor/mcp.json` edit required. The plugin manifest deliberately omits a hardcoded `version` field — `mempalace/version.py` is the single source of truth, so there is nothing to drift on the next release (a contract test enforces the field stays absent). The canonical plugin components (`commands/`, `skills/`, `mcp.json`) are real files at the plugin root; no symlinks are committed (committed symlinks materialise as broken text files on Windows clones with `core.symlinks=false`). Mirrors the surface of [`.claude-plugin/`](.claude-plugin/) and [`.codex-plugin/`](.codex-plugin/) without duplicating their hook scripts: the Cursor hook scripts under [`hooks/cursor/`](hooks/cursor/) (shipped in the same release) remain the canonical install path for `stop` / `preCompact` / `sessionStart`, wired separately by [`hooks/cursor/install.sh`](hooks/cursor/install.sh). Contract tests in [`tests/test_cursor_plugin_manifest.py`](tests/test_cursor_plugin_manifest.py) cover manifest JSON validity, kebab-case naming, `..`-free relative paths, on-disk path resolution, marketplace alignment, MCP config shape (`mcpServers` wrapper required by Cursor, unlike Claude's flat `.mcp.json`), the version-field-absent guard, the no-symlink guard, and every skill/command frontmatter — all pure file inspection so they run on any CI platform without Cursor itself. - **Cursor IDE hook support (`stop` / `preCompact` / `sessionStart`).** Three new bash hooks live under [`hooks/cursor/`](hooks/cursor/) and share a `lib/common.sh` helpers module. The save hook counts `stop` invocations per Cursor `conversation_id` and emits a `followup_message` every `MEMPAL_SAVE_INTERVAL` (default 15) so the agent files the session into MemPalace and writes a diary entry. Unlike the silent-by-default Claude Code hook, the Cursor followup fires **on by default**: Cursor's transcript format is undocumented and `normalize.py` has no Cursor parser yet, so the background `mempalace mine --mode convos` is best-effort only and the `followup_message` is the load-bearing verbatim-capture path. Users who want the Claude-style "zero tokens in the chat window" behaviour can suppress it with `MEMPAL_CURSOR_SILENT=1` (or `MEMPAL_VERBOSE=false`); the default flips to silent once a Cursor transcript parser lands. The precompact hook synchronously mines the transcript before Cursor's compaction summarises it and drops a marker so the next `stop` forces a save nudge (Cursor's `preCompact` is observational-only — it cannot block or emit a `followup_message`, unlike Claude Code's `PreCompact`); the synchronous mine is bounded by Cursor's per-hook timeout, and because `mempalace mine` is incremental/append-only a killed mine resumes cleanly on the next run rather than corrupting the palace. The wake hook is Cursor-only: `sessionStart` returns `additional_context` telling the agent to recall scoped to the wing inferred from the workspace root. Honours the same `MEMPALACE_HOOKS_AUTO_SAVE=false` kill switch as the Claude Code hooks, plus a new `MEMPAL_DISABLE_HOOK=1` alias and a `MEMPAL_STATE_DIR` env override. Per-conversation state files are garbage-collected by a daily-throttled, Cursor-namespaced TTL sweep (`MEMPAL_STATE_TTL_DAYS`, default 30) so `cursor_*.count` / `cursor_*.pending` cannot grow unbounded — shared logs and other editors' state are never touched. Includes an opt-in installer at [`hooks/cursor/install.sh`](hooks/cursor/install.sh) with `--scope user|project`, `--variant full|minimal`, `--dry-run`, and `--uninstall` (idempotent, preserves unrelated hooks via `python3`-based JSON merge — no `jq` dependency). Example wirings live at [`examples/cursor/hooks.json`](examples/cursor/hooks.json) and [`examples/cursor/hooks.minimal.json`](examples/cursor/hooks.minimal.json); they are intentionally not placed at the repo root because Cursor auto-loads project hooks from any trusted workspace and we do not arm hooks on contributor checkout. Per-event stdin/stdout schema documented at [`hooks/cursor/STDIN_SHAPE.md`](hooks/cursor/STDIN_SHAPE.md). Walkthrough at [`website/guide/cursor-hooks.md`](website/guide/cursor-hooks.md). Coverage added in [`tests/test_cursor_hooks_shell.py`](tests/test_cursor_hooks_shell.py) and [`tests/test_cursor_hooks_install.py`](tests/test_cursor_hooks_install.py). diff --git a/README.md b/README.md index a00f893ad..6f74c5b7f 100644 --- a/README.md +++ b/README.md @@ -225,7 +225,7 @@ Usage and tool reference: ## MCP server -29 MCP tools cover palace reads/writes, knowledge-graph operations, +33 MCP tools cover palace reads/writes, knowledge-graph operations, cross-wing navigation, drawer management, and agent diaries. Installation and the full tool list: [mempalaceofficial.com/reference/mcp-tools](https://mempalaceofficial.com/reference/mcp-tools.html). diff --git a/hooks/antigravity/lib/common.sh b/hooks/antigravity/lib/common.sh index bffbda114..f900024b8 100644 --- a/hooks/antigravity/lib/common.sh +++ b/hooks/antigravity/lib/common.sh @@ -440,7 +440,7 @@ mempal_gc_stale_state() { local marker="$MEMPAL_STATE_DIR/antigravity_last_sweep" if [ -f "$marker" ]; then local mtime now - if mtime=$(date -r "$marker" '+%s' 2>/dev/null) \ + if mtime=$("$MEMPAL_PYTHON_BIN" -c 'import os, sys; print(int(os.path.getmtime(sys.argv[1])))' "$marker" 2>/dev/null) \ && now=$(date '+%s' 2>/dev/null) \ && [ -n "$mtime" ] \ && [ "$((now - mtime))" -lt 86400 ]; then diff --git a/hooks/antigravity/mempal_save_hook_antigravity.sh b/hooks/antigravity/mempal_save_hook_antigravity.sh index 744d0b88f..47b99483f 100755 --- a/hooks/antigravity/mempal_save_hook_antigravity.sh +++ b/hooks/antigravity/mempal_save_hook_antigravity.sh @@ -161,8 +161,8 @@ fi # treating markers older than 1 hour as stale and reclaiming them. PENDING_FILE="$MEMPAL_STATE_DIR/antigravity_pending_${CONVERSATION_ID}" if [ -f "$PENDING_FILE" ]; then - # mtime in epoch seconds (date -r); if stale (> 1 hour), reclaim. - if mtime=$(date -r "$PENDING_FILE" '+%s' 2>/dev/null) \ + # mtime in epoch seconds (portable; BSD/macOS `date -r` takes epoch, not a path). + if mtime=$("$MEMPAL_PYTHON_BIN" -c 'import os, sys; print(int(os.path.getmtime(sys.argv[1])))' "$PENDING_FILE" 2>/dev/null) \ && now=$(date '+%s') \ && [ -n "$mtime" ] \ && [ "$((now - mtime))" -lt 3600 ]; then diff --git a/hooks/cursor/lib/common.sh b/hooks/cursor/lib/common.sh index 4412bfdbe..f7d5dfad3 100644 --- a/hooks/cursor/lib/common.sh +++ b/hooks/cursor/lib/common.sh @@ -388,7 +388,7 @@ mempal_gc_stale_state() { local marker="$MEMPAL_STATE_DIR/cursor_last_sweep" if [ -f "$marker" ]; then local mtime now - if mtime=$(date -r "$marker" '+%s' 2>/dev/null) \ + if mtime=$("$MEMPAL_PYTHON_BIN" -c 'import os, sys; print(int(os.path.getmtime(sys.argv[1])))' "$marker" 2>/dev/null) \ && now=$(date '+%s' 2>/dev/null) \ && [ -n "$mtime" ] \ && [ "$((now - mtime))" -lt 86400 ]; then diff --git a/mempalace/README.md b/mempalace/README.md index fdbbb6206..ddeef061b 100644 --- a/mempalace/README.md +++ b/mempalace/README.md @@ -16,7 +16,7 @@ The Python package that powers MemPalace. All modules, all logic. | `dialect.py` | AAAK compression — entity codes, emotion markers, 30x lossless ratio | | `knowledge_graph.py` | Temporal entity-relationship graph — SQLite, time-filtered queries, fact invalidation | | `palace_graph.py` | Room-based navigation graph — BFS traversal, tunnel detection across wings | -| `mcp_server.py` | MCP server — 19 tools, AAAK auto-teach, Palace Protocol, agent diary | +| `mcp_server.py` | MCP server — 33 tools, AAAK auto-teach, Palace Protocol, agent diary | | `onboarding.py` | Guided first-run setup — asks about people/projects, generates AAAK bootstrap + wing config | | `entity_registry.py` | Entity code registry — maps names to AAAK codes, handles ambiguous names | | `entity_detector.py` | Auto-detect people and projects from file content | diff --git a/skills/mempalace/SKILL.md b/skills/mempalace/SKILL.md index c011f0ec4..b318af014 100644 --- a/skills/mempalace/SKILL.md +++ b/skills/mempalace/SKILL.md @@ -42,6 +42,6 @@ search-before-answer so the agent reads the palace instead of guessing. ## Cursor-specific notes -- The `mempalace-mcp` server is auto-registered by this plugin. Once installed, all 19 MemPalace MCP tools (`mempalace_search`, `mempalace_add_drawer`, `mempalace_diary_write`, `mempalace_check_duplicate`, `mempalace_diary_read`, etc.) are available to the agent without any further configuration. -- For automatic background saving every N agent turns plus session-start memory recall, also install the Cursor hooks separately by running `hooks/cursor/install.sh --scope user` from a cloned MemPalace repo. See [`website/guide/cursor-hooks.md`](../../../website/guide/cursor-hooks.md) for the full walkthrough. +- The `mempalace-mcp` server is auto-registered by this plugin. Once installed, all 33 MemPalace MCP tools (`mempalace_search`, `mempalace_add_drawer`, `mempalace_diary_write`, `mempalace_check_duplicate`, `mempalace_diary_read`, etc.) are available to the agent without any further configuration. +- For automatic background saving every N agent turns plus session-start memory recall, also install the Cursor hooks separately by running `hooks/cursor/install.sh --scope user` from a cloned MemPalace repo. See [`website/guide/cursor-hooks.md`](../../website/guide/cursor-hooks.md) for the full walkthrough. - The recommended `agent_name` when calling `mempalace_diary_write` from a Cursor session is `cursor-ide` (matches the precedent of `claude-code` and `codex`). diff --git a/website/guide/claude-code.md b/website/guide/claude-code.md index 94a73e084..a3b5f6121 100644 --- a/website/guide/claude-code.md +++ b/website/guide/claude-code.md @@ -15,7 +15,7 @@ Restart Claude Code, then type `/skills` to verify "mempalace" appears. With the plugin installed, Claude Code automatically: - Starts the MemPalace MCP server on launch -- Has access to all 29 tools +- Has access to all 33 tools - Learns the AAAK dialect and memory protocol from the `mempalace_status` response - Searches the palace before answering questions about past work diff --git a/website/guide/mcp-integration.md b/website/guide/mcp-integration.md index 182bfaef7..6d8c7731a 100644 --- a/website/guide/mcp-integration.md +++ b/website/guide/mcp-integration.md @@ -1,6 +1,6 @@ # MCP Integration -MemPalace provides 29 tools through the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/), giving any MCP-compatible AI full read/write access to your palace. +MemPalace provides 33 tools through the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/), giving any MCP-compatible AI full read/write access to your palace. ## Setup @@ -26,7 +26,7 @@ claude mcp add mempalace -- python -m mempalace.mcp_server --palace /path/to/pal codex mcp add mempalace -- python -m mempalace.mcp_server --palace /path/to/palace ``` -Now your AI has all 29 tools available. Ask it anything: +Now your AI has all 33 tools available. Ask it anything: > *"What did we decide about auth last month?"* diff --git a/website/guide/openclaw.md b/website/guide/openclaw.md index a9ca6dc47..cdfe4f591 100644 --- a/website/guide/openclaw.md +++ b/website/guide/openclaw.md @@ -27,7 +27,7 @@ Or by directly editing your OpenClaw configuration: ## How It Works -Once connected, OpenClaw agents receive all 29 tools along with the **Memory Protocol**—a strict behavioral guide indicating they should: +Once connected, OpenClaw agents receive all 33 tools along with the **Memory Protocol**—a strict behavioral guide indicating they should: 1. **Never guess**: Query `mempalace_search` or `mempalace_kg_query` before confidently answering. 2. **Keep an agent diary**: Maintain continuity between sessions by writing to `mempalace_diary_write`. 3. **Manage the Knowledge Graph**: Update declarative facts when things change using `mempalace_kg_add` and `mempalace_kg_invalidate`. diff --git a/website/reference/mcp-tools.md b/website/reference/mcp-tools.md index b1c2c9796..121014abd 100644 --- a/website/reference/mcp-tools.md +++ b/website/reference/mcp-tools.md @@ -1,6 +1,6 @@ # MCP Tools Reference -Detailed parameter schemas for all 31 MCP tools. +Detailed parameter schemas for all 33 MCP tools. ## Palace — Read Tools diff --git a/website/reference/modules.md b/website/reference/modules.md index a4485f551..4c12ae9ce 100644 --- a/website/reference/modules.md +++ b/website/reference/modules.md @@ -9,7 +9,7 @@ mempalace/ ├── README.md ← project documentation ├── mempalace/ ← core package │ ├── cli.py ← CLI entry point -│ ├── mcp_server.py ← MCP server (29 tools) +│ ├── mcp_server.py ← MCP server (33 tools) │ ├── knowledge_graph.py ← temporal entity graph │ ├── palace_graph.py ← room navigation graph │ ├── dialect.py ← AAAK compression @@ -56,7 +56,7 @@ Argparse-based CLI with subcommands: `init`, `mine`, `split`, `search`, `compres ### `mcp_server.py` — MCP Server -JSON-RPC over stdin/stdout. Implements the MCP protocol with 29 tools covering palace read/write, drawer CRUD, knowledge graph, navigation, tunnels, agent diary, and system operations. Includes the Memory Protocol and AAAK Spec in status responses. +JSON-RPC over stdin/stdout. Implements the MCP protocol with 33 tools covering palace read/write, drawer CRUD, knowledge graph, navigation, tunnels, agent diary, and system operations. Includes the Memory Protocol and AAAK Spec in status responses. ### `searcher.py` — Semantic Search