Back to MCP Servers
内存模型上下文协议 logo
mcp-server387

内存模型上下文协议

内存模型上下文协议是官方参考的模型上下文协议服务器,提供基于知识图谱的持久内存系统。它支持如Claude和Cursor等人工智能代理跨会话存储、检索并记忆用户偏好、项目详情与对话上下文。

概述

Memory MCP 是 Model Context Protocol(MCP)官方推出的持久化内存参考服务器。它实现了一个轻量级知识图谱,使 AI 智能体能够跨对话和会话存储并检索结构化信息。

作为 Model Context Protocol 团队官方 MCP 服务器仓库的一部分,它解决了大语言模型(LLMs)的最大限制之一:无状态性。智能体无需每次都重复上下文,而是可以保存事实、用户偏好、项目细节、决策和观察结果——然后根据需要随时调用。

它是众多社区内存实现方案的基础,并且在 Claude Desktop、Claude Code、Cursor 和其他 MCP 客户端工具中直接获得支持。

功能特性

  • 知识图谱存储:持久存储包含观察结果、关系和属性的实体。
  • 添加/检索/搜索记忆:提供创建实体、添加观察、按关键词或语义搜索以及获取相关上下文的工具。
  • 跨会话持久化:数据在重启后依然存在,可用于新的对话。
  • 作用域与结构化:支持用户级、项目级或对话级内存,采用清晰的实体-关系模型。
  • 轻量级与本地优先:可通过 npx、Docker 或本地安装运行,依赖项极少。
  • 符合 MCP 标准:提供完整的工具发现、JSON-RPC 接口,可与任何 MCP 客户端无缝集成。
  • 可扩展的基础:可作为高级实现(向量搜索、Neo4j 等图数据库或混合系统)的起点。

使用场景

  • 跨会话连续性:Claude 或 Cursor 能记住项目架构、编码偏好和过往决策,无需重新解释。
  • 用户偏好追踪:存储风格偏好、工具选择或工作流习惯,以实现个性化辅助。
  • 项目知识库:构建关于代码库事实、Bug 解决方案和设计决策的动态图谱。
  • 多智能体协作:在复杂工作流中,不同 AI 智能体或会话间共享记忆。
  • 长期学习:智能体积累数周或数月知识,提高效率并减少上下文窗口浪费。

安装与快速开始

使用 npx(最简单)

npx -y @modelcontextprotocol/server-memory

为 Claude Desktop / Cursor 配置

添加到您的 MCP 配置文件(例如 claude_desktop_config.json.cursor/mcp.json):

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-memory"]
    }
  }
}

Docker 选项

docker run -i -v claude-memory:/app/dist --rm mcp/memory

运行后,AI 智能体即可使用诸如 create_entityadd_observationsearch_memoriesget_graph 等工具与持久化内存存储进行交互。

为何选择 Memory MCP?

大语言模型虽功能强大,但在不同会话间缺乏记忆。Memory MCP 通过提供标准化、安全且可发现的方式维持长期上下文,将它们转变为有状态的协作伙伴。它能显著降低 token 消耗(无需每次粘贴历史记录),并实现更自然、连续的工作流程。

官方实现采用简单的本地知识图谱架构,使其快速、私密且易于自行部署。社区扩展则增加了向量搜索、Neo4j 后端或混合语义+图谱功能,以构建更丰富的记忆系统。

进阶技巧与生态体系

  • 结合 Claude Thread Continuity 或其他 MCP 服务器,实现完整对话+项目记忆
  • 生产环境或多用户场景中,可选用支持 SQLite、MongoDB、Qdrant 或 Neo4j 后端的社区分支版本
  • 配合 uv-mcpplaywright-mcppostgres-mcp 等工具,构建兼具行动与记忆能力的完整智能体工作流
  • 大规模使用时需监控存储增长并实施数据清理策略

相关链接

Memory MCP 是 MCP 生态系统中构建真正持久化智能 AI 代理的基础组件。

Tags

模型上下文协议内存持久内存知识图谱模型上下文协议服务器人工智能代理ClaudeCursor长期记忆

Related Entries

Keep exploring similar tools and resources in this category.

Browse MCP Servers
Cursor MCP logo

Cursor MCP

MCP Servers

Cursor MCP is Cursor's Model Context Protocol client support for connecting the Cursor editor and Cursor CLI agent to external MCP servers. Official docs cover stdio, SSE, Streamable HTTP, mcp.json configuration, OAuth, Marketplace plugins, and CLI management commands.

Higgsfield MCP logo

Higgsfield MCP

MCP Servers

Higgsfield MCP is Higgsfield AI's hosted MCP connector for generating images, videos, reusable characters, and creative assets from Claude or MCP-compatible agents. It uses a Higgsfield account and platform credits, with no API key documented for the official MCP connector.

Agent Reach logo

Agent Reach

MCP Servers

Agent Reach is an open-source CLI and Agent Skill that installs, routes, and health-checks upstream tools for web, social, GitHub, video transcript, RSS, and search access. It is not documented as a standalone MCP server; some channels use MCP-backed upstream tools such as mcporter/Exa, xiaohongshu-mcp, and linkedin-scraper-mcp.

Design Bridge MCP logo

Design Bridge MCP

MCP Servers

Design Bridge MCP connects Framer projects to Claude, Cursor, and other MCP-compatible assistants for AI-driven canvas and project automation.

RevenueCat MCP Server logo

RevenueCat MCP Server

MCP Servers

RevenueCat MCP Server lets AI assistants manage RevenueCat subscription infrastructure through natural language, including projects, apps, products, entitlements, offerings, paywalls, and analytics.

TinyFish logo

TinyFish

MCP Servers

TinyFish 为兼容 MCP 的 AI 助手提供网络自动化、网络搜索、内容提取和远程浏览器会话工具。托管的 MCP 服务器使用 OAuth 2.1,而可选的本地 @tiny-fish/mcp 代理支持仅本地、CI 和无头环境下的 API 密钥认证。