|Agent Memory

Claude Memory MCP: Persistent Memory, CLAUDE.md, and Shared Context

Compare Claude Memory MCP servers, Claude's native memory, Claude Code auto memory, and CLAUDE.md for persistent context across chats and AI tools.

Andrei
Founder of datamcp

The short answer

Claude memory MCP usually means a Model Context Protocol memory server connected to Claude or Claude Code. It is not one built-in Anthropic product or one standard storage format. Different MCP memory servers may use files, a knowledge graph, structured database entries, or another storage model.

Claude also has several native forms of persistent context, and they solve different problems:

  • Claude Memory summarizes useful context from previous conversations inside Claude.
  • Project memory keeps context separated between Claude projects.
  • CLAUDE.md gives Claude Code durable repository instructions from a Markdown file.
  • Claude Code auto memory stores notes Claude Code learns while working in a repository.
  • An MCP memory server gives Claude and other compatible AI clients a shared, tool-accessible project record.

If you only use Claude, its native memory and project features may be enough. If the same project moves between Claude, Cursor, Codex, VS Code, or several independent agents, a remote Model Context Protocol (MCP) memory server can provide a separate coordination layer that those clients can share.

The useful question is not “which memory is best?” It is “which context must persist, where must it be available, and who should be allowed to update it?”

Is there one official Claude memory MCP server?

No single MCP memory server defines Claude persistent memory.

The Model Context Protocol defines how a client discovers and calls tools. Each memory server defines its own tools, storage model, retrieval behavior, and permissions. The reference knowledge graph memory server, for example, stores entities, relations, and observations. Other projects use Markdown files, SQLite, vector stores, or remote APIs.

That means two products described as a “Claude memory MCP” can behave very differently:

  • one may keep a local knowledge graph for one user
  • one may expose project Markdown files
  • one may provide semantic retrieval over embeddings
  • one may store structured project updates for several AI clients

Before installing or connecting one, inspect its tool list, storage location, write behavior, client support, and access controls. MCP compatibility does not make the underlying memory models equivalent.

Claude persistent memory options at a glance

Memory optionBest forAvailable toStorage behavior
Claude MemoryPreferences and continuity across Claude chatsClaude web, Desktop, and mobileClaude maintains a memory summary from chat history
Claude project memoryContext isolated to one Claude projectChats inside that Claude projectSeparate project summary and project conversation context
CLAUDE.mdStable repository instructions and conventionsClaude Code working in that file hierarchyVersionable Markdown read as project context
Claude Code auto memoryNotes Claude Code learns while workingClaude Code sessions for the repositoryClaude Code maintains files in its project memory directory
MCP memory serverStructured context shared across compatible AI clientsClaude plus other clients connected to the same MCP serverServer-defined tools, storage, permissions, and retrieval

These layers can work together. A repository can keep durable engineering rules in CLAUDE.md, let Claude remember user preferences natively, and use MCP memory for cross-client progress and handoffs.

How Claude's built-in memory works

Anthropic's current chat search and memory documentation describes two related capabilities.

First, Claude can search previous conversations when you ask it to find earlier work. These searches appear as tool calls and can retrieve relevant context from past chats.

Second, Claude can maintain a memory summary generated from chat history. Anthropic says this synthesis is updated every 24 hours for standalone conversations. Claude projects have separate memory spaces and project summaries so one project's context does not automatically blend into another.

This is useful for:

  • personal preferences and working style
  • continuity between Claude conversations
  • recurring goals and project context
  • asking Claude to continue a previous discussion
  • keeping different Claude projects separated

Native Claude Memory is still Claude-specific. It is not a neutral project database that Cursor, Codex, or another MCP client can query directly.

What CLAUDE.md does

CLAUDE.md is a plain Markdown file that Claude Code reads for persistent project instructions. Anthropic's CLAUDE.md guidance recommends using it for the briefing a capable teammate should receive at the beginning of work.

Typical contents include:

  • repository architecture
  • package manager and development commands
  • coding conventions
  • test and validation requirements
  • important directories
  • actions Claude should always or never take

Because CLAUDE.md is a file, it can be reviewed and versioned with the repository. That makes it stronger than chat memory for stable team instructions.

It is less suitable for a continuous stream of task updates. Appending every investigation, deployment, blocker, and agent handoff to one instruction file makes the file noisy and increases the context loaded into future sessions.

What Claude Code auto memory does

Claude Code also has automatic project memory. Anthropic's current Claude Code power-user guidance describes repository-specific memory files under Claude's project memory directory.

This lets Claude Code keep useful notes it learns while working without turning CLAUDE.md into a diary. It is a strong option when Claude Code is the primary agent and the memory should remain within its own workflow.

The boundary is again client scope. Another AI client does not automatically receive Claude Code's internal project memory. Sharing it requires an additional synchronization or handoff mechanism.

What an MCP memory server adds

An MCP memory server publishes memory operations as Model Context Protocol tools. Claude can connect to a remote MCP server as a custom connector, while other compatible clients can connect to the same server through their own MCP configuration.

This creates a different architecture:

Claude chat ─┐
Claude Code ─┼─→ hosted MCP memory → structured project record
Cursor ──────┤
Codex ───────┘

