The memory-mcp platform is currently in development. The Self-hosted Community Edition is available now!

MCP Tools

Memory MCP exposes a set of tools for storing, retrieving, and managing persistent memory. Each memory is built from three simple primitives — understanding them makes every tool click.

These tools can be accessed by any MCP client connected to the Memory MCP endpoint.

The Three Primitives #

Content #

The memory itself. Free-form text — a conversation exchange, a decision, a note, a summary. There are no structural requirements. Store what’s meaningful, in whatever form makes sense for your use case.

When retrieving, the query field searches against content semantically — by meaning, not keyword match. “database connection issue” will surface memories about PostgreSQL errors even if those exact words don’t appear.

Labels #

Short topic tags that describe what a memory is about. Labels are substring-matched (case-insensitive), so plugin will match plugin-dev and plugin-development. The search term must appear within the label, not the reverse.

Multiple labels can be applied to a single memory, and queries can combine includes and excludes:

labels="memory-system,plugin"          # matches either (OR) — sorted by recency and best match
labels="memory-system,!cron"           # matches memory-system but not cron

Labels power the trending_labels tool — tokens extracted from labels across all memories build a popularity index that reflects what’s been discussed recently.

Source #

A free-form identifier for where a memory came from. Fuzzy-matched like labels, and supports the same include/exclude syntax.

Common patterns:

PatternExampleUse case
Agent identityagent:sonnet:mainPer-agent memory isolation
Category prefixpersonal or workTopic-based separation
Provenancesummary:42Mark derived/generated memories
URLhttps://example.com/pageWeb content attribution

Source is purely convention — Memory MCP doesn’t enforce any format.


Using Them Together #

The three primitives combine to make precise queries without needing exact text:

# Semantic search within a specific agent's memories
query="what did we decide about authentication"
source="agent:sonnet:main"

# Recent memories on either topic, excluding noise
labels="plugin-dev,!cron"

# Everything from a specific agent
source="agent:sonnet:main"

Any combination is valid. Fields left empty are not filtered on.


retrieve_memories

Retrieve memories with flexible filtering — semantic search, label filtering, source filtering, or any combination.

get_memory

Retrieve a specific memory by ID, including its full metadata and related memory map.

add_labels

Add labels to an existing memory without replacing existing ones.

del_labels

Remove specific labels from a memory without affecting others.

replace_labels

Atomically replace one or more labels with one or more new labels in a single operation.

random_memory

Retrieve a random memory, optionally filtered by labels or source.

memory_stats

Return memory counts and matched label or source lists for a namespace.

trending_labels

Get currently trending labels based on recent token activity and synaptic decay.

?

AI Assistant

0/500