Windsurf (by Codeium) supports MCP servers via a configuration file.
Edit the MCP configuration file located at:
- macOS/Linux:
~/.codeium/windsurf/mcp_config.json - Windows:
%USERPROFILE%\.codeium\windsurf\mcp_config.json
Add the server to the mcpServers object.
Note: Windsurf may not support dynamic variables like
${workspaceFolder}yet. We recommend using the absolute path or setting up separate "profiles" if needed.
{
"mcpServers": {
"smart-coding-mcp": {
"command": "npx",
"args": [
"-y",
"smart-coding-mcp",
"--workspace",
"/absolute/path/to/your/project"
]
}
}
}Windsurf uses .windsurfrules for project-specific AI rules.
Create a file .windsurfrules in your project root:
---
trigger: always_on
description: Mandatory usage of Smart Coding MCP tools for dependencies and search
---
# Smart Coding MCP Usage Rules
You must prioritize using the **Smart Coding MCP** tools for the following tasks.
## 1. Dependency Management
**Trigger:** When checking, adding, or updating package versions (npm, python, go, rust, etc.).
**Action:**
- **MUST** use the `d_check_last_version` tool.
- **DO NOT** guess versions or trust internal training data.
- **DO NOT** use generic web search unless `d_check_last_version` fails.
## 2. Codebase Research
**Trigger:** When asking about "how" something works, finding logic, or understanding architecture.
**Action:**
- **MUST** use `a_semantic_search` as the FIRST tool for any codebase research
- **DO NOT** use `Glob` or `Grep` for exploratory searches
- Use `Grep` ONLY for exact literal string matching (e.g., finding a specific error message)
- Use `Glob` ONLY when you already know the exact filename pattern
## 3. Environment & Status
**Trigger:** When starting a session or debugging the environment.
**Action:**
- Use `e_set_workspace` if the current workspace path is incorrect.
- Use `f_get_status` to verify the MCP server is healthy and indexed.For rules across all projects, edit:
- macOS/Linux:
~/.codeium/windsurf/memories/global_rules.md - Windows:
%USERPROFILE%\.codeium\windsurf\memories\global_rules.md
After saving the file:
- Restart Windsurf.
- Check the Cascade/Chat panel to see if the tools are available (usually indicated by a hammer/wrench icon).