The shared server can define:

  • how a chat or agent session is identified
  • which fields a memory entry contains
  • whether entries are append-only or editable
  • how search works
  • how handoff context is assembled
  • which clients can read or write
  • how one client's access is revoked

This is useful for cross-client coordination. It does not make the model itself remember automatically. The client must call the server's tools, and the quality of the memory depends on what the client writes.

Claude Memory vs. MCP memory

Claude's native memory is usually the simpler choice when all important work stays inside Claude.

Choose native Claude Memory when:

  • you want Claude to remember your preferences and recurring context
  • your work is organized inside Claude projects
  • previous Claude chats contain the context you need
  • no other AI client must read or update that memory
  • you prefer Claude to maintain the summary for you

Choose an MCP memory server when:

  • multiple AI clients work on the same project
  • agents need explicit progress, decision, risk, deploy, and handoff entries
  • you need a project-controlled memory record separate from one model vendor
  • read and write access should differ by MCP link
  • clients should retrieve compact entries instead of entire chat histories

Using both is reasonable. Claude can remember your preferences while the MCP server stores the shared engineering state used by Claude and other agents.

CLAUDE.md vs. MCP memory

CLAUDE.md is best for stable instructions. MCP memory is better suited to changing project state.

Put this in CLAUDE.mdPut this in shared MCP memory
Use pnpm, not npmDependency upgrade completed in commit abc123
Run the production build before handoffProduction build passed after the memory feature change
Never edit generated migration filesMigration issue found and assigned for follow-up
API routes live under a specific directoryEndpoint behavior changed and docs still need updating
Follow the repository's naming conventionNaming decision made for the current feature and why

A useful rule is:

Put instructions that should remain true in CLAUDE.md. Put recent outcomes another agent may need in project memory.

How to connect Claude to a remote MCP memory server

Anthropic currently supports remote MCP servers through custom connectors. Its remote MCP connector guide describes the current flow for Claude, Cowork, and Claude Desktop.

For an individual Claude account:

  1. Open Customize and then Connectors.
  2. Choose Add custom connector.
  3. Add the remote MCP server URL.
  4. Complete the server's authentication flow.
  5. Enable the connector for the conversation that should use it.

Team and Enterprise organizations may require an owner to add the custom connector before individual members connect it.

Remote connectors are reached from Anthropic's cloud infrastructure, so the MCP endpoint must be accessible over the internet. A local stdio server configured directly in Claude Desktop is a separate mechanism.

Using datamcp Agent Memory with Claude

datamcp Agent Memory is a hosted MCP memory server with five tools:

  • register_session
  • append_memory
  • search_memory
  • get_memory_entry
  • create_handoff_context

The current storage model uses structured, append-only entries. Entries can contain a title, summary, Markdown body, type, importance, tags, file paths, metadata, session, and occurrence date.

Search uses PostgreSQL full-text search plus filters. It is not semantic or vector recall. The system does not automatically write when Claude completes a task, and the current MCP tools do not edit or delete previous entries.

A Read Only MCP link lets Claude search, retrieve, and prepare handoff context without writing. A Read & Append link also lets it register a session and append new entries.

A practical Claude memory workflow

Use different layers for different kinds of context:

  1. Put stable repository instructions in CLAUDE.md.
  2. Use Claude Memory for personal preferences and continuity inside Claude.
  3. Create one Agent Memory connection for the shared project.
  4. Give trusted working sessions a Read & Append MCP link.
  5. Give review-only sessions a Read Only link.
  6. Tell Claude to search project memory before starting important work.
  7. Tell Claude to append only meaningful outcomes, decisions, blockers, deploys, and handoffs.
  8. Keep code, formal documentation, and issue status in their canonical systems.

This avoids loading one giant memory file into every prompt while still giving the next agent a concise project record.

Important limitations

Persistent memory does not remove the need to verify context.

  • A model may fail to call a memory tool unless its instructions are clear.
  • A saved entry may be incomplete or incorrect.
  • Prompt injection can be stored as content and should not be treated as trusted instructions.
  • Search can miss an entry when the query does not match the stored terms.
  • Old memory can conflict with newer code or documentation.
  • Session names help attribution but do not prove agent identity.

Treat retrieved memory as project evidence to inspect, not as a higher-priority instruction source.

Which Claude memory should you use?

Use Claude's built-in memory when you want continuity inside Claude with minimal setup.

Use CLAUDE.md when the repository needs stable, reviewable instructions.

Use Claude Code auto memory when Claude Code should preserve its own learned project notes.

Use an MCP memory server when several compatible AI clients need an explicit shared record with server-defined tools and access boundaries.

For the general architecture, read Agent Memory: Shared Context for AI Agents Through MCP. To compare file-oriented project memory with structured hosted memory, use the Memory Bank MCP guide. To evaluate the hosted implementation, see the datamcp MCP memory server and Agent Memory setup reference.

Claude memory MCPClaude persistent memoryClaude memoryCLAUDE.mdMCP memoryAI agents

Create one shared memory for your AI chats

Create Agent Memory in datamcp, get a hosted HTTPS MCP link, and connect compatible AI chats to the same structured project record. The Free plan includes 1 connection and 1 MCP link.

Create free Agent Memory

Explore Agent Memory · Questions? Read the docs or view pricing.