MCP Directory

How to add Memory (Knowledge Graph) to Windsurf

Official MCP server providing persistent, file-backed knowledge-graph memory across sessions. Paste the config into ~/.codeium/windsurf/mcp_config.json and restart Windsurf.

Last updated June 15, 2026 · 74k · stdio · no auth · official

Windsurf config for Memory (Knowledge Graph)

npx -y @modelcontextprotocol/server-memory
{
  "mcpServers": {
    "memory-knowledge-graph": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-memory"
      ],
      "env": {
        "MEMORY_FILE_PATH": "/absolute/path/to/memory.jsonl"
      }
    }
  }
}

Setup steps

  1. 1Open Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
  2. 2Paste the Memory (Knowledge Graph) config below.
  3. 3Fill in placeholder secrets, then save.
  4. 4Click Refresh in the MCP panel.
  5. 5Memory (Knowledge Graph)'s tools become available to Cascade.

Before you start

  • Node.js 18+ (to run via `npx @modelcontextprotocol/server-memory`), OR Docker if using the container image
  • No credentials or auth required
  • A writable location for the JSONL memory file (defaults to `memory.jsonl`; set `MEMORY_FILE_PATH` to relocate it, and a Docker volume if you want persistence in a container)

What Memory (Knowledge Graph) can do in Windsurf

create_entities

Add one or more new entities, each with a type and initial observations.

create_relations

Create directed, active-voice relations between existing entities.

add_observations

Append new observation strings to existing entities.

delete_entities

Remove entities and any relations that reference them.

delete_observations

Remove specific observations from an entity.

delete_relations

Remove specific relations between entities.

read_graph

Return the entire knowledge graph (all entities and relations).

search_nodes

Search entities by name, type, or observation content.

Security

Memory contents are stored unencrypted in a local JSON-lines file; treat that file as sensitive if the model stores personal data. Anyone with disk access can read or tamper with the stored graph.

Memory (Knowledge Graph) + Windsurf FAQ

Where is the Windsurf config file?

Windsurf reads MCP servers from ~/.codeium/windsurf/mcp_config.json. Paste the Memory (Knowledge Graph) config there under the "mcpServers" key and restart the client.

Is Memory (Knowledge Graph) safe to use with Windsurf?

Memory contents are stored unencrypted in a local JSON-lines file; treat that file as sensitive if the model stores personal data. Anyone with disk access can read or tamper with the stored graph.

Where is my memory data stored?

In a single JSONL file — `memory.jsonl` by default, next to the server. Override the location with the `MEMORY_FILE_PATH` environment variable.

Does the model automatically remember things?

Not on its own. You should add prompt instructions telling it when to call the memory tools; the README provides a sample system prompt for this.

How do I keep memory when running in Docker?

Mount a named volume (e.g. `-v claude-memory:/app/dist`) so the JSONL file isn't lost when the container is removed.

View repo Full Memory (Knowledge Graph) page