能力标签
mcp-memory-service MCP工具
🛠
AI工具

mcp-memory-service MCP工具

基于 Python · 开源 AI 工具,GitHub 社区精选
英文名:mcp-memory-service
⭐ 1.8k Stars 🍴 279 Forks 💻 Python 📄 Apache-2.0 🏷 AI 8.2分
8.2AI 综合评分
MCP协议智能体记忆持久化存储LangGraphCrewAIAutoGen
✦ AI Skill Hub 推荐

mcp-memory-service MCP工具 是 AI Skill Hub 本期精选AI工具之一。已获得 1.8k 颗 GitHub Star,综合评分 8.2 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。

📚 深度解析

mcp-memory-service MCP工具 是一款基于 Python 的开源工具,在 GitHub 上收获 2k+ Star,是MCP协议、智能体记忆、持久化存储、LangGraph领域中的优质开源项目。开源工具的最大优势在于代码完全透明,你可以审计每一行代码的安全性,也可以根据自身需求进行二次开发和定制。

**为什么要使用开源工具而非商业 SaaS?**
对于个人开发者和有隐私需求的用户,本地部署的开源工具意味着数据不离本机,不受第三方服务商的数据政策约束。同时,开源工具通常没有使用次数限制和月度费用,一次安装即可长期使用,对于高频使用场景的总拥有成本(TCO)远低于订阅制商业工具。

**安装与环境准备**
mcp-memory-service MCP工具 依赖 Python 运行环境。建议通过 pyenv(Python)或 nvm(Node.js)管理 Python 版本,避免全局环境污染。对于新手用户,推荐先创建虚拟环境(python -m venv venv && source venv/bin/activate),再安装依赖,这样即使出现问题也可以随时删除虚拟环境重新开始,不影响系统稳定性。

**社区与维护**
GitHub Issue 和 Discussion 是获取帮助的最快渠道。在提问前建议先检查 Closed Issues(已关闭的问题),大多数常见问题都已有解答。遇到 Bug 时,提供 pip list 的输出、完整错误堆栈和最小可复现示例,能显著提高开发者响应速度。AI Skill Hub 将持续追踪 mcp-memory-service MCP工具 的版本更新,及时通知重要功能变化。

📋 工具概览

为LangGraph、CrewAI、AutoGen等AI智能体框架提供开源持久化内存解决方案。支持跨对话状态保存、记忆检索和管理,帮助开发者构建具有长期学习能力的智能体应用。适合AI应用开发者和智能体框架使用者。

mcp-memory-service MCP工具 是一款基于 Python 开发的开源工具,专注于 MCP协议、智能体记忆、持久化存储 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

GitHub Stars
⭐ 1.8k
开发语言
Python
支持平台
Windows / macOS / Linux
维护状态
正常维护,社区驱动
开源协议
Apache-2.0
AI 综合评分
8.2 分
工具类型
AI工具
Forks
279

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

为LangGraph、CrewAI、AutoGen等AI智能体框架提供开源持久化内存解决方案。支持跨对话状态保存、记忆检索和管理,帮助开发者构建具有长期学习能力的智能体应用。适合AI应用开发者和智能体框架使用者。

mcp-memory-service MCP工具 是一款基于 Python 开发的开源工具,专注于 MCP协议、智能体记忆、持久化存储 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

📌 核心特色
  • 开源免费,支持本地部署,数据完全自主可控
  • 活跃的 GitHub 开源社区,持续迭代更新
  • 提供详细文档和使用示例,新手友好
  • 支持自定义配置,灵活适配不同使用环境
  • 可作为基础组件集成进现有技术栈或进行二次开发
🎯 主要使用场景
  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一: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('安装成功')"
📋 安装步骤说明
  1. 访问 GitHub 仓库页面
  2. 按照 README 文档完成依赖安装
  3. 根据系统环境完成初始化配置
  4. 参考官方示例或文档开始使用
  5. 遇到问题可在 GitHub Issues 中查找解答
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 命令行使用
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"
📑 README 深度解析 真实文档 完整度 74/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

mcp-memory-service

2. Expose via Cloudflare Tunnel (or your own HTTPS setup)

cloudflared tunnel --url http://localhost:8765

Real-World: Self-Hosted Docker Stack with Cloudflare Tunnel

"The quality of life that session-independent memory adds to AI workflows is immense. File-based memory demands constant discipline. Semantic recall from a live database doesn't. Storing data on my own hardware while making it remotely accessible across platforms turned out to be a feature I didn't know I needed."@PL-Peter, discussion #602

