mcp-memory-service MCP工具 是 AI Skill Hub 本期精选AI工具之一。已获得 1.8k 颗 GitHub Star,综合评分 8.2 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
为LangGraph、CrewAI、AutoGen等AI智能体框架提供开源持久化内存解决方案。支持跨对话状态保存、记忆检索和管理,帮助开发者构建具有长期学习能力的智能体应用。适合AI应用开发者和智能体框架使用者。
mcp-memory-service MCP工具 是一款基于 Python 开发的开源工具,专注于 MCP协议、智能体记忆、持久化存储 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
为LangGraph、CrewAI、AutoGen等AI智能体框架提供开源持久化内存解决方案。支持跨对话状态保存、记忆检索和管理,帮助开发者构建具有长期学习能力的智能体应用。适合AI应用开发者和智能体框架使用者。
mcp-memory-service MCP工具 是一款基于 Python 开发的开源工具,专注于 MCP协议、智能体记忆、持久化存储 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install mcp-memory-service
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install mcp-memory-service
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/doobidoo/mcp-memory-service
cd mcp-memory-service
pip install -e .
# 验证安装
python -c "import mcp_memory_service; print('安装成功')"
# 命令行使用
mcp-memory-service --help
# 基本用法
mcp-memory-service input_file -o output_file
# Python 代码中调用
import mcp_memory_service
# 示例
result = mcp_memory_service.process("input")
print(result)
# mcp-memory-service 配置文件示例(config.yml) app: name: "mcp-memory-service" debug: false log_level: "INFO" # 运行时指定配置文件 mcp-memory-service --config config.yml # 或通过环境变量配置 export MCP_MEMORY_SERVICE_API_KEY="your-key" export MCP_MEMORY_SERVICE_OUTPUT_DIR="./output"
memory launch # Start HTTP server in background (127.0.0.1:8000)
memory launch --port 8192 # Custom port
memory info # Status and health
memory logs --lines 50 # Recent logs
memory stop # Stop server
These commands are optimized for fast startup and avoid loading heavy ML dependencies unless needed.
⚠️ Security note: the server binds to127.0.0.1(localhost only) by default.--host 0.0.0.0/MCP_HTTP_HOST=0.0.0.0exposes the API to your network — do that only in trusted environments with authentication and firewall rules, or behind TLS termination or a VPN overlay.
Backends, embedding models, quality scoring and every environment variable: Configuration Guide
---
Store a memory with `POST /api/memories`, search with `POST /api/search`, retrieve by tag
with `POST /api/search/by-tag`. Send `X-Agent-ID: <id>` on a store request and the server
tags the memory `agent:<id>`, which a tag search then scopes retrieval by.
Worked examples per framework, the tag conventions and the async patterns:
**[docs/agents/](https://github.com/doobidoo/mcp-memory-service/tree/main/docs/agents)**
</details>
<details>
<summary><strong>OpenCode</strong></summary>
bash MCP_ALLOW_ANONYMOUS_ACCESS=true memory server --http
The plugin ships as repository files for the local plugin directory, so clone the
repository once even if you installed from PyPI. Install steps, the `/memory` slash
command and the endpoint override:
**[opencode/README.md](https://github.com/doobidoo/mcp-memory-service/blob/main/opencode/README.md)**
</details>
<details>
<summary><strong>Codex (automatic memory hooks)</strong></summary>
Start the Memory Service HTTP API, then install the hooks from this repository:
bash python3 codex/install_hooks.py
Restart Codex and review the hooks with `/hooks`. They retrieve project context,
capture new learnings, and checkpoint outcomes before compaction and at session end.
See [Codex hook setup](codex/README.md) for prerequisites, authentication, and project-local installation.
</details>
<details>
<summary><strong>claude.ai and ChatGPT (browser — Remote MCP)</strong></summary>
Remote MCP puts persistent memory in the browser on any device, no desktop app required:
OAuth 2.0 over HTTPS, self-hosted or cloud-hosted. Both claude.ai and ChatGPT
(Developer Mode) connect to the same endpoint.
Cloudflare Tunnel quick start, Let's Encrypt, nginx, Caddy and Docker production setups:
**[Remote MCP Setup](https://github.com/doobidoo/mcp-memory-service/blob/main/docs/remote-mcp-setup.md)** ·
[5-minute tutorial](https://mcpmemory.services/blog/remote-mcp-tutorial.html)
</details>
<details>
<summary><strong>Advanced: custom backends and team setup</strong></summary>
bash git clone https://github.com/doobidoo/mcp-memory-service.git cd mcp-memory-service python scripts/installation/install.py ```
Choose from SQLite (local, fast, single-user), Cloudflare (cloud, multi-device sync), Hybrid (5ms local reads with background cloud sync — recommended for production) or Milvus (dedicated vector DB: Lite file, self-hosted, or Zilliz Cloud). For self-hosted team setups, the Hybrid backend can sync to another HTTP MCP Memory Service instead of Cloudflare using MCP_HYBRID_SECONDARY_BACKEND=http.
For long-lived services, prefer Docker Milvus or Zilliz Cloud over Milvus Lite — why.
</details>
---
mcp-memory-service 是一个专为 AI Agent 设计的开源记忆后端服务。它通过 REST API、MCP、OAuth、CLI 和 Dashboard 等多种传输方式,为 LangGraph、CrewAI、AutoGen 等主流 AI 框架提供持久化的共享记忆能力。该服务允许 Agent 存储决策过程、共享因果知识图谱,并实现毫秒级的上下文检索,旨在解决 AI 工作流中缺乏跨会话记忆的问题,同时避免云端厂商锁定和高昂的 API 成本。
本项目提供具备语义搜索能力的持久化记忆功能,确保上下文在不同会话间依然有效。通过 AI Embeddings 技术实现智能检索,上下文注入延迟极低(仅 5ms),支持超过 25 种 AI 应用的多客户端接入。此外,它支持可选的 Cloudflare 后端进行团队协作,并遵循隐私优先原则,支持 Local-first 本地部署,让开发者完全掌控数据。
用户可以通过多种方式部署该服务。快速启动可使用 pip 安装并运行 `memory server --http` 模式。对于生产环境,推荐使用 Docker 部署,并结合 Cloudflare Tunnel 实现远程安全访问(例如使用 `cloudflared tunnel --url http://localhost:8765`)。若需自定义后端或团队协作,可以通过 git clone 源码进行构建,并根据需要配置 Docker 标签(如 `:quality-cpu`)以使用内置的 ONNX 质量评分模型。
开发者可以通过 CLI 快速启动服务。在 Agent 端,可以使用 `pip install mcp-memory-service` 并设置 `MCP_ALLOW_ANONYMOUS_ACCESS=true` 来开启 HTTP 模式。该服务不仅支持前台运行,还提供了用于后台 HTTP 管理的 CLI 生命周期命令,方便开发者在不同开发场景下灵活切换服务状态。
配置过程根据部署场景有所不同。在 Claude.ai 中使用时,需在 Settings → Connectors 中添加 Connector。对于高级自定义后端,可以通过环境变量配置 `MCP_QUALITY_AI_API_KEY`(如使用 Ollama)。推荐使用 `qwen2.5:7b-instruct` 或通过 LiteLLM proxy 接入其他模型。若需在生产环境中使用 Let's Encrypt、nginx 和 Docker 进行部署,请参考专门的 Remote MCP Setup Guide。
服务提供运行在 http://localhost:8000 的 REST API 接口。开发者可以使用 Python 的 httpx 库轻松进行交互。除了标准的 HTTP 接口外,服务还支持通过 CLI 进行生命周期管理,确保在复杂的 AI Agent Pipeline 中能够稳定地进行记忆的存储与检索。
该模块旨在为 AI Agent Pipeline 提供持久化的共享记忆。它不仅是一个简单的存储工具,更是一个集成了 REST API、MCP 和知识图谱能力的综合后端。通过将决策过程和因果关系结构化存储,Agent 可以在无需依赖云端 API 的情况下,实现极速(5ms)的上下文检索,构建出具备长期记忆和协作能力的智能体集群。
高质量开源项目,解决智能体记忆痛点,架构设计清晰,社区活跃度良好,实用价值高。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
经综合评估,mcp-memory-service MCP工具 在AI工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | mcp-memory-service |
| 原始描述 | 开源MCP工具:Open-source persistent memory for AI agent pipelines (LangGraph, CrewAI, AutoGen。⭐1.8k · Python |
| Topics | MCP协议智能体记忆持久化存储LangGraphCrewAIAutoGen |
| GitHub | https://github.com/doobidoo/mcp-memory-service |
| License | Apache-2.0 |
| 语言 | Python |
收录时间:2026-05-14 · 更新时间:2026-05-16 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。