Memory Lean

MCP文档知识

提供方 未标注

文档知识 未标注 未标注 社区 / 第三方 Claude DesktopClaudeCursorVS Code
查看接入方式

为AI编码代理提供长期记忆,不消耗上下文窗口。作为参考记忆服务器的即插即用替代品,答案体积缩小约40倍。单文件,零依赖。

一句话选型结论

按资料字段整理

Memory Lean 属于文档知识类 MCP 服务器,传输方式未标注,鉴权方式未标注,可直接接入 Claude Desktop、Claude、Cursor 等,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类文档知识 传输方式未标注 鉴权未标注 部署方式未标注
GitHub 星标 未标注 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

文档知识
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

记忆

安装与配置

未标注 未标注
上游未给出传输方式
{ "mcpServers": { "memory": { "command": "npx", "args": ["-y", "memory-lean"] } } }

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    按官方文档确认运行环境(常见为 Node.js 或 Python),装好后再执行安装命令。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
文档检索问答

在你的文档库里按问题找答案。

知识库读写

把新资料写进知识库,随用随取。

内容整理

把零散资料归纳成结构化笔记。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude、Cursor,换客户端不用重新研究配置。

先想清楚的地方

  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在文档知识场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Memory Lean当前 未标注 未标注 未标注 有 未标注
dify 未标注 stdio · 本地进程 本地部署 有 2026-04-11
open-webui 未标注 stdio · 本地进程 本地部署 有 2026-04-11
JeecgBoot 未标注 stdio · 本地进程 本地部署 有 2026-04-11
Cherry Studio 未标注 未标注 未标注 无 2026-05-17
mempalace 未标注 stdio · 本地进程 本地部署 有 2026-04-11

服务器档案

文档知识
字段来自项目仓库与公开索引,中文说明由本站标注
提供方未标注上游标注的维护方 未标注
分类文档知识本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式未标注远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型未标注上游给出的部署形态
最近核验未标注上游最后核验时间

详细介绍

12.8 KB
来自项目仓库与上游目录的原文,未做删改

memory-lean

Long-term memory for AI coding agents that doesn't burn the context window.

A knowledge graph your agent searches cheaply, and a web UI where you can see and edit all of it.

Quick start ·
Web UI ·
How it works ·
Tools ·
Setup for 12 agents ·
Contributing

memory-lean is an MCP server that gives Claude
Code, Codex, Cursor, MiMo Code and any other MCP client a memory that lasts between
sessions: which projects exist, what depends on what, which version shipped, what
is still pending, and which rules were learned the hard way. It is a drop-in
replacement for the reference memory server
(@modelcontextprotocol/server-memory),
with the same file and tool names, but its answers are about 40 times smaller.

Highlights

About 40× smaller answers. Search returns a ranked list of names and the lines
that matched, not every entity in full, so the agent can afford to check its
memory before every task.

A web UI for people. See the whole graph grouped by type, follow relations,
and add, edit or delete anything. Agent writes show up live.

Drop-in replacement. Same memory.jsonl file and the same nine tools as the
reference server. Switch in, and switch back whenever you like.

Works with every agent. Copy-paste setup for Claude Code, MiMo Code, Codex,
Cursor, Copilot, Gemini CLI, Zed, JetBrains and more, plus the instructions that
teach the agent to use it.

Stays small by itself. Short facts, a cap per entity, and an archive for the
overflow, so the graph never grows into a wall of text.

Private and safe. Plain local files, daily backups, a write lock for parallel
sessions, and no network access. One server file, zero dependencies.

The numbers

Measured on a real graph of 237 entities, 355 relations and 1,160 facts
(tokens ≈ characters ÷ 4):

Call Reference server memory-lean
read_graph ~77,800 tokens ~2,000 tokens 40× smaller
search_nodes, average of 5 common words ~31,000 tokens ~770 tokens 40× smaller

A narrow search that matches one or two entities saves less, because there is
little to trim. To measure your own graph, run node tools/bench.mjs from a clone;
it is read-only and prints sizes, never content.

Quick start

Claude Code: install the plugin. It adds the server, the instructions as a
skill, a short reminder at the start of each session, and /memory-ui.```text
/plugin marketplace add zamansheikh/memory-lean
/plugin install memory-lean@memory-lean


**Any other agent**: add the server to its MCP config, then give it the instructions.```json
{
  "mcpServers": {
    "memory": { "command": "npx", "args": ["-y", "memory-lean"] }
  }
}
``````bash
npx -y memory-lean --protocol >> AGENTS.md   # into the rules file your agent reads

