
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
- 1Open Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
- 2Paste the Memory (Knowledge Graph) config below.
- 3Fill in placeholder secrets, then save.
- 4Click Refresh in the MCP panel.
- 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_entitiesAdd one or more new entities, each with a type and initial observations.
create_relationsCreate directed, active-voice relations between existing entities.
add_observationsAppend new observation strings to existing entities.
delete_entitiesRemove entities and any relations that reference them.
delete_observationsRemove specific observations from an entity.
delete_relationsRemove specific relations between entities.
read_graphReturn the entire knowledge graph (all entities and relations).
search_nodesSearch 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.