A production-tested self-hosted deployment using Docker containers behind a Cloudflare tunnel, with AuthMCP Gateway handling authentication:

LayerRole
**Cloudflare Tunnel**Name-based routing, subnet-based access control, authentication before hitting self-hosted resources
**AuthMCP Gateway**Auth/aggregation with locally managed users, admin UI, per-user MCP server access control, bearer token auth
**mcp-memory-service**Two Docker containers sharing one SQLite backend — one for MCP, one for the web UI (document ingestion)

Security best practices for this setup: - Use Cloudflare ZeroTrust with subnet-based access control (e.g., allow Anthropic subnets + your own IPs) - Add Client IP Address Filtering to all Cloudflare API tokens (Dashboard → My Profile → API Tokens → Edit → Client IP Address Filtering) to limit abuse if a token leaks - If using IPv6, include your IPv6 /64 network in the allowlist (Python prefers IPv6 by default) - For long-running browser sessions, request the offline_access scope during authorization to receive a rotating refresh_token (lifetime via MCP_OAUTH_REFRESH_TOKEN_EXPIRE_DAYS, default 30 days). Without this scope, access tokens are the only credential — extend MCP_OAUTH_ACCESS_TOKEN_EXPIRE_MINUTES up to 1440 (24h) if you need longer single-shot sessions. - Consider an auth proxy like AuthMCP or mcp-auth-proxy for robust session management

Agent Quick Start

```bash pip install mcp-memory-service MCP_ALLOW_ANONYMOUS_ACCESS=true memory server --http

✨ Quick Start Features

🧠 Persistent Memory – Context survives across sessions with semantic search 🔍 Smart Retrieval – Finds relevant context automatically using AI embeddings ⚡ 5ms Speed – Instant context injection, no latency 🔄 Multi-Client – Works across 25+ AI applications ☁️ Cloud Sync – Optional Cloudflare backend for team collaboration 🔒 Privacy-First – Local-first, you control your data 📊 Web Dashboard – Visualize and manage memories at http://localhost:8000 🧬 Knowledge Graph – Interactive D3.js visualization of memory relationships 🏠 Homelab Quality Scoring – Point scoring at any OpenAI-compatible endpoint (Ollama, LiteLLM, vLLM) 🔗 Entity Extraction – Auto-links @mentions, #tags, URLs, and file paths from memory content to a queryable entity graph 💡 Insight Cards – Consolidation detects patterns, trends, and knowledge gaps across your memory corpus and surfaces them as structured insights 🏷️ Tag Match Filteringtag_match=AND/OR on memory_search for precise multi-tag queries

Homelab / self-hosted quality scoring (v10.45.0+): set MCP_QUALITY_AI_PROVIDER=openai-compatible to score memories with your local LLM instead of ONNX or a cloud API:

```bash MCP_QUALITY_AI_PROVIDER=openai-compatible MCP_QUALITY_AI_BASE_URL=http://localhost:11434/v1 # Ollama MCP_QUALITY_AI_MODEL=qwen2.5:7b-instruct

🎥 2-Minute Video Demo

MCP Memory Service Demo

Technical showcase: Performance, Architecture, AI/ML Intelligence & Developer Experience

3. In claude.ai: Settings → Connectors → Add Connector

3. Add connector in claude.ai Settings → Connectors with the tunnel URL


See [Remote MCP Setup Guide](docs/remote-mcp-setup.md) for production deployment with Let's Encrypt, nginx, and Docker.

</details>

<details>
<summary><strong>🔧 Advanced: Custom Backends & Team Setup</strong></summary>

For production deployments, team collaboration, or cloud sync:
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 (best of both: 5ms local + background cloud sync) - Milvus (dedicated vector DB — Milvus Lite file, self-hosted, or Zilliz Cloud)

ℹ️ For long-lived services (MCP servers, web backends, notebook sessions), prefer Docker Milvus or Zilliz Cloud over Milvus Lite. See docs/milvus-backend.md for why.

</details>

---

MCP_QUALITY_AI_API_KEY=ollama # optional


Recommended models: `qwen2.5:7b-instruct` (Ollama), `mlx-community/Qwen2.5-7B-Instruct-4bit` (MLX), or any instruct model via LiteLLM proxy. On endpoint failure, scoring falls back to implicit signals automatically.