Just looking? Open the web UI on a made-up example graph:```bash
npx -y memory-lean --ui --demo


Setup for each agent

| Agent | Server config | Instructions |
|---|---|---|
| Claude Code | plugin | included in the plugin |
| Xiaomi MiMo Code | `mimocode.jsonc` | skill or `AGENTS.md` |
| opencode | `opencode.json` | `AGENTS.md` |
| OpenAI Codex CLI | `codex mcp add` | `AGENTS.md` |
| Cursor | `.cursor/mcp.json` | `AGENTS.md` or a rule |
| VS Code (Copilot) | `.vscode/mcp.json` | `copilot-instructions.md` |
| Gemini CLI | `settings.json` | `GEMINI.md` |
| Windsurf | `mcp_config.json` | a rule |
| Cline | `cline_mcp_settings.json` | `.clinerules/` |
| Zed | `settings.json` | `AGENTS.md` or `.rules` |
| JetBrains IDEs | AI Assistant settings | a rule or guidelines |
| Claude Desktop | `claude_desktop_config.json` | project instructions |

The graph is created on the first write at `~/.claude/memory-graph/memory.jsonl`,
whichever agent writes it, so all your agents share one memory. Set
`MEMORY_FILE_PATH` to keep it somewhere else.

## Web UI```bash
npx -y memory-lean --ui

This opens your memory in the browser. Everything an agent can do, you can do here:

  • Explore. Each type gets its own bubble. Click an entity to highlight
    everything it connects to, drag nodes to arrange them, and scroll to zoom.
    Search matches names, types and facts.
  • Edit. Add, edit and delete facts, rename an entity or change its type, add
    and remove relations, create and delete entities, and restore archived facts.
    Every change passes the same checks as the agents' tools.
  • Watch. Changes your agents make appear within two seconds.
  • Spot problems. The overview lists pending work, the most connected
    entities, and anything over budget, which is also marked on the graph.

Follow the connections. Select an entity to see its facts and relations.
Find anything. Search names, types and facts at once.

Edit in place. With the same 300-character limit the agents have.
Light or dark. It follows your system, or pick one.

The page runs on your machine only (127.0.0.1) and needs the one-time key in
the link it prints, so other websites cannot read or change your memory. Nothing
is uploaded anywhere.

How it works

Search, then open

The reference server answers a search with every matching entity in full, as
pretty-printed JSON. memory-lean answers with a ranked list of names and the lines
that matched:```text
> search_nodes { "query": "deploy" }

57 match "deploy", top 10 shown (narrow the query or raise limit). open_nodes for full entities.
- shop-backend [service] 12 obs, 6 rel
› 2026-03-02: deployed 2.4.0 to production
› deploy with scripts/release.sh, never by hand
- PENDING shop-backend 2.4.0 [pending] 2 obs, 3 rel
› …mobile apps still call the old endpoint until the deploy of 2.4.0 reaches them


The agent then opens only what it needs:```text
> open_nodes { "names": ["shop-backend"] }

## shop-backend [service] (3 archived)
- NestJS API behind api.example.com
- 2026-03-02: deployed 2.4.0 to production

## relations
shop-app -talks_to-> shop-backend
PENDING shop-backend 2.4.0 -blocks-> shop-app

Why it stays lean

Limit What it means
Small answers search_nodes returns at most 10 names with snippets, read_graph returns an index of names, and only open_nodes returns full entities.
Short facts An observation longer than 300 characters is rejected, with a message telling the agent to split it or put the detail in the repo.
A cap per entity An entity keeps 15 observations. Past that, the oldest dated ones move to archive/.md. Nothing is deleted: they can be listed and restored, and undated facts (the identity facts) always stay.
Search that narrows Every word must match somewhere in the entity, so adding a word narrows the result. The reference server looks for the query as one exact phrase.

How it keeps your data safe

Safeguard What it means
Safe to share Writers take a lock file, so several agent sessions can use one graph without overwriting each other. Every write replaces the file atomically.
Daily backups A copy goes to backups/ once a day; the last 7 are kept.
Damaged lines are kept A line that cannot be read is moved to memory.jsonl.unreadable on the next write and reported, never silently dropped.
Plain files The graph is JSON lines, archives are Markdown, backups are copies. You can read, grep and edit all of it by hand.

Tools

Tool What it returns
search_nodes Ranked list of entity names with counts and up to two matching snippets each. Every word must match the name, type, an observation, or the type of a relation touching the entity.
open_nodes The full entities you name, as compact text, with every relation touching them and their archive count. Unknown names come back with "did you mean" suggestions.
read_graph An index: entity names grouped by type, with observation counts. Never the observations.
create_entities Creates entities; existing names are skipped.
create_relations Creates relations between existing entities; duplicates are skipped.
add_observations Adds facts to an entity, enforcing the length limit and the per-entity cap.
delete_observations Removes observations by exact text.
delete_relations Removes specific relations.
delete_entities Removes entities and every relation touching them.
rename_entity Renames an entity, keeping its observations, relations and archive. Not in the reference server.
archived_observations Lists what was archived for an entity, optionally filtered, and restores chosen facts. Not in the reference server.

