MCP — Model Context Protocol

One protocol.
Every agent
remembers.

SuperLocalMemory exposes 7 MCP tools — remember, recall, search, compress, cache, retrieve, and status — so any MCP-compatible agent gets local-first, mathematically-grounded memory in under 2 minutes.

// MCP connection topology
Claude / Cursor / Windsurf
MCP client · JSON-RPC 2.0
tools/call
SLM MCP Server
7 tools · stdio / SSE · local
Fisher-Rao retrieval
CozoDB
graph memory
LanceDB
vector index
7
MCP Tools
<2 min
Setup time
$0
Per cache hit
100%
Local — no cloud
The MCP Surface

7 tools. Every agent
needs exactly these.

Each tool maps to a core SLM capability. Agents call them via JSON-RPC 2.0 over stdio or SSE — no HTTP server required.

remember
async (content, metadata?) → id
Store any string as a memory. SLM embeds it, computes initial confidence on the Fisher-Rao manifold, and writes it to CozoDB + LanceDB atomically. Returns a UUID for later reference.
contentstring*The memory text to store
metadataobjectArbitrary key-value tags (project, session, tags…)
recall
async (query, limit?, threshold?) → Memory[]
Retrieve the most relevant memories using Fisher-Rao geodesic distance on the Riemannian manifold. Confidence-weighted ranking improves with every access — unlike cosine similarity, which never learns.
querystring*Natural language query
limitnumberMax results (default: 5)
thresholdnumberMin confidence 0–1 (default: 0.0)
search
async (query, filter?) → Memory[]
Full-text + semantic hybrid search across the memory store. Supports metadata filters for project-scoped, tag-filtered, or time-bounded retrieval. Complements recall for exact-match lookups.
querystring*Search terms
filterobjectMetadata filter (e.g. { project: "slm" })
compress
async (text, ratio?) → CompressedText
Extractive compression of long text to fit within token budgets. Preserves information-theoretically maximal content using sentence-level importance scoring. Achieves 60–95% token reduction with <3% semantic loss.
textstring*Text to compress
rationumberTarget compression 0.05–0.95 (default: 0.3)
slm_cache_set / get
async (key, value?, ttl?) → any
Semantic LLM response cache. Set stores a prompt+response pair under a semantic key. Get retrieves it if a semantically-equivalent prompt was seen before, returning $0 on a hit. Learned similarity thresholds prevent false hits.
keystring*Prompt or semantic key
valueanyResponse to cache (set only)
ttlnumberTime-to-live seconds (default: 3600)
slm_retrieve
async (id) → Memory
Fetch a specific memory by UUID. Also reinforces its confidence score on the Riemannian manifold — access is a signal of relevance. Useful for structured workflows that reference memories by ID across sessions.
idstring*Memory UUID returned by remember
get_status
async () → SLMStatus
Returns system health: memory count, cache hit rate, disk usage, active mode (A/B/C), daemon version, and uptime. Useful for agents that need to check SLM availability before a session starts or log operational metrics.
No parameters required
Quick Start

Connected in
under 2 minutes.

Three steps from pip install to your agent calling remember().

1

Install SLM

One pip install. No Docker, no cloud setup, no API keys.

terminal
pip install superlocalmemory
slm init
2

Add to claude_desktop_config.json

Point your MCP client at the SLM server. Works with Claude Desktop, Cursor, Windsurf, Cline, and any JSON-RPC 2.0 MCP client.

~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "superlocalmemory": {
      "command": "slm",
      "args": ["mcp"]
    }
  }
}
3

Verify the connection

Restart your MCP client. Ask it to call get_status — you should see memory count, mode, and uptime.

example agent message
// In Claude Desktop or Cursor, tell the agent:
"Use the superlocalmemory MCP to call get_status"

// Expected response:
{
  "status": "healthy",
  "mode": "A",
  "memories": 0,
  "cache_hit_rate": "—",
  "version": "3.6.x"
}
Advanced

SSE transport & custom config

Run SLM as a persistent HTTP server with SSE transport for long-running agents, CI pipelines, or multi-client setups.

SSE server mode
# Start as persistent SSE server
slm mcp --transport sse --port 8765

# Point client at the SSE endpoint:
"url": "http://localhost:8765/sse"
~/.slm/config.toml — custom options
[mcp]
transport = "stdio"     # or "sse"
port      = 8765        # SSE only

[memory]
mode      = "A"         # A=full B=local C=api
max_items = 1000000

[cache]
enabled    = true
similarity = 0.92       # learned threshold
ttl        = 3600
Compatibility

Works with every
major MCP client.

SLM follows the MCP specification (2024-11 revision). Any compliant client connects immediately.

Claude Desktop
stdio · all 7 tools
Claude Code
stdio · full session memory
Cursor
stdio · composerAgent
Windsurf
stdio · Cascade MCP
Cline
stdio · full spec
Zed Editor
stdio · context extension
Continue
stdio · VS Code + JetBrains
Custom agents
JSON-RPC 2.0 · SSE
Best Practice

The 3-line system prompt
that unlocks everything.

Add these instructions to your agent's system prompt. The agent will then automatically use SLM tools to build a persistent memory across every session.

system prompt addition
# Add to your system prompt:

Before responding to questions, check SuperLocalMemory
for relevant context using the recall tool.

After making decisions, fixing bugs, or learning
preferences, store them using the remember tool.

On session start, call get_status to confirm
SLM is healthy.
FAQ

Common questions

No. SLM is 100% local. The MCP server runs on your machine, all memories are stored on disk in CozoDB + LanceDB, and embeddings are computed locally. Nothing leaves your machine.
Yes. Claude Code's subagents run in the same shell environment and inherit the MCP config. Each subagent can independently call remember and recall, building shared context across an entire multi-agent session.
recall uses the Fisher-Rao metric on the statistical manifold — confidence-weighted, mathematically grounded, improves with use. search is a hybrid full-text + vector search optimized for exact or keyword matches. Use recall for "what do I know about X?" and search for "find the note I wrote about Y."
Yes, via the metadata filter. Pass {"project": "my-project"} on remember and recall to create project-scoped memory namespaces within a single SLM instance. No separate processes needed.
Tested at 1M+ memories with zero measurable slowdown on an M-series Mac over 5 years of daily use. CozoDB's index and LanceDB's IVF-PQ vector index both scale sub-linearly. Bounded storage mode (Mode B) automatically evicts cold memories when limits are reached.
Yes. SLM tracks the MCP specification and is tested against both the 2024-11 and 2025-03 revisions. Breaking changes in the spec are handled in minor version updates with deprecation warnings before removal.
Ready?

Your agents,
finally remembering.

One pip install. 2 minutes to your first memory. Local, open source, mathematically grounded.

Get Started Read the Paper