**Docker `:quality-cpu` tag** — for users who want the built-in local ONNX quality scoring (`ms-marco-MiniLM-L-6-v2` and `nvidia-quality-classifier-deberta`) without managing the one-time ONNX export themselves, and without shipping `torch`/`transformers` in their container:
bash docker pull doobidoo/mcp-memory-service:quality-cpu ```

The :quality-cpu image pre-exports both models at build time and ships only onnxruntime at runtime — no PyTorch dependency at deploy time. See tools/docker/README.md for details.

REST API running at http://localhost:8000

python import httpx

BASE_URL = "http://localhost:8000"

🛠️ CLI Server Lifecycle Commands

In addition to memory server --http (foreground mode), the CLI now includes server lifecycle commands for background HTTP management:

```bash

Persistent Shared Memory for AI Agent Pipelines

Open-source memory backend for AI agents — REST API, MCP, OAuth, CLI, dashboard. One self-hosted service, every transport. Agents store decisions, share causal knowledge graphs, and retrieve context in 5ms — without cloud lock-in or API costs.

Works with LangGraph · CrewAI · AutoGen · any HTTP client · Claude Desktop · OpenCode

---

License: Apache 2.0 PyPI version Python GitHub stars Works with LangGraph Works with CrewAI Works with AutoGen Works with Claude Works with Cursor Remote MCP claude.ai Browser Compatible OAuth 2.0 Sponsor

---

Comparison with Alternatives

vs. Commercial Memory APIs

Mem0ZepDIY Redis+Pinecone**mcp-memory-service**
LicenseProprietaryEnterprise**Apache 2.0**
CostPer-call APIEnterpriseInfra costs**$0**
**🌐 claude.ai Browser**❌ Desktop only❌ Desktop only**✅ Remote MCP**
**OAuth 2.0 + DCR**❓ Unknown❓ Unknown**✅ Enterprise-ready**
**Streamable HTTP****✅ (SSE also supported)**
Framework integrationSDKSDKManual**REST API (any HTTP client)**
Knowledge graphNoLimitedNo**Yes (typed edges)**
Auto consolidationNoNoNo**Yes (decay + compression)**
On-premise embeddingsNoNoManual**Yes (ONNX, local)**
PrivacyCloudCloudPartial**100% local**
Hybrid searchNoYesManual**Yes (BM25 + vector)**
MCP protocolNoNoNo**Yes**
REST APIYesYesManual**Yes (76 endpoints)**

vs. MCP-Native Alternatives

