MCP Catalogs
首页

mem0-mcp-selfhosted

by elvismdev·84·综合分 48

一个自托管 mem0 MCP 服务器,与 Qdrant、Neo4j 和 Ollama 集成,为 Claude Code 提持久的记忆管理功能。

ai-llmdeveloper-toolsknowledge-graph
31
Forks
7
活跃 Issue
2 个月前
最近提交
2 天前
收录于

概述

这是一个完整的 mem0 MCP 服务器实现,支持在 Claude Code 会话间保持持久化记忆。它提供了 11 个 MCP 工具用于记忆管理,同时支持基于云的 Anthropic (Claude) 和完全本地化的 Ollama 配置。该服务器集成了多个后端服务,包括用于向量存储的 Qdrant、用于知识图谱的 Neo4j,以及用于嵌入和可选 LLM 服务的 Ollama。该实现具有生产就绪性,包含全面的文档、多种认证方法和会话钩子,用于自动记忆注入和保存。

试试问 AI

装完之后,这里有 5 个你可以让 AI 做的事:

:跨项目上下文的长时间编码会话中的持久化记忆管理
:用于复杂系统的基于知识图谱的实体关系跟踪
:使用 Ollama 作为 LLM 后端的本地优先 AI 应用程序
:我可以将此 MCP 服务器与 Anthropic 和 Ollama 以外的 AI 提供者一起使用吗?
:钩子和 CLAUDE.md 规则在记忆管理方面有什么区别?

什么时候选它

当您需要 Claude Code 的持久化跨会话记忆,并且希望完全控制数据基础设施时选择此方案。

什么时候不要选它

如果您希望使用云解决方案而不想自己管理向量数据库和图存储基础设施,请避免使用。

此 server 暴露的工具

从 README 抽取出 11 个工具
  • add_memory

    Store text or conversation history as memories

  • search_memories

    Semantic search for relevant memories with optional filters

  • get_memories

    List and filter memories by scope

  • get_memory

    Fetch a specific memory by its UUID

  • update_memory

    Update the text of an existing memory

  • delete_memory

    Delete a single memory by its UUID

  • delete_all_memories

    Bulk delete all memories in a specified scope

  • list_entities

    List all users/agents with their memory counts

  • delete_entities

    Delete an entity and all its associated memories

  • search_graph

    Search Neo4j entities by name and retrieve relationships

  • get_entity

    Get all relationships for a specific entity

可对比工具

mem0vector-mcpsemantic-memory-mcp

安装

# 添加带有默认 Anthropic 提供者的全局配置
claude mcp add --scope user --transport stdio mem0 \
  --env MEM0_USER_ID=your-user-id \
  -- uvx --from git+https://github.com/elvismdev/mem0-mcp-selfhosted.git mem0-mcp-selfhosted

# 添加完全本地的 Ollama 配置
claude mcp add --scope user --transport stdio mem0 \
  --env MEM0_PROVIDER=ollama \
  --env MEM0_LLM_MODEL=qwen3:14b \
  --env MEM0_USER_ID=your-user-id \
  -- uvx --from git+https://github.com/elvismdev/mem0-mcp-selfhosted.git mem0-mcp-selfhosted

# 项目特定设置,创建 .mcp.json
{
  "mcpServers": {
    "mem0": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/elvismdev/mem0-mcp-selfhosted.git", "mem0-mcp-selfhosted"],
      "env": {
        "MEM0_PROVIDER": "ollama",
        "MEM0_LLM_MODEL": "qwen3:14b",
        "MEM0_USER_ID": "your-user-id"
      }
    }
  }
}

FAQ

我可以将此 MCP 服务器与 Anthropic 和 Ollama 以外的 AI 提供者一起使用吗?
目前,服务器支持 Anthropic (Claude) 和 Ollama 作为 LLM 提供者。嵌入生成默认使用 Ollama 和 bge-m3,但这可以配置为其他嵌入模型。
钩子和 CLAUDE.md 规则在记忆管理方面有什么区别?
钩子在会话边界处理自动记忆 - 在启动时注入记忆,在退出时保存摘要。CLAUDE.md 规则提供行为指令,告诉 Claude 在会话期间主动搜索和保存记忆。两者结合使用能获得最佳体验。

Hacker News 讨论

开发者社区最近的相关讨论。

mem0-mcp-selfhosted 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。