ai-memory-mcp
Click on "Install 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., "@ai-memory-mcpload my memories from last session"
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.
AI Memory MCP Server 🧠💾
让任何 AI 拥有跨会话的持久记忆。
一个基于 Model Context Protocol (MCP) 的本地记忆服务器。
支持 Claude Desktop、OpenCode 及其他所有兼容 MCP 的 AI 客户端。
解决的问题
每次跟 AI 聊天都要重新自我介绍?聊过的内容下次全不记得?
这不是 AI 的 bug——是大模型的工作方式决定的。
这个项目用最轻量的方式解决了它:本地 Markdown 文件作为存储,MCP 协议作为桥梁。
第1轮: 聊 → 自动存到本地 md 文件
第2轮: 打开 AI → 自动读取记忆 → AI 认识你Related MCP server: Vector Memory MCP Server
快速开始
安装
# 1. 克隆仓库
git clone https://github.com/chen789654/ai-memory-mcp.git
cd ai-memory-mcp
# 2.(可选)测试是否能启动
python -m src.ai_memory_mcp
# 看到 "AI Memory MCP Server 启动" 即成功
# 按 Ctrl+C 退出配置到 Claude Desktop
编辑 claude_desktop_config.json:
{
"mcpServers": {
"ai-memory": {
"command": "python",
"args": ["-m", "src.ai_memory_mcp"],
"cwd": "你的完整路径/ai-memory-mcp"
}
}
}配置到 OpenCode
编辑 opencode.json:
{
"mcp": {
"ai-memory": {
"type": "local",
"command": ["python", "-m", "src.ai_memory_mcp"],
"cwd": "你的完整路径/ai-memory-mcp",
"enabled": true
}
}
}使用方法
AI 连接后,自动获得以下能力:
工具 (Tools)
工具 | 作用 | 什么时候用 |
| 初始化记忆系统 | 第一次使用 |
| 保存对话到记忆 | 每次聊完 |
| 读取所有记忆 | 每次对话开始 |
| 搜索历史记忆 | 想找之前聊过的内容 |
| 保存人物信息 | 记录用户背景偏好 |
| 查看系统状态 | 检查运行情况 |
给 AI 的指令
在对话开始时,对 AI 说:
请执行 memory_load 读取我的记忆
在对话结束时,对 AI 说:
请执行 memory_save 保存今天的对话
(AI 知道该怎么做——工具定义里已经写清楚了用途。)
为什么用这个
零依赖 — 纯 Python 标准库,不用装任何额外包
纯本地 — 数据全在你硬盘上,不经过任何第三方服务器
跨平台 — 所有兼容 MCP 的 AI 都能用(Claude/ChatGPT/Gemini 等)
可读 — 存储格式是 Markdown,记事本就能打开编辑
可搜索 — 全文搜索,比人类记忆靠谱一百倍
目录结构
~/ai-memory/
├── INDEX.md ← 自动维护的总索引
├── projects/ ← 按项目分文件夹
│ └── 工作助手/
│ ├── _overview.md ← 项目概览
│ └── 2026-07-14_月度规划.md ← 每次对话记录
└── people/ ← 人物信息
└── 用户.md所有文件都是纯文本 Markdown,你可以用任何编辑器直接修改。
License
MIT
Made by chen789654 · 985本硕 · 前互联网大厂 · 现高校教师
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/chen789654/ai-memory-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server