The three read tools are marked read-only, so clients that support it can run them
without asking.

Command line

Command What it does
memory-lean Runs the MCP server over stdio. This is what agents start.
memory-lean --ui [port] Opens the web UI. --no-open only prints the link; --demo uses a throwaway copy of a made-up graph.
memory-lean --protocol Prints the agent instructions, ready to append to AGENTS.md, CLAUDE.md or GEMINI.md.
memory-lean --skill Writes the same instructions as an Agent Skill into /memory-graph.
memory-lean --lint Reports what in the graph is over budget. Read-only.
memory-lean --compact Backs up the graph, then moves overflow observations to the archive.
memory-lean --version Prints the version.

With npx, put npx -y in front: npx -y memory-lean --ui.

Teach your agent to use it

A memory server only helps if the agent reads it before working and writes to it
when something changes. docs/AGENT-PROTOCOL.md is a
ready-made set of instructions: what to look up at the start of a task, what to
record, how to name things, and what never to store. The Claude Code plugin
includes it. For every other agent, one command installs it:```bash
npx -y memory-lean --protocol >> AGENTS.md # into a rules file: always on
npx -y memory-lean --skill .agents/skills # as an Agent Skill: loaded when relevant


Adjust the entity types and names in it to your own work.

## Coming from the reference memory server

Point `MEMORY_FILE_PATH` at your existing `memory.jsonl` and swap the command. The
file format is identical, so you can switch back at any time. Existing
observations longer than 300 characters are kept as they are; only new writes are
checked. To see what is over budget, and optionally fix it:```bash
npx -y memory-lean --lint      # report only
npx -y memory-lean --compact   # back up, then move overflow to archive/

Settings

All optional, set as environment variables on the server:

Variable Default Meaning
MEMORY_FILE_PATH ~/.claude/memory-graph/memory.jsonl Where the graph lives
MEMORY_OBS_MAX_CHARS 300 Longest observation accepted
MEMORY_OBS_MAX 15 Observations per entity before the oldest dated ones are archived
MEMORY_SEARCH_LIMIT 10 Default number of search results
MEMORY_BACKUPS_KEPT 7 Daily backups kept

FAQ

Is my memory sent anywhere?

No. The server reads and writes local files and makes no network requests. The
web UI listens on 127.0.0.1 only. Keep the graph out of git, and never
store passwords, keys or tokens in it: record where a secret lives, not its value.

Can several agents or sessions share one graph?

Yes. Every write takes a lock, re-reads the file and replaces it atomically, so
parallel sessions (and the web UI) do not overwrite each other.

Why plain text search instead of embeddings?

It needs no model, no index and no dependencies, and an agent's queries are
mostly names it already knows. Good entity names matter more than clever queries.

What happens to old facts?

When an entity passes 15 facts, the oldest dated ones move to
archive/.md next to the graph. archived_observations,
or the Archive section in the web UI, lists and restores them.

Roadmap

  • [x] Claude Code plugin with the server, a skill and /memory-ui
  • [x] Setup guides for 12 agents
  • [x] rename_entity and archive restore
  • [x] A web UI to explore and edit the graph
  • [x] Listed in the official MCP registry
  • [ ] Listed in the Claude Code plugin directory
  • [ ] Search across the archived facts of every entity
  • [ ] Undo in the web UI

Contributing

Ideas, bug reports and pull requests are welcome. The server is one file with no
dependencies, the web UI is one HTML file, and npm test runs in a few seconds,
so a first change is quick to make. CONTRIBUTING.md has the
layout, the ground rules and a list of good first contributions.

If memory-lean saves you tokens, a ⭐ helps other people find it.

Support

memory-lean is free and MIT licensed. If it is useful to you, you can support the
work:

Author

Created and maintained by Zaman Sheikh at
Silifton.

Built on the file format and tool names of the
Model Context Protocol reference memory server.

License

MIT © 2026 Zaman Sheikh. Free to use, change
and share, including commercially; keep the copyright notice.

常见问题

6 问
答案由本站依据条目字段整理,不引用上游原文
Memory Lean 怎么安装?

在客户端按下面的安装命令接入:{ "mcpServers": { "memory": { "command": "npx", "args": ["-y", "memory-lean"] } } }。装完在客户端配置里引用同一个包或端点。

Memory Lean 怎么在 Claude Desktop、Claude、Cursor 里配置?

它的传输方式未标注,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Memory Lean 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Memory Lean 需要 API Key 吗?

资料没有标注鉴权方式,是否需要密钥取决于服务本身,接入前按官方文档确认。

Memory Lean 支持哪些客户端?

资料标注支持 Claude Desktop、Claude、Cursor、VS Code、Windsurf、Cline;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Memory Lean 能提供哪些能力?

资料显示能力标签包括 记忆。具体工具清单以官方文档为准。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 未标注。