# Windsurf

Windsurf (Codeium) has native MCP support via Cascade. However, it does **not** inject MCP server instructions, so you need a one-line addition to your rules for proactive memory behavior.

## MCP Setup

Add to `~/.codeium/windsurf/mcp_config.json`:

```json
{
  "mcpServers": {
    "mnemory": {
      "type": "streamable-http",
      "url": "http://localhost:8050/mcp",
      "headers": {
        "Authorization": "Bearer your-api-key",
        "X-Agent-Id": "windsurf"
      }
    }
  }
}
```

Or install via **Windsurf Settings > Cascade > MCP**.

## System Prompt

Windsurf does **not** inject MCP server instructions. Add this to your Windsurf rules or global instructions:

```
Always call initialize_memory at the start of each conversation and follow received instructions for further memory interactions.
```

The `initialize_memory` tool returns behavioral instructions and core memories in one call, so the LLM knows how to use all memory tools effectively.

See [system prompt templates](../system-prompts/) for more detailed options.

## How Memory Works

Once the rules line is added, Cascade will:

1. **Load context at session start** -- calls `initialize_memory`
2. **Search before answering** -- when questions benefit from personal or project context
3. **Store new information** -- architecture decisions, coding conventions, project structure

## Note on Built-in Memories

Windsurf has its own built-in Memories feature (workspace-scoped, auto-generated by Cascade). mnemory provides cross-tool memory that works across Windsurf, Claude Code, Cursor, and any other MCP client. The two systems work independently -- you can use both.

## Tips

- **Cross-tool memory** -- memories stored in Windsurf are available in Claude Code, Cursor, etc. (and vice versa)
- **Use `project:<name>` categories** -- tag project-specific memories for easy filtering
- **Pin architecture decisions** -- they load at every session start
