LuciferMornens/RWM-MCP
If you are the rightful owner of RWM-MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Resumable Working Memory (RWM) MCP Server provides terminal coding agents with a durable working memory, enabling them to resume sessions with relevant context.
Resumable Working Memory (RWM) MCP Server
RWM gives terminal coding agents (Codex CLI, Claude Code, etc.) a durable working memory. It records structured state framesâdecisions, diffs/snippets, test traces, durable factsâand when you resume a session it returns a compact bundle of the most relevant context so the model can pick up exactly where it left off.
The repository contains the TypeScript MCP server, a dynamic launcher that maps memories to the current project automatically, and lightweight utility types.
Features
- Automatic per-project storage: the launcher detects your working directory, reuses
rwm.db
/rwm_artifacts/
if present, or creates them on first run. - Structured commits:
memory_commit
enforces typed records for decisions, artifacts, and facts so memories stay verifiable. - Token-budgeted resume bundles:
memory_resume
runs a knapsack over recent tasks/events/facts and returns a succinct âNowâ card plus pointer IDs. - Safe workspace reads:
memory_span
only serves files inside the configured root usingsafeJoin
. - Session ID normalization: incoming
session_id
values like<repo>@unknown
are rewritten to<repo>@<branch-or-date>
using the workspaceâs Git metadata when available. - Optional tokenizer integration: supports OpenAI and Anthropic token estimators when the packages are available, with graceful fallbacks.
Requirements
- Node.js 18+
- npm (or a compatible package manager)
Installation
# clone the repo
cd /path/to/your/projects
git clone https://github.com/LuciferMornens/RWM-MCP.git
cd rwm-mcp
# install dependencies and build
npm install
npm run build
This produces the compiled server at dist/index.js
.
Configure Codex CLI (once)
Add the launcher to ~/.codex/config.toml
:
[mcp_servers.rwm]
command = "node"
args = ["/absolute/path/to/rwm-mcp/tools/rwm-launch.mjs"]
Now, whenever you run codex
inside a project:
- The launcher discovers the current directory.
- If
rwm.db
andrwm_artifacts/
exist there, it reuses them; otherwise it creates them. - It forwards
--root
,--db
,--artifacts
, and the bundle token budget (default4500
, overridable with theRWM_BUNDLE_TOKENS
env var) to the compiled MCP server.
Memories are therefore scoped automatically to the project youâre inâno profile juggling or config switching.
Optional: Claude Code
Claude Code speaks MCP as well. Point its connector to the same launcher script and the behavior is identical (per-project databases in the repo root).
MCP Tools
Tool | Purpose |
---|---|
memory_resume | Return a âNowâ bundle (objective, active tasks, last decisions/failures) plus pointer IDs within the given token budget. |
memory_commit | Append a state frame containing decisions (DECISION , ASSUMPTION , FIX , BLOCKER , NOTE ), artifacts (DIFF , SNIPPET , CONFIG , FIXTURE , TEST_TRACE , LOG , OTHER ), and durable facts. |
memory_update | Update an existing task (title/status/acceptance), overwrite an artifactâs stored diff text/metadata, or revise a fact by ID. |
memory_fetch | Retrieve a record by ID. Artifacts return an artifact://sha256/... resource link. |
memory_span | Read a specific file range (start/end line) within the configured root. |
memory_search | Lightweight lookup for task/event/fact IDs matching a query. |
memory_checkpoint | Create a labeled checkpoint for milestones. |
Memory Flow
- Resume: Call
memory_resume
withsession_id
(e.g.,repo@branch
). The bundle planner uses token estimates to fit the highest-value items under the configured budget. - Fetch on demand: Use
memory_fetch
/memory_span
for any pointer ID you need to inspect. - Commit frequently: After meaningful steps (edits, tests, decisions) call
memory_commit
with structured entries so future sessions retain verifiable context. - Checkpoint before risk:
memory_checkpoint
creates durable restore points when needed.
Because memories live next to your project (rwm.db
, rwm_artifacts/
), the state survives across
Codex/Claude sessions, machine restarts, and even tool upgrades.
Development
npm run build # compile TypeScript to dist/
npm run dev # optional: run with ts-node/esm loader
Tests are not included yet; add them under src/
and wire into package.json
when needed.
License
MIT