agent-milestone
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agent-milestonecheckpoint this conversation as 'final-version'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agent-milestone
MCP server 项目(MCP-native):给 agent 的对话/任务轨迹做 git 式版本控制——让每次和 agent 的协作都能「记住、回看、撤回、留档」。
为什么做
每次和 agent 对话、跑任务之后,都会忘记「当时到底在做什么」。想要一个长期的里程碑:能记住、能回看、能撤回、能导出留档。
Related MCP server: statecli-mcp-server
定位
做什么:MCP server,给 agent 的任务轨迹做 git 式版本控制。
一期:
checkpoint存里程碑 /checkout回看+撤回 /export导出 markdown二期:
branch分叉 /diff轨迹 diff /replay重放
差异化:Atlas 管代码(ACP-first),本服务管对话轨迹(MCP-native)。
不做什么:多租户、云端同步——刻意不做,本地优先 = 隐私 + 工程判断。
核心模型(git 的同一套技巧)
不可变对象 + 指针:
step:轨迹的最小单元——一条 user/assistant 消息、一次 tool 调用或 tool 结果。内容寻址(SHA-256)。
每个 step 通过
parent_hash链接成一条链,链就是一次任务的轨迹。milestone(checkpoint):一个命名指针,指向某个 step 的 hash。
分叉天然免费(branch 只是另一个指针);diff 便宜(走两条链回到分叉点)。
组件
文件 | 作用 |
| 存储层:SQLite + git 式模型,含 self-check |
| MCP server,暴露 3 个工具给 agent 主动调 |
| SessionEnd hook,会话结束自动把 transcript 存档 |
| 只读查看器:把库里所有轨迹渲染成自包含 HTML(零依赖、浏览器直开) |
| 端到端测试:按 agent 的方式驱动三个工具 |
安装
cd agent-milestone
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt # 就一个依赖:mcp使用
路径一:自动记录(SessionEnd hook)
在 Claude Code 的 settings.json 配 SessionEnd hook 指向 record.py,每次会话结束自动把整段对话轨迹解析成 step 存库,无需手动操作:
{
"hooks": {
"SessionEnd": [
{
"hooks": [
{ "type": "command", "command": "python3 /path/to/agent-milestone/record.py" }
]
}
]
}
}路径二:主动版本控制(MCP 工具)
把 server.py 注册成 MCP server 后,agent 在对话里像开发者用 git 一样主动调。
checkpoint(name, steps) -> str —— 存档
输入:一个名字 + 一段轨迹(step 列表)
做什么:把轨迹存进 SQLite,给最后一步打上这个名字
返回:tip hash(前 12 位)
类比:
git commit -m "对账排查"
checkout(name) -> list[dict] —— 回看 / 撤回
输入:里程碑名字
做什么:按名字找到指针,沿
parent_hash往回走,还原整条轨迹返回:轨迹(第一步 → 最后一步)
类比:
git checkout 对账排查
export(name) -> str —— 导出留档
输入:里程碑名字
做什么:把轨迹渲染成 markdown
返回:markdown 文本,可直接 commit 到 GitHub
类比:
git log排版成文档
存储
统一存到 ~/.claude/agent-milestone/milestones.db(store.py 里的 DEFAULT_DB_PATH),record.py 和 server.py 都引用它。
验证
python store.py # 自检,应打印 self-check ok
python test_e2e.py # 端到端:checkpoint → checkout → export
python view.py # 生成 trails.html 轨迹查看页(浏览器直开,看所有里程碑+step)操作手册
出问题先查 RUNBOOK.md,每条 = 症状 → 原因 → 处理。
状态(2026-09-08 阶段 1 已跑通)
阶段 1 核心闭环已完整验证:store 自检、工具级端到端、以及新会话里 agent 通过 MCP 实际调 checkpoint → checkout → export 三连全通。
已完成并验证 ✅
模块 | 说明 | 验证 |
| SQLite + git 式模型(内容寻址 step + 命名指针 milestone) |
|
| MCP 工具 checkpoint/checkout/export | 新会话 agent 实际调用通过 |
| SessionEnd hook 自动存档真实对话 | DB 已累计 6.6MB 真实轨迹 |
| 工具级端到端 |
|
断点(阶段 1 收尾必做,全部关闭)
DB 路径不合一✅ 统一到store.py的DEFAULT_DB_PATH。record.py真实.jsonl解析✅ 真实 transcript 解析 413 步、tool 关联 100%。server.py注册后 agent 实际调用✅ 2026-09-08 新会话实际调用验证通过。
下一步(roadmap)
阶段 2:branch / diff / replay
阶段 3:demo + 推 GitHub
铁律
阶段 1 没跑通之前,任何新功能都不许加。
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP memory for coding agents: persistent across sessions, editable markdown, team sharing.
- memnodeOAuthdev.memnode
Persistent, inspectable memory for AI agents with lineage, correction, and a hosted MCP endpoint.
Agent-native notes, tasks, dev-docs, vaults, sync & handoffs. MCP + OpenAPI dual surface.
Cross-tool persistent memory and context for AI assistants over MCP.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceOpen, Git-native memory protocol for MCP agents: stores memories as Markdown files in a Git repo, enabling portability, auditability, and human-editable memory across different AI agents.64 npm15MIT

statecli-mcp-serverofficial
AlicenseNot gradedqualityDmaintenanceGives AI agents memory, undo, and self-awareness by tracking file changes and enabling checkpoints and rollbacks.72 npm2MIT- AlicenseAqualityAmaintenanceAudit-grade, git-versioned memory for AI coding agents that enables saving, searching, editing, and rolling back facts through markdown files served via MCP.3350 PyPI42MIT
- AlicenseNot gradedqualityAmaintenanceProvides git-like version-controlled persistent memory for AI assistants, enabling context persistence, diffing, rollback, and sync across sessions and AI tools via MCP.89 PyPI1MIT