内存 MCP 服务器
模型上下文协议 (MCP) 服务器提供用于存储、检索和管理保存到本地文件的记忆的工具。
特征
使用可选标签存储文本记忆
通过文本或标签搜索记忆
检索所有存储的记忆
删除特定记忆
查看标签使用情况统计信息
持久存储在本地 JSON 文件中
Related MCP server: MCP Web Research Server
安装
来自源
克隆此存储库
安装依赖项:
npm install构建服务器:
npm run build
用法
运行服务器
使用以下命令运行服务器:
npm start -- [storage-path]其中storage-path是您想要存储记忆文件的目录(默认为当前目录)。
使用 Claude for Desktop 进行设置
要将此服务器与 Claude for Desktop 一起使用:
打开您的 Claude for Desktop 配置文件:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
添加服务器配置:
{
"mcpServers": {
"memory": {
"command": "node",
"args": [
"/path/to/mcp-memory-server/build/index.js",
"/path/to/storage/directory"
]
}
}
}重启 Claude 桌面版。您可能需要强制退出所有正在运行的 Claude 进程,以使更改生效。
可用工具
该服务器公开以下工具:
store-memory
存储新的记忆。
参数:
content(字符串,必需):要存储的文本内容tags(字符串数组,可选):用于对内存进行分类的标签
search-memories
尋找記憶。
参数:
searchTerm(字符串,可选):要在内存内容中搜索的文本tag(字符串,可选):通过此标签过滤记忆
get-all-memories
检索所有存储的记忆。
参数:无
delete-memory
根据 ID 删除记忆。
参数:
id(字符串,必需):要删除的内存的 ID
get-tags-summary
获取所有已用标签的摘要。
参数:无
Claude 中的示例用法
以下是一些与 Claude 一起使用的示例查询:
“存储此信息:项目截止日期为2025年3月15日。标签:工作,截止日期”
“我有哪些与工作相关的记忆?”
“让我看看我所有的记忆”
“删除ID为abc123的内存”
“我的记忆里用过哪些标签?”
文件结构
服务器将记忆存储在指定存储目录中名为memories.json的文件中。
执照
麻省理工学院
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.