Skip to content

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.

Set the mode with MEMTOMEM_TOOL_MODE in your MCP client config.

ModeTools exposedUse when
core (default)9 total, including mem_doBest default for most agents
standard39, including mem_doYou want common management tools directly visible
full94 current toolsYou 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.

In core mode, the agent sees the tools needed for daily memory work:

ToolPurpose
mem_statusCheck server, storage, embedding, and index status
mem_statsReturn index statistics
mem_addStore a new memory
mem_searchHybrid search over indexed memory (supports an optional deadline_ms server processing budget since 0.7.8)
mem_recallBrowse recent or date-filtered memory
mem_indexIndex a file or directory
mem_listList 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_readRead an indexed source file
mem_doRoute 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 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.

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 core mode and denies memtomem_mem_do by default, so the actions routed through mem_do need a permission change first. See the plugin permissions.
  • For a manual server, set MEMTOMEM_TOOL_MODE under the environment key of its entry under mcp in opencode.json. OpenCode uses environment, not env.
CategoryExamples
Namespacens_list, ns_set, ns_assign, ns_update, ns_rename, ns_delete
Tagstag_list, tag_rename, tag_merge, tag_delete
Sessionssession_start, session_end, session_list, project_bind
Scratchscratch_set, scratch_get, scratch_promote
Context Gatewaycontext_detect, context_diff, context_compose (writes moved to mm context in 0.7.9)
Maintenancededup_scan, dedup_merge, dedup_remove, decay_scan, decay_expire, cleanup_orphans, auto_tag, update_coverage
Import / exportexport, import, import_obsidian, import_notion, ingest
Quality / analyticsquality_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.

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_merge deletes 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) removes remove_id’s lines from its file and re-indexes the file, as mem_delete does. 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 plain mm index <file> writes the receipt the check needs; mm index --force, the re-index a memory write runs, and index passes with indexing.enrich_chunk_context or indexing.auto_summarize on do not. The check does not decide whether the two say the same thing, so read both members first. When remove_id is a project_shared chunk, the call also needs "confirm_project_shared": true.

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_root must 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_status warns bound_project_unregistered; restart the server or register the tier again with mm 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.

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>"})
  • shas takes 1 to 10 full 40-character lowercase SHAs without duplicates. The server checks their shape only and never runs git.
  • 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 and run_id (a canonical lowercase UUID, required) is kept as provenance. Record only commits whose full message was read, and only after the run’s last mem_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 update workflow of the plugins released with Core 0.7.13 calls it in incremental and full mode, through its own tool name rather than mem_do; see Review coverage.

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.

Most common MCP operations have CLI equivalents:

MCPCLI
mem_statusmm status
mem_addmm add
mem_searchmm search
mem_indexmm 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.

Alongside the tools, memtomem serves read-only data as MCP resources. Each one returns JSON.

URIContents
memtomem://sourcesThe 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://namespacesNamespaces and their chunk counts
memtomem://tagsTags visible in the caller’s project boundary and their counts
memtomem://statsCurrent 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.

These are the 94 current names in full mode, distinct from the nine tools exposed by default in core mode.

  • mem_activity
  • mem_add
  • mem_add_redaction_stats
  • mem_agent_register
  • mem_agent_search
  • mem_agent_share
  • mem_ask
  • mem_auto_tag
  • mem_batch_add
  • mem_candidate_evidence
  • mem_candidate_list
  • mem_candidate_propose
  • mem_candidate_recover
  • mem_candidate_review
  • mem_cleanup_orphans
  • mem_config
  • mem_conflict_check
  • mem_consolidate
  • mem_consolidate_apply
  • mem_context_compose
  • mem_context_detect
  • mem_context_diff
  • mem_decay_expire
  • mem_decay_scan
  • mem_dedup_merge
  • mem_dedup_remove
  • mem_dedup_scan
  • mem_delete
  • mem_do
  • mem_edit
  • mem_embedding_reset
  • mem_entity_scan
  • mem_entity_search
  • mem_eval
  • mem_expand
  • mem_export
  • mem_fetch
  • mem_formation_scan
  • mem_import
  • mem_import_notion
  • mem_import_obsidian
  • mem_importance_scan
  • mem_index
  • mem_link
  • mem_list
  • mem_ns_assign
  • mem_ns_delete
  • mem_ns_get
  • mem_ns_list
  • mem_ns_rename
  • mem_ns_set
  • mem_ns_update
  • mem_pinned_delete
  • mem_pinned_get
  • mem_pinned_list
  • mem_pinned_set
  • mem_policy_add
  • mem_policy_delete
  • mem_policy_list
  • mem_policy_run
  • mem_procedure_list
  • mem_procedure_save
  • mem_project_bind
  • mem_quality_replay
  • mem_read
  • mem_recall
  • mem_reflect
  • mem_reflect_save
  • mem_related
  • mem_reset
  • mem_schedule_delete
  • mem_schedule_list
  • mem_schedule_register
  • mem_schedule_run_now
  • mem_scratch_get
  • mem_scratch_promote
  • mem_scratch_set
  • mem_search
  • mem_search_feedback
  • mem_search_history
  • mem_search_suggest
  • mem_session_end
  • mem_session_list
  • mem_session_start
  • mem_stats
  • mem_status
  • mem_tag_delete
  • mem_tag_list
  • mem_tag_merge
  • mem_tag_rename
  • mem_timeline
  • mem_unlink
  • mem_update_coverage
  • mem_watchdog