---
title: "Memory：Claude、Cursor、Codex 配置指南 · DotsAgent"
description: "在本地文件中维护实体和关系的知识图谱，让 Agent 能在不同会话间回忆信息。 在 13 个 MCP 客户端中配置 Memory。"
url: https://dotsagent.io/zh/mcp/servers/memory
---

模型与记忆 · MCP Steering Group

# 配置 Memory

在本地文件中维护实体和关系的知识图谱，让 Agent 能在不同会话间回忆信息。

- **发布者**: MCP Steering Group 官方
- **本地运行**: `npx -y @modelcontextprotocol/server-memory`
- **传输方式**: stdio
- **身份验证**: 无。
- **环境变量**: `MEMORY_FILE_PATH`
- **可访问内容**: 读取和写入一个本地文件，通过 MEMORY_FILE_PATH 设置。
- **许可证**: MIT (existing) / Apache-2.0 (new contributions)
- **源码**: [github.com/modelcontextprotocol/servers/tree/main/src/memory](https://github.com/modelcontextprotocol/servers/tree/main/src/memory)
- **状态**: 活跃

## 安装

此服务器会在你的本机上作为客户端的子进程运行。你需要安装其命令所用的运行时，例如 npx 需要 Node.js、uvx 需要 uv，或者使用 Docker；还需要设置 Environment 下列出的变量。

### Claude Code

`shell`

```
claude mcp add --scope project memory -- npx -y @modelcontextprotocol/server-memory
```

### Cursor

`.cursor/mcp.json`

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

### Codex

`~/.codex/config.toml`

```
[mcp_servers.memory]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-memory"]
```

[其他客户端的配置 →](https://dotsagent.io/zh/mcp/config#add=memory)

## 模型与记忆 中的其他服务器

- [Sequential Thinking](https://dotsagent.io/zh/mcp/servers/sequential-thinking): 为模型提供一个临时笔记区，用于将问题拆解为编号思路，并进行修改或分支扩展。

- [Pinecone](https://dotsagent.io/zh/mcp/servers/pinecone): 搜索 Pinecone 文档，并通过本地服务器创建 Pinecone 向量索引、写入向量和执行查询。

- [Hugging Face](https://dotsagent.io/zh/mcp/servers/hugging-face): 搜索 Hub 上的模型、数据集、论文和文档，并调用由 Hugging Face 托管的 Gradio Spaces 作为工具。

## 来源

1. [github.com](https://github.com/modelcontextprotocol/servers)/modelcontextprotocol/servers

为 AI agent 开发者提供的独立参考资料。与此处提及的任何厂商均无关联。

© 2026 DotsAgent · 事实核查日期：2026年10月1日
