LTM MCP Tools
memtomem exposes its LTM features as MCP tools. New users should keep the default core mode: it gives agents the common tools directly and routes everything else through mem_do, which keeps the agent’s visible tool list small.
Tool Modes
Section titled “Tool Modes”Set the mode with MEMTOMEM_TOOL_MODE in your MCP client config.
| Mode | Tools exposed | Use when |
|---|---|---|
core (default) | 9 total, including mem_do | Best default for most agents |
standard | 39, including mem_do | You want common management tools directly visible |
full | 94 current tools | You are debugging, documenting, or using a client that handles large tool lists well |
The following example is for a manual MCP-only connection. If a client plugin already supplies memtomem, check that client’s coexistence rule in Connect an AI Client before adding it.
Example:
{ "mcpServers": { "memtomem": { "command": "memtomem-server", "env": { "MEMTOMEM_TOOL_MODE": "core" } } }}To expose a registered tool individually on top of the mode, list it in MEMTOMEM_EXTRA_TOOLS (comma-separated), for example MEMTOMEM_EXTRA_TOOLS=mem_update_coverage. Set it in the environment the server is launched with; the server reads it at startup, so restart the server after changing it. A name the server does not register is logged and ignored. The plugins’ bundled servers and every registration mm init --mcp writes set MEMTOMEM_EXTRA_TOOLS=mem_update_coverage for the update workflow; a registration you write by hand for a client that runs that workflow needs the same.
Core Mode
Section titled “Core Mode”In core mode, the agent sees the tools needed for daily memory work:
| Tool | Purpose |
|---|---|
mem_status | Check server, storage, embedding, and index status |
mem_stats | Return index statistics |
mem_add | Store a new memory |
mem_search | Hybrid search over indexed memory (supports an optional deadline_ms server processing budget since 0.7.8) |
mem_recall | Browse recent or date-filtered memory |
mem_index | Index a file or directory |
mem_list | List indexed memories / sources, limit per page (1–500, default 50). Pass the cursor from the previous page’s “More:” line for the next page. |
mem_read | Read an indexed source file |
mem_do | Route all non-core actions by name |
Tell the agent what you want in natural language. It will usually pick the right core tool.
mem_do
Section titled “mem_do”mem_do provides access to every remaining action. It takes an action and optional params.
mem_do(action="help")mem_do(action="help", params={"category": "context"})mem_do(action="schedule_list")mem_do(action="context_diff", params={"scope": "project_shared"})mem_do(action="version")Use mem_do(action="help") from your MCP client to see the action catalog for the installed version.
The v0.7.13 registry has 94 current tools and 89 mem_do actions; 0.7.11 adds mem_dedup_remove, 0.7.9 removes the nine Context Gateway write tools from MCP (run them with mm context instead; read-only context_detect, context_diff, and context_compose remain), 0.7.8 adds the hermes_mirror_apply action, 0.7.2 added
mem_update_coverage (Update Coverage), and 0.7.1 added
mem_project_bind (Project Binding). Pinned Context adds mem_pinned_list/get/set/delete and
mem_context_compose; review-first formation adds
mem_formation_scan and mem_candidate_propose/list/review/recover/evidence. Full mode also includes mem_quality_replay for deterministic Quality Lab replays. By-id edit and delete refuse chunks indexed from explicit paths outside managed memory roots, registered project tiers, and ~/.memtomem/uploads with source_unmanaged (0.7.9).
mem_do(action="version") returns the server version, capability map, and a
secret-free runtime_profile describing the effective embedding/rerank runtime
and missing optional dependencies.
mem_candidate_propose creates a privacy-scanned pending review item rather
than durable memory. It requires content, source, source_ref, and an
idempotency_key; approved candidates alone pass through the normal write
path. Reusing a key with identical content returns the original pending
candidate; reusing it with different content is rejected.
mem_candidate_evidence compares a candidate with indexed memories in the caller’s scope, not other pending candidates or pinned context. A potential-conflict label is advisory, not a factual verdict or an automatic approval/rejection.
OpenCode
Section titled “OpenCode”Connect an AI Client covers registering memtomem in OpenCode through the published plugin or a manual local server, and which server runs when both are configured. Two points affect tool exposure:
- The published plugin starts the server in
coremode and deniesmemtomem_mem_doby default, so the actions routed throughmem_doneed a permission change first. See the plugin permissions. - For a manual server, set
MEMTOMEM_TOOL_MODEunder theenvironmentkey of its entry undermcpinopencode.json. OpenCode usesenvironment, notenv.
Common Actions
Section titled “Common Actions”| Category | Examples |
|---|---|
| Namespace | ns_list, ns_set, ns_assign, ns_update, ns_rename, ns_delete |
| Tags | tag_list, tag_rename, tag_merge, tag_delete |
| Sessions | session_start, session_end, session_list, project_bind |
| Scratch | scratch_set, scratch_get, scratch_promote |
| Context Gateway | context_detect, context_diff, context_compose (writes moved to mm context in 0.7.9) |
| Maintenance | dedup_scan, dedup_merge, dedup_remove, decay_scan, decay_expire, cleanup_orphans, auto_tag, update_coverage |
| Import / export | export, import, import_obsidian, import_notion, ingest |
| Quality / analytics | quality_replay, activity, timeline, eval, reflect |
Since 0.7.10, export (mem_export) takes output_file as a bare file name, not a path, and writes it to ~/.memtomem/exports/; the result names the full path. The name may use ASCII letters, digits, ., _, and - (at most 64 characters, no leading hyphen, no trailing dot, no Windows device name), such as backup.json. A path such as ~/backup.json is refused and nothing is exported, as is an exports directory that is a symbolic link or junction. import still takes a path, and the Web UI’s export and import are unchanged.
Duplicate Warning
Section titled “Duplicate Warning”After mem_add writes a note, it compares the stored vectors of the chunks that write created with existing chunks in the namespaces a default search sees. System namespaces such as archive:* are left out, and an active session’s namespace does not narrow the check. When an existing chunk is close enough, the result ends with ⚠ Similar memories found: and up to three of them, each with its storage similarity shown as (dense 0.97), not a percentage. The note is saved either way. Since 0.7.2 the check uses these stored vectors instead of a search, so it no longer reports the note itself and works the same with or without a reranker.
- Copied or paraphrased content may trigger the warning when its stored vectors reach the threshold. The score depends on the whole entry, including its title, and on the embedding model, and the threshold is provisional until it is calibrated across models. No warning does not mean the note is unique.
- The chunks the write created are excluded, including one that merged an earlier entry of the same file with the new note.
- The check is skipped when the content, after any template expansion, is 20 characters or fewer, and on a store without vectors (keyword-only).
To clean up, list candidate pairs with mem_do(action="dedup_scan"). One call scans at most max_scan chunks (default 500) in chunk-id order. When chunks remain, the last line of the output ends with the value that continues the scan, such as continue with after="<chunk-id>"; pass it back until the line says reached the end of the store:
mem_do(action="dedup_scan", params={"after": "<chunk-id>"})When one pool holds more pairs than limit (default 50, at most 500), the last line says how many were cut; scan the same position again with a higher limit to see them. Past 500 pairs in one pool, no single call lists them all. A walk in steps is also not one scan of the whole store: exact copies (same content hash) are paired only within a pool, so copies in different pools are found only by the near-duplicate search, which a keyword-only store does not run. Then handle a pair you confirm in one of two ways:
mem_do(action="dedup_merge", params={"keep_id": "<chunk-id>", "delete_ids": ["<chunk-id>"], "dry_run": false})mem_do(action="dedup_remove", params={"remove_id": "<chunk-id>", "keep_id": "<chunk-id>"})dedup_mergedeletes index rows only. The file still holds the text, so the next index pass brings it back. Without"dry_run": false, it only previews the merge.dedup_remove(0.7.11) removesremove_id’s lines from its file and re-indexes the file, asmem_deletedoes. It first checks both members: each member’s file and stored rows must still match that file’s last index receipt, the two must be in different files, and neither file may have another hard-linked name. A refusal names the member and the reason and removes nothing. A plainmm index <file>writes the receipt the check needs;mm index --force, the re-index a memory write runs, and index passes withindexing.enrich_chunk_contextorindexing.auto_summarizeon do not. The check does not decide whether the two say the same thing, so read both members first. Whenremove_idis aproject_sharedchunk, the call also needs"confirm_project_shared": true.
Project Binding
Section titled “Project Binding”The project context comes from the server’s working directory. A host can start a stdio server somewhere else, as the Hermes Agent and Antigravity CLI plugins do in the plugin’s directory, and then project_local never resolves. mem_project_bind (0.7.1) pins such a server to a project whose tier is registered:
mem_do(action="project_bind", params={"project_root": "/absolute/path/to/project"})After binding, the memory tools that use the project context use that project: search, recall, add, read and edit by id, and pinned context. mem_list stays store-wide, and the Context Gateway context_* actions and the health watchdog keep using the working directory.
- It works only on a stdio server, because streamable HTTP shares one context across clients.
project_rootmust be an absolute path inside a project whose tier is registered (mm mem init --scope project_local); otherwise the call is refused.- The binding is set once per MCP session and cannot be changed. A standalone stdio server serves one session, so binding another project needs a restart. On a shared daemon, each client connection is its own session with its own binding, so a new connection can bind another project without stopping the daemon. It is refused when the server’s working directory already lies in another registered project.
- If the tier is unregistered later, reads stay on the bound project, adds to the tier are refused, and pinned context is not re-checked until the server restarts. Until then
mem_statuswarnsbound_project_unregistered; restart the server or register the tier again withmm mem init.
Since 0.7.2, the Antigravity CLI plugin’s project workflows (handoff, brief, update) bind the server to the repository they run in; see Project Workflows. The Hermes Agent plugin’s workflows do not bind a project, and in both plugins the remember workflow always saves at user scope.
Update Coverage
Section titled “Update Coverage”mem_update_coverage (0.7.2) keeps, per project, the set of commit SHAs that a review of recent commits has already read. It is a set, not a cursor. The tool belongs to the maintenance category, so the default modes reach it through mem_do:
mem_do(action="update_coverage", params={"shas": ["<40-hex sha>", "<40-hex sha>"]})mem_do(action="update_coverage", params={"shas": ["<40-hex sha>"], "record": true, "run_id": "<uuid>"})shastakes 1 to 10 full 40-character lowercase SHAs without duplicates. The server checks their shape only and never runsgit.- With
record=false(the default), the result lists the given SHAs that no earlier call recorded, in the order given. - With
record=true, the SHAs are recorded as reviewed andrun_id(a canonical lowercase UUID, required) is kept as provenance. Record only commits whose full message was read, and only after the run’s lastmem_add; a review limited to one topic records nothing. Recording also prunes rows older than 90 days. - It needs a project context: start the server inside a project with a registered tier, or bind one with
mem_project_bind. - Coverage is stored only in the SQLite database. A JSON export does not carry it, and an import neither adds nor clears it, so after a bundle is restored into a store without that project’s coverage, those commits are reviewed again.
- The tool is marked as not read-only, so a caching proxy does not replay an earlier answer.
- The
updateworkflow of the plugins released with Core 0.7.13 calls it inincrementalandfullmode, through its own tool name rather thanmem_do; see Review coverage.
When to Change Modes
Section titled “When to Change Modes”Stay in core when:
- You are setting up memtomem for an agent.
- You want lower prompt/tool-list overhead.
- You are not sure which mode you need.
Use standard when an MCP client works better with direct tools than mem_do routing.
Use full when you are testing, writing docs, or manually exercising every tool. full intentionally exposes a large surface.
CLI Mirrors
Section titled “CLI Mirrors”Most common MCP operations have CLI equivalents:
| MCP | CLI |
|---|---|
mem_status | mm status |
mem_add | mm add |
mem_search | mm search |
mem_index | mm index |
mem_do(action="context_diff") | mm context diff |
mem_do(action="schedule_list") | mm schedule list |
If an agent is struggling to call the right tool, run the CLI command once yourself and then ask the agent to follow the same operation.
MCP Resources
Section titled “MCP Resources”Alongside the tools, memtomem serves read-only data as MCP resources. Each one returns JSON.
| URI | Contents |
|---|---|
memtomem://sources | The first page of visible source files (50, the same as mem_list’s default) with chunk counts |
memtomem://sources{?cursor,limit,namespace} | Later pages. limit is 1–500 (default 50); as with mem_list, only namespace lists files that live solely in a system namespace |
memtomem://namespaces | Namespaces and their chunk counts |
memtomem://tags | Tags visible in the caller’s project boundary and their counts |
memtomem://stats | Current index statistics |
memtomem://chunks/{chunk_id} | One chunk by UUID. As with mem_read, an id from another project reads as not found |
A sources page is {"sources": [...], "page_size": N, "next": ...}. next is the full URI of the following page, or null on the last page.
Full-mode tool names
Section titled “Full-mode tool names”These are the 94 current names in full mode, distinct from the nine tools exposed by default in core mode.
mem_activitymem_addmem_add_redaction_statsmem_agent_registermem_agent_searchmem_agent_sharemem_askmem_auto_tagmem_batch_addmem_candidate_evidencemem_candidate_listmem_candidate_proposemem_candidate_recovermem_candidate_reviewmem_cleanup_orphansmem_configmem_conflict_checkmem_consolidatemem_consolidate_applymem_context_composemem_context_detectmem_context_diffmem_decay_expiremem_decay_scanmem_dedup_mergemem_dedup_removemem_dedup_scanmem_deletemem_domem_editmem_embedding_resetmem_entity_scanmem_entity_searchmem_evalmem_expandmem_exportmem_fetchmem_formation_scanmem_importmem_import_notionmem_import_obsidianmem_importance_scanmem_indexmem_linkmem_listmem_ns_assignmem_ns_deletemem_ns_getmem_ns_listmem_ns_renamemem_ns_setmem_ns_updatemem_pinned_deletemem_pinned_getmem_pinned_listmem_pinned_setmem_policy_addmem_policy_deletemem_policy_listmem_policy_runmem_procedure_listmem_procedure_savemem_project_bindmem_quality_replaymem_readmem_recallmem_reflectmem_reflect_savemem_relatedmem_resetmem_schedule_deletemem_schedule_listmem_schedule_registermem_schedule_run_nowmem_scratch_getmem_scratch_promotemem_scratch_setmem_searchmem_search_feedbackmem_search_historymem_search_suggestmem_session_endmem_session_listmem_session_startmem_statsmem_statusmem_tag_deletemem_tag_listmem_tag_mergemem_tag_renamemem_timelinemem_unlinkmem_update_coveragemem_watchdog