Get persistent memory working in Windsurf in under 2 minutes.
- Windsurf IDE (latest version)
- Python 3.10+
- pipx installed (
pip install --user pipx && pipx ensurepath)
pipx install memorygraphMCPVerify installation:
memorygraph --versionOption A: Via Settings UI
- Open Windsurf Settings (
Cmd/Ctrl + ,) - Search for "MCP" or navigate to Extensions > MCP Servers
- Click Add MCP Server
- Configure:
- Name:
memorygraph - Command:
memorygraph - Transport:
stdio
- Name:
Option B: Via Configuration File
Windsurf uses a similar configuration format to other MCP clients. Create or edit your MCP configuration:
{
"mcpServers": {
"memorygraph": {
"command": "memorygraph",
"args": [],
"env": {}
}
}
}Location varies by OS:
- macOS:
~/Library/Application Support/Windsurf/mcp.json - Linux:
~/.config/Windsurf/mcp.json - Windows:
%APPDATA%\Windsurf\mcp.json
Close and reopen Windsurf to load the MCP server.
In Windsurf's AI chat, ask:
What memory tools do you have available?
You should see MemoryGraph tools listed.
Store your first memory:
Store this for later: Use pnpm instead of npm for this monorepo
Retrieve it later:
What package manager should I use for this project?
{
"mcpServers": {
"memorygraph": {
"command": "memorygraph",
"args": ["--profile", "extended"]
}
}
}{
"mcpServers": {
"memorygraph": {
"command": "memorygraph",
"env": {
"MEMORY_SQLITE_PATH": "/path/to/your/memory.db"
}
}
}
}Create .windsurf/mcp.json in your project root:
{
"mcpServers": {
"memorygraph": {
"command": "memorygraph",
"env": {
"MEMORY_SQLITE_PATH": "./.windsurf/memory.db"
}
}
}
}-
Check that memorygraph is installed and in PATH:
which memorygraph memorygraph --version
-
If not found, ensure pipx bin is in your PATH:
pipx ensurepath # Restart terminal -
Use full path in configuration:
{ "command": "/Users/yourname/.local/bin/memorygraph" }
- Verify MCP server status in Windsurf settings
- Check for error messages in the server logs
- Restart Windsurf completely (not just reload)
echo '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}},"id":1}' | memorygraphYou should see a JSON response with capabilities.
If Windsurf requires SSE transport instead of stdio, you may need to run MemoryGraph with an SSE wrapper. Check Windsurf documentation for current requirements.
- Leverage Windsurf's features - Combine MemoryGraph with Windsurf's code understanding
- Store architectural decisions - Remember why you made certain choices
- Track what works - Store successful patterns for future reference
- Query before coding - Check if you've solved similar problems
Add this to .windsurfrules or your project's rules file for automatic memory usage:
## Memory Protocol
### REQUIRED: Before Starting Work
You MUST use `recall_memories` before any task. Query by project, tech, or task type.
### REQUIRED: Automatic Storage Triggers
Store memories on ANY of:
- **Git commit** → what was fixed/added
- **Bug fix** → problem + solution
- **Version release** → summarize changes
- **Architecture decision** → choice + rationale
- **Pattern discovered** → reusable approach
### Timing Mode (default: on-commit)
`memory_mode: immediate | on-commit | session-end`
### Memory Fields
- **Type**: solution | problem | code_pattern | fix | error | workflow
- **Title**: Specific, searchable (not generic)
- **Content**: Accomplishment, decisions, patterns
- **Tags**: project, tech, category (REQUIRED)
- **Importance**: 0.8+ critical, 0.5-0.7 standard, 0.3-0.4 minor
- **Relationships**: Link related memories when they exist
Do NOT wait to be asked. Memory storage is automatic.File locations:
- Project-specific:
.windsurfrulesin project root - Global: Windsurf Settings > AI Rules
Windsurf has a rich feature set. MemoryGraph complements these by:
- Persisting context - Remember discussions across sessions
- Tracking solutions - Know what worked in past projects
- Building relationships - Connect problems to their solutions
Works with: Windsurf (all versions with MCP support) Transport: stdio (SSE may be supported) Profiles: core (9 tools), extended (11 tools)