
How to add MCP Claude Code to Windsurf
Claude Code-style coding agent over MCP: read/edit files, run commands, search code, delegate to sub-agents. Paste the config into ~/.codeium/windsurf/mcp_config.json and restart Windsurf.
Last updated June 14, 2026 · 301★ · stdio · no auth
Windsurf config for MCP Claude Code
uvx --from mcp-claude-code claudecode --install{
"mcpServers": {
"mcp-claude-code": {
"command": "uvx",
"args": [
"--from",
"mcp-claude-code",
"claudecode",
"--allow-path",
"/path/allow",
"--project",
"/path/project1",
"--project",
"/path/project2"
]
}
}
}Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.
Setup steps
- 1Open Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
- 2Paste the MCP Claude Code config below.
- 3Fill in placeholder secrets, then save.
- 4Click Refresh in the MCP panel.
- 5MCP Claude Code's tools become available to Cascade.
Before you start
- Python 3.12 or later
- Claude Desktop application (or another MCP client)
- uv/uvx or pip to install the mcp-claude-code package
- Optional: ripgrep for enhanced search performance
- Optional: an LLM provider API key (LiteLLM-compatible) to enable the agent tool
What MCP Claude Code can do in Windsurf
readRead file contents with line numbers, offset, and limit capabilities.
writeCreate or overwrite files.
editMake line-based edits to text files.
multi_editMake multiple precise text replacements in a single file operation with atomic transactions.
directory_treeGet a recursive tree view of directories.
grepFast pattern search in files with ripgrep integration for best performance.
content_replaceReplace patterns in file contents.
grep_astSearch code with AST context showing matches within functions, classes, and other structures.
Security
Access is restricted to directories passed via --allow-path; file modifications and command execution trigger permission handling, with input validation and sanitization. The run_command tool executes arbitrary shell commands within allowed paths, so only grant access to directories you trust. The optional agent tool requires an LLM provider API key (passed via --agent-api-key or environment variables such as OPENAI_API_KEY / ANTHROPIC_API_KEY).
MCP Claude Code + Windsurf FAQ
Where is the Windsurf config file?
Windsurf reads MCP servers from ~/.codeium/windsurf/mcp_config.json. Paste the MCP Claude Code config there under the "mcpServers" key and restart the client.
Is MCP Claude Code safe to use with Windsurf?
Access is restricted to directories passed via --allow-path; file modifications and command execution trigger permission handling, with input validation and sanitization. The run_command tool executes arbitrary shell commands within allowed paths, so only grant access to directories you trust. The optional agent tool requires an LLM provider API key (passed via --agent-api-key or environment variables such as OPENAI_API_KEY / ANTHROPIC_API_KEY).
How do I install and configure it?
The recommended method is uvx: run `uvx --from mcp-claude-code claudecode --install` to auto-configure Claude Desktop, or add a manual `mcpServers` entry with command `uvx` and args `--from mcp-claude-code claudecode --allow-path /path/allow`. You can also `pip install mcp-claude-code` and use the `claudecode` command directly.
How is filesystem access secured?
The server only accesses directories you explicitly pass via `--allow-path` (multiple allowed). File modifications and command execution use permission handling, and inputs are validated and sanitized.
How do I enable the agent (sub-agent) tool?
Add `--enable-agent-tool` and configure an LLM provider with `--agent-model` (LiteLLM format, e.g. `openai/gpt-4o` or `anthropic/claude-3-5-sonnet-20241022`) plus `--agent-api-key`, or use environment variables like OPENAI_API_KEY / ANTHROPIC_API_KEY. It is disabled by default.