# Memory

> Persistent knowledge graph memory across AI conversations.

[Canonical HTML page](https://top-mcps.com/mcp/memory) · [server.json](https://top-mcps.com/mcp/memory.json) · [methodology](https://top-mcps.com/about/methodology)

## Install

### Claude Desktop — `claude_desktop_config.json`

Paste under mcpServers. Fully quit and reopen Claude after editing.

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

### Claude Code — `CLI or .mcp.json`

Run from your repo. Commit .mcp.json to share with your team.

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

### Cursor — `.cursor/mcp.json`

Global path: ~/.cursor/mcp.json. Reload window after editing.

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

### VS Code — `.vscode/mcp.json`

VS Code uses the "servers" key (not "mcpServers").

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

### Windsurf — `~/.codeium/windsurf/mcp_config.json`

Open via Cascade → hammer icon → Configure.

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

### Cline — `cline_mcp_settings.json`

Open via the Cline sidebar → MCP Servers → Edit.

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

### Continue — `~/.continue/config.json`

Continue uses modelContextProtocolServers with a transport block.

```json
{
  "experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "stdio",
          "command": "npx",
          "args": [
            "-y",
            "@modelcontextprotocol/server-memory"
          ]
        }
      }
    ]
  }
}
```

### Codex CLI — `~/.codex/config.toml`

Codex uses TOML. Each server is a [mcp_servers.<name>] subtable.

```shell
# ~/.codex/config.toml
[mcp_servers.memory]
command = "npx"
args = [
  "-y",
  "@modelcontextprotocol/server-memory",
]
```

### Zed — `~/.config/zed/settings.json`

Zed calls them "context_servers". Settings live-reload on save.

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

### ChatGPT — `ChatGPT → Apps directory`

Memory doesn't ship a hosted HTTPS endpoint today. ChatGPT supports remote MCP servers only — to use this server in ChatGPT you'll need to deploy it to a public HTTPS URL first (e.g. via Cloudflare Workers or Vercel) or wait for an official remote build.

```none

```

## At a glance

- **Maintainer:** Anthropic (modelcontextprotocol)
- **Transport:** stdio
- **Auth model:** None
- **Required secrets:** None
- **Supported clients:** Claude, Any MCP-compatible client
- **License:** MIT
- **Language:** TypeScript
- **Latest version:** latest
- **Last verified:** 2026-05-31
- **GitHub stars:** 84,102 (fetched 2026-06-02T11:55:51.510Z)
- **Score:** 91/100 (rubric 2026-04 — see https://top-mcps.com/about/methodology)
- **Source:** https://github.com/modelcontextprotocol/servers/tree/main/src/memory

## Tools & permissions

| Tool | Description | Args | Side effects |
|------|-------------|------|--------------|
| `create_entities` | Create named entities with types and observations. | `entities: object[]` | write |
| `create_relations` | Create typed relations between existing entities. | `relations: object[]` | write |
| `add_observations` | Append observations to existing entities. | `observations: object[]` | write |
| `delete_entities` | Delete entities and their relations. | `entityNames: string[]` | write |
| `delete_observations` | Remove specific observations from entities. | `deletions: object[]` | write |
| `delete_relations` | Remove relations between entities. | `relations: object[]` | write |
| `read_graph` | Return the full knowledge graph. | `—` | read |
| `search_nodes` | Search for entities by query. | `query: string` | read |
| `open_nodes` | Return specific entities by name. | `names: string[]` | read |

## Security & scope

- **Access scope:** read-write
- **Sandbox:** Persists a knowledge graph as a single JSON file on disk (default `~/.mcp/memory/memory.json`, override via `MEMORY_FILE_PATH`). No network access.
- **Gotchas:**
  - The memory file is plain JSON — if you store sensitive information the server does not encrypt it.
  - No concurrency control — avoid two clients writing the same file simultaneously.

## Quick answer

**What it does.** Maintains a persistent knowledge graph of entities and relationships stored locally. The model can create, query, update, and delete memories across sessions.

**Best for:**
- Long-running agent workflows
- Personal AI assistants
- Project tracking
- User preference storage
- Agent knowledge accumulation

**Not for:**
- Single-session tasks
- Structured database queries
- High-volume data storage

## Recipes

### Teach the agent persistent facts about a project

```
Remember these facts about my current project: (1) it is a CRM called Atlas, (2) stack is TypeScript + Next.js + Postgres, (3) I prefer minimal dependencies and terse code. Tomorrow, confirm you remember all three before writing any code for this repo.
```

_Tested with: Claude Desktop, Cursor_

## Description

The Memory MCP gives AI models persistent memory using a local knowledge graph. Store entities, relationships, and observations that persist between sessions. The best way to give an AI agent long-term memory that survives conversation resets.

## Why it matters

AI models are stateless by default. Memory MCP is the simplest way to give an agent long-term knowledge that carries over between sessions.

## Key features

- Persistent knowledge graph
- Entity and relationship storage
- Cross-session memory
- Local file storage
- Official Anthropic support

## FAQ

### Where is memory stored?

In a single local JSON file per MCP process — by default inside the working directory. Set `MEMORY_FILE_PATH` in the `env` block to pin it to a fixed path like `~/.claude/memory.json` so it persists across clients.

### Can the model forget memories?

Yes. The server exposes `delete_entities`, `delete_relations`, and `delete_observations`. The agent can remove a single observation without destroying the entity it belonged to — useful for correcting wrong facts.

### What is the data model — is it just key/value?

No, it is a knowledge graph: entities (nodes with a type) linked by relations, each entity carrying a list of observations. That structure matches how people actually describe what they want remembered ("Alice works at Acme, started in 2024") more naturally than flat key/value.

### How big can the memory file get before it slows down?

The entire graph is read and re-written on each change, so performance degrades around a few tens of thousands of entities. For that scale, switch to a database MCP (SQLite or Postgres) and build your own structure.

### Will two clients share memory if they point at the same file?

They will see the same data on startup, but each server holds the graph in-memory and overwrites the file on every mutation — concurrent writes from two processes will clobber each other. For shared memory use one dedicated client as the owner.

## Changelog

- **2026-05-31** — Refreshed install snippets and fact sheet; verified for 2026.
- **2024-11-25** — Initial directory listing.
