内存 MCP 管理器是一个实用工具,用于管理和切换不同的内存路径。它特别适用于搭配 mcp-knowledge-graph 服务器使用的 Claude 客户端,能帮助用户为不同项目维护独立的记忆上下文。
git clone https://github.com/yourusername/memory-mcp-manager.git
cd memory-mcp-manager
chmod +x memory.sh
./memory.sh init
./memory.sh add-client my-claude "/path/to/claude/config.json"
./memory.sh add project1 "~/projects/project1/memory.jsonl"
./memory.sh switch project1
# 添加一个 Claude 客户端
./memory.sh add-client
# 列出配置的客户端
./memory.sh list-clients
# 添加内存路径
./memory.sh add
# 移除内存路径
./memory.sh remove
# 切换到内存路径
./memory.sh switch
# 列出所有内存路径
./memory.sh list
你的设置存储在 config.json 中(已加入 .gitignore):
{
"clients": [
{
"name": "my-claude",
"config_path": "/path/to/claude/config.json"
}
],
"memory_paths": {
"project1": "/path/to/project1/memory.jsonl"
}
}
当切换内存路径时,工具会更新所有已注册的 Claude 客户端以使用新的内存路径,从而让你能够为不同的项目维护独立的记忆上下文。