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., "@Memory MCPremember that Alice prefers sunny weather"
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.
Memory MCP
基于 MCP Streamable HTTP 的个人记忆服务:用 语义向量检索 + 知识图谱 持久化你的长期上下文,并支持对同一实体的记忆“演化”与冲突打标追溯。
特性
MCP Streamable HTTP:不使用已废弃的 SSE
Bearer Token 鉴权:
/mcp需要Authorization: Bearer <token>(/health免鉴权)记忆演化而非覆盖:同一
entity_key多版本链路可追溯(trace)冲突判定与打标:命中也会判定并输出
labels:conflict / correction / reversal语义检索:通过 OpenRouter Embedding API 获取向量,支持相似度检索(
recall)图谱关系:实体关系入/出边 + BFS 深度查询(
relate/graph_query)资源读取:提供
memory:///...资源给 MCP Client(current/entities/entity)可测试/可落盘:默认 LanceDB;可用
MEMORY_MCP_VECTOR_BACKEND=memory作为无依赖后端
Related MCP server: memora
接口
MCP Endpoint:
/mcp(Streamable HTTP)健康检查:
/health
快速开始(本地)
安装依赖:
pip install .准备环境变量:
cp .env.example .env并填写至少:MEMORY_MCP_AUTH_TOKENMEMORY_MCP_OPENROUTER_API_KEY
启动:
python -m memory_mcp验证:
curl http://127.0.0.1:8765/health
Docker 部署(推荐)
配置:
cp .env.example .env并填写必要变量构建并启动:
docker compose up -d --build
说明:
当前
docker-compose.yml默认不暴露 8765(避免直接公网暴露)。若你需要在宿主机直接访问(本地调试),请在
memory-mcpservice 增加端口映射:ports: - "8765:8765"生产环境建议通过 Cloudflare Tunnel / 反向代理 暴露 HTTPS。
环境变量
.env.example 已包含可用模板:
必填
MEMORY_MCP_AUTH_TOKEN:鉴权 tokenMEMORY_MCP_OPENROUTER_API_KEY:OpenRouter API Key
常用
MEMORY_MCP_HOST:默认0.0.0.0MEMORY_MCP_PORT:默认8765MEMORY_MCP_DATA_DIR:默认./dataMEMORY_MCP_DEBUG:默认false
Embedding
MEMORY_MCP_OPENROUTER_BASE_URL:默认https://openrouter.ai/api/v1MEMORY_MCP_EMBEDDING_MODEL:默认openai/text-embedding-3-smallMEMORY_MCP_EMBEDDING_DIM:默认1536
冲突判定(可选)
MEMORY_MCP_LLM_MODEL:默认anthropic/claude-3-haikuMEMORY_MCP_SIMILARITY_THRESHOLD:默认0.85
向量后端(可选)
MEMORY_MCP_VECTOR_BACKEND:lancedb(默认)/memory/auto说明:生产建议使用
lancedb;LanceDB 启动失败会中止服务,避免旧记忆被静默隐藏memory适合测试;auto会在 LanceDB 初始化失败时切换到memory
Cloudflare Tunnel(可选)
CLOUDFLARE_TUNNEL_TOKEN
MCP 客户端配置示例
将域名与 token 替换为你自己的部署:
{
"mcpServers": {
"memory-mcp": {
"url": "https://memory-mcp.your-domain.com/mcp",
"transport": { "type": "http" },
"headers": {
"Authorization": "Bearer your-secure-token-here"
}
}
}
}Tools(工具)
remember:写入/演化记忆(同entity_key自动演化与冲突打标)recall:按语义检索当前记忆(可选附带演化信息)recall_all:拉取全部当前记忆(用于初始化上下文)trace:追溯某实体的演化链(timeline/summary)forget:归档某实体当前记忆(不再作为 current)relate:创建实体关系边unrelate:按 relation id 删除实体关系边graph_query:按深度查询实体关系(入边+出边 BFS)
Resources(资源)
memory:///current:当前全部记忆(JSON)memory:///entities:实体列表(JSON)memory:///entity/{entity_key}:实体演化历史(JSON)
数据落盘结构
默认目录为 ./data/:
data/
├── vectors/ # 向量(LanceDB 或 memories.json)
└── graph/ # 图谱 JSON
├── entities.json
├── relations.json
└── evolution_chains.json开发与测试
安装开发依赖:
pip install .[dev]运行测试:
pytest静态检查:
ruff check .
更多测试说明见:docs/testing.md
许可证
本项目采用 MIT License,详见 LICENSE。
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
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/kassol/memory-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server