MemPalace is an MCP-native alternative that went viral in April 2026 with strong LongMemEval claims. A community code review (Issue #27) subsequently showed that the headline numbers reflect the underlying vector store rather than the advertised Palace architecture, and the maintainers acknowledged most points. We keep the comparison here for transparency, but readers should interpret the scores with that context in mind.

**MemPalace****mcp-memory-service**
LongMemEval R@5 (raw ChromaDB, zero LLM)96.6%¹86.0% (session) / 80.4% (turn)
LongMemEval R@5 (with reranking)100%²
Storage granularitySession-level**Turn-level + session-level**
Team / multi-device sync❌ Local only**✅ Cloudflare sync**
REST API / Web dashboard**✅**
OAuth 2.1 + multi-user**✅**
Knowledge graph**✅ (typed edges)**
Auto consolidation**✅ (decay + compression)**
Compatible AI toolsClaude-focused**25+ tools**
LicenseMIT**Apache 2.0**

Why the benchmark gap? Two independent factors:

  1. Ingestion granularity. MemPalace stores each conversation as a single unit (session-level). LongMemEval asks "which session contains the answer?" — a question that session-level storage answers structurally. mcp-memory-service defaults to turn-level storage (one entry per message), which enables fine-grained retrieval ("what exactly did the user say about X?") but spreads a session's signal across many entries. Using memory_store_session (added in v10.35.0) brings our score to 86.0% R@5.
  2. What the 96.6% actually measures. Per Issue #27, MemPalace's headline number is produced in "raw mode" — plain text stored in ChromaDB with default embeddings. The Palace architecture (Wings, Rooms, Halls) is not active in that configuration; "Halls" exist only as metadata strings with no effect on ranking. The 96.6% is therefore a ChromaDB + default-embedding baseline, not a measurement of MemPalace's structural retrieval features. A direct "apples-to-apples" architectural comparison is not possible with the published numbers.
¹ Measured in MemPalace "raw mode" (plain text in ChromaDB with default embeddings). Per Issue #27, the Palace structural features are bypassed in this configuration. ² 100% result uses optional LLM reranking (~500 API calls) on a partially tuned test set. Clean held-out score (as reported by the maintainers): 98.4% R@5.

---

🇨🇳 中文文档镜像 AI 翻译 2026-06-17
英文原文章节由系统翻译为中文摘要,便于快速理解。完整原文见上方 "📑 README 深度解析"。
📌 简介

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 本地部署,让开发者完全掌控数据。

🛠 安装步骤(Docker/pip/源码)

用户可以通过多种方式部署该服务。快速启动可使用 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 生命周期命令,方便开发者在不同开发场景下灵活切换服务状态。

⚙️ 配置说明(含 MCP / env)

配置过程根据部署场景有所不同。在 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。

🔌 API 说明

服务提供运行在 http://localhost:8000 的 REST API 接口。开发者可以使用 Python 的 httpx 库轻松进行交互。除了标准的 HTTP 接口外,服务还支持通过 CLI 进行生命周期管理,确保在复杂的 AI Agent Pipeline 中能够稳定地进行记忆的存储与检索。

🔄 工作流/模块

该模块旨在为 AI Agent Pipeline 提供持久化的共享记忆。它不仅是一个简单的存储工具,更是一个集成了 REST API、MCP 和知识图谱能力的综合后端。通过将决策过程和因果关系结构化存储,Agent 可以在无需依赖云端 API 的情况下,实现极速(5ms)的上下文检索,构建出具备长期记忆和协作能力的智能体集群。

🎯 aiskill88 AI 点评 A 级 2026-05-20

高质量开源项目,解决智能体记忆痛点,架构设计清晰,社区活跃度良好,实用价值高。

📚 实用指南(长尾问题)
适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
  • 构建多智能体协作系统的 Agent 开发者
  • 构建企业知识库 / RAG 检索应用的团队
最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
  • 本地部署优先选 GGUF 量化模型,节省显存并保持响应速度
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal
  • 显存不足直接 OOM — 优先降低 context 或换更小的量化模型
  • Python 依赖冲突:建议用 venv / uv 隔离环境
部署方案
  • Docker:mcp-memory-service 提供官方镜像,docker compose up 一键启动
  • CLI:直接 npm install -g / pip install,命令行调用
  • 本地部署:CPU 8GB 起,GPU 推荐 16GB+ 显存
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
mcp-memory-service 中文教程mcp-memory-service 安装报错怎么办mcp-memory-service MCP 配置mcp-memory-service Docker 部署mcp-memory-service Agent 工作流mcp-memory-service 与同类工具对比mcp-memory-service 最佳实践mcp-memory-service 适合谁用

⚡ 核心功能

👥 适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
  • 构建多智能体协作系统的 Agent 开发者
  • 构建企业知识库 / RAG 检索应用的团队
⭐ 最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
  • 本地部署优先选 GGUF 量化模型,节省显存并保持响应速度
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal
  • 显存不足直接 OOM — 优先降低 context 或换更小的量化模型

👥 适合人群

AI 技术爱好者研究人员和学生开发者和工程师技术创业者

🎯 使用场景

  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发

⚖️ 优点与不足

✅ 优点
  • +Apache-2.0 协议,可免费商用
  • +完全开源免费,无授权费用
  • +本地部署,数据完全自主可控
  • +开发者社区支持,遇问题可查可问
⚠️ 不足
  • 安装和初始配置可能需要一定技术基础
  • 功能完整性通常不如成熟商业产品
  • 技术支持主要依赖开源社区,响应速度不稳定
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。

🔗 相关工具推荐

📚 相关教程推荐
📰 相关 AI 新闻
🍿 AI 圈相关吃瓜
🗺️ 相关解决方案
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

原生支持LangGraph、CrewAI、AutoGen等主流框架,通过MCP协议标准化接口。
💡 AI Skill Hub 点评

经综合评估,mcp-memory-service MCP工具 在AI工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。

📚 深入学习 mcp-memory-service MCP工具
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 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
🔗 原始来源
🐙 GitHub 仓库  https://github.com/doobidoo/mcp-memory-service

收录时间:2026-05-14 · 更新时间:2026-05-16 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。

📺 订阅 AI Skill Hub Daily Telegram 频道
每天 8 条精选 AI Skill、MCP、Agent 与自动化工具推送
加入频道 →