Memory MCP Server

Official

A knowledge graph your assistant keeps between sessions — entities, relations and observations that persist.

Local serverstdioTypeScriptMIT 63.0k

What is the Memory MCP server?

Every conversation with an LLM starts from zero — the colleague with perfect amnesia. The Memory MCP server is the reference fix: a local knowledge graph where the assistant records entities (people, projects, preferences), relations between them ("Sarah leads the mobile project") and observations ("prefers concise updates"), all persisted to disk and searchable in later sessions.

The graph structure matters more than it first appears. Flat note-taking rots into an unsearchable pile; entities-and-relations stay navigable — ask about Sarah and the assistant traverses to her projects, her preferences, the decisions she was part of. Memory recall becomes structured lookup rather than needle-hunting.

What emerges with steady use is continuity. Tell your assistant once that your stack is Next.js with Postgres and it stops asking; mention your manager's name in March and it's known in August; decisions land in the graph and "why did we choose X?" pulls the recorded reasoning. The standard pattern adds a system-prompt instruction telling the model when to store and retrieve — most clients let you set this per-project — after which memory maintenance happens quietly in the background of normal conversation.

Storage is a JSONL file on your machine: private by default, trivially backed up, portable between clients, editable by hand if the graph learns something wrong. Like the other archived reference servers it's stable rather than evolving, and its simplicity is the appeal — persistent memory with no database, no embeddings service, no subscription. For most personal-assistant setups it's the right first memory layer.

Making memory actually stick

  • The tools exist but nothing invokes them on its own. Add a short custom-instructions block — "at the start of a session, search memory for relevant context; when I state a durable preference or decision, record it" — and the behaviour becomes automatic instead of something you have to ask for.
  • Entity names are the primary key, so keep them stable and specific. Sarah Chen and Sarah (design) become two unrelated nodes that never connect, and nothing warns you.
  • Set MEMORY_FILE_PATH to a synced or version-controlled folder. The file is newline-delimited JSON, so a git diff after a session reads as a plain list of what the assistant learned.
  • Prune deliberately. delete_observations removes a single stale fact while leaving the entity and its relations intact — usually what you want when a preference changes rather than deleting the person.

What you can do with it

A assistant that knows you

Stack, preferences, colleagues and context accumulate instead of resetting.

Decision memory

Choices and their reasoning recorded, retrievable months later.

Relationship context

People and projects linked so recall follows the connections.

Available tools

ToolWhat it does
create_entitiesAdd people, projects, concepts to the graph
create_relationsLink entities ('Sarah' — 'leads' — 'mobile project')
add_observationsAttach facts to entities
search_nodesFind relevant memories by query
open_nodesRead specific entities with their relations
read_graphDump the full graph
delete_entities / delete_observationsForget things deliberately

How to install the Memory MCP server

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

Set MEMORY_FILE_PATH to control where the graph lives; pair with a system-prompt instruction about when to remember.

Configuration

Node.js 18+. Storage is a local JSONL file; add a system-prompt memory policy for best results.

VariableDescriptionRequired
MEMORY_FILE_PATHWhere the knowledge-graph JSONL file is storede.g. /Users/you/.mcp-memory/graph.jsonlOptional

Example prompts to try

  • Remember: our production stack is Next.js on Vercel with Neon Postgres.
  • What do you know about the mobile project and who's involved?
  • We decided against microservices last quarter — recall why?

Frequently asked questions

In a local JSONL file (path configurable via MEMORY_FILE_PATH) — no cloud, no database. Back it up or sync it like any file; edit it by hand if the graph learns something wrong.