Mmcp.market

lean-memory MCP server

by Wuesteon·io.github.Wuesteon/lean-memory·v0.3.0

Embedded, local-first agent memory: one SQLite file per namespace, no server, no cloud.

A88/100grade A
What users say
No reviews yet
Be the first
Safety scan
A88/100

full report

Adoption
Growing

42 stars

Reviews

Write one

Nobody has reviewed lean-memory yet.

If you have run it, two minutes of your experience saves the next person an afternoon.

lean-memory tools (7, 2 write)

write = sends, deletes, buys or posts

Read from the package source without running it. The installed server may list more.

  • memory_add

    Distill durable facts from text and write them to a namespace's memory.

  • memory_clearwrite action

    Delete ALL memory for a namespace by removing its SQLite file. Irreversible.

  • memory_maintenance_runwrite action

    Run one sleep-time maintenance pass on a namespace (§6.3).

  • memory_maintenance_status

    Report a namespace's maintenance ledger — runs + pending proposals (§6.3).

  • memory_review_decide

    Decide a maintenance proposal: approve | reject | edit | promote (§6.3).

  • memory_review_queue

    List pending maintenance proposals, grouped by entity, with evidence (§6.3).

  • memory_search

    Retrieve the facts most relevant to a query from a namespace's memory.

Public scan report

scanner v0.1.9 · 2026-09-24 · same rubric, same numbers if you re-run it

no findings
  • Code scan36 source files scanned25/25
  • Live reliabilityno gateway calls yet and no remote to proben/a
  • Tool poisoningtools not inspected (local package is not executed); not countedn/a
  • Auth qualitylocal package, no credentials required12/15
  • Maintenancelast push 48 days ago12/15
  • Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
Overall 88/100. Components that don't apply are left out of the denominator. Any critical finding is an F.RubricAppeal a findingJSON

What the publisher says

From the lean-memory repository's README, as published. We do not edit it. Read it on GitHub

lean-memory

Embedded, local-first agent memory. No server, no daemon, no mandatory cloud key.

Status (2026-07): first public release line (0.2.1) is live on PyPI and

the MCP Registry (MCP-first launch); the Claude Code plugin ships in this

repo (marketplace listing pending).

Roadmap and rationale: docs/superpowers/specs/2026-07-08-strategic-direction-design.md.

Public benchmark runs (LongMemEval/LoCoMo) are deliberately deferred until

after launch; the harness is complete (bench/phase2_*.py) and the engine

flaws it exposed are fixed — see docs/phase2-learnings.md.

from lean_memory import Memory

mem = Memory(root="./data")

mem.add("user-42", "I work at Acme Corp.")
mem.add("user-42", "I now work at Globex.")          # supersedes Acme automatically

mem.search("user-42", "where does the user work?")   # → "I now work at Globex."

Facts are extracted from natural language, stored in a per-namespace SQLite file, and retrieved with hybrid dense+sparse search. Old facts are never deleted — they're superseded and queryable at any past point in time.

Install

pip install lean-memory

Runs fully offline out of the box. Optional extras unlock real model quality:

Quickstart

from lean_memory import Memory

mem = Memory(root="./data")   # one SQLite file per namespace, stored under ./data/

# Store facts in natural language
mem.add("alice", "I work at Stripe.")
mem.add("alice", "I now work at Vercel.")   # supersedes Stripe automatically

# Retrieve — the superseded Stripe fact drops out; only the current one is returned
results = mem.search("alice", "what does Alice do for work?", k=3)
for hit in results:
    print(hit.fact.fact_text, hit.final_score)
# → I now work at Vercel. 0.89

# Point-in-time query — what was true at a specific moment?
mem.search("alice", "employer", as_of=1_700_000_000_000, is_latest_only=False)  # epoch ms

# Always close when done (flushes WAL)
mem.close()

Demo Agent

A terminal chatbot showing the full memory loop — add, retrieve, supersede, restart. The demo script lives in the repo (it is not installed with the package):

git clone https://github.com/Wuesteon/lean-memory && cd lean-memory
pip install -e '.[examples]'
export ANTHROPIC_API_KEY=sk-ant-...
python examples/chat.py                  # uses offline stubs by default
python examples/chat.py --namespace bob  # separate memory tenant, persists across restarts

No API key? The demo still runs — it echoes the retrieved memory context instead of calling Claude, so you can watch the engine work offline.

MCP Server — memory for Claude Code / Claude Desktop

Give any MCP agent persistent local memory: three tools (memoryadd, memorysearch, memory_clear), one SQLite file per namespace, nothing leaves your machine.

pip install 'lean-memory[mcp,models,extract]'

Shortened. The full README is on GitHub.

Nothing above is checked by us. What we check is on the safety report.

Install directly

claude mcp add lean-memory -- uvx lean-memory
Add to Cursor

lean-memory: common questions

Is lean-memory MCP server safe?
Yes, by our scan: it is graded A (88/100). Read the lean-memory safety report
How do I install lean-memory?
It runs on your machine. Copy the Claude Code, Claude Desktop or Cursor config from the install section.
Does lean-memory need an API key?
No secret keys are declared. It reads 1 setting from the environment.
Is lean-memory maintained?
The last commit was 48 days ago (2026-08-07). The latest release is v0.3.0.
What can I use instead of lean-memory?
Servers from other publishers that do the same job: Remem MCP server, memo MCP server and remem-mcp — Local-first MCP Memory + CodeGraph + Wiki MCP server. Compare all lean-memory alternatives.

Alternatives to lean-memory

Same job from other publishers: the closest match first, then the best rated.

All lean-memory alternatives →
  • Remem
    Local-first automatic memory for Claude Code and Codex: capture, distill, recall from SQLite.
    B
  • memo
    Memory for AI agents — MLX (Apple Silicon) or CPU (Linux), sqlite-vec + BM25, zero cloud.
    A
  • remem-mcp — Local-first MCP Memory + CodeGraph + Wiki
    Local-first memory for AI coding agents. Memory + CodeGraph + Wiki in one SQLite file.
    B
  • Citadel
    Encrypted-first embedded database with vector search and agent memory, exposed as MCP tools
    B
  • KEPTA — Agent Memory
    Local memory for AI agents. One SQLite file on your machine — no cloud, no account.
    A

More from Wuesteon