Wraps Windsurf's reverse-engineered SWE-grep protocol to bring AI-powered semantic code search to any MCP client. Instead of exact string matching, you ask natural language questions like "where's the authentication logic?" and get back specific file paths with line ranges. Under the hood, it sends your project's directory tree to Windsurf's Devstral model, which generates ripgrep commands, executes them locally, and iterates until it finds relevant code sections. Bundles ripgrep via npm so no system dependencies needed. Requires a Windsurf API key but works with their free tier.
AI-driven semantic code search as an MCP tool — powered by Windsurf's reverse-engineered SWE-grep protocol.
Any MCP-compatible client (Claude Code, Claude Desktop, Cursor, etc.) can use this to search codebases with natural language queries. All tools are bundled via npm — no system-level dependencies needed (ripgrep via @vscode/ripgrep, tree via tree-node-cli). Works on macOS, Windows, and Linux.
You: "where is the authentication logic?"
│
▼
┌─────────────────────────┐
│ Fast Context MCP │
│ (local MCP server) │
│ │
│ 1. Maps project → /codebase
│ 2. Sends query to Windsurf Devstral API
│ 3. AI generates rg/readfile/tree commands
│ 4. Executes commands locally (built-in rg)
│ 5. Returns results to AI
│ 6. Repeats for N rounds
│ 7. Returns file paths + line ranges
│ + suggested search keywords
└─────────────────────────┘
│
▼
Found 3 relevant files.
[1/3] /project/src/auth/handler.py (L10-60)
[2/3] /project/src/middleware/jwt.py (L1-40)
[3/3] /project/src/models/user.py (L20-80)
Suggested search keywords:
authenticate, jwt.*verify, session.*token
No need to install ripgrep — it's bundled via @vscode/ripgrep.
# Latest stable release
npm install @sammysnake/fast-context-mcp
# Or beta/next release
npm install @sammysnake/fast-context-mcp@next
git clone https://github.com/SammySnake-d/fast-context-mcp.git
cd fast-context-mcp
npm install
The server auto-extracts the API key from your local Windsurf installation. You can also use the extract_windsurf_key MCP tool after setup, or set WINDSURF_API_KEY manually.
Key is stored in Devin's local SQLite database. The legacy Windsurf path is still checked as a fallback:
| Platform | Path |
|---|---|
| macOS | ~/Library/Application Support/Deviv/User/globalStorage/state.vscdb |
| Windows | %APPDATA%/Deviv/User/globalStorage/state.vscdb |
| Linux | ~/.config/Deviv/User/globalStorage/state.vscdb |
On WSL/Linux, the server first checks Devin CLI credentials at ~/.local/share/devin/credentials.toml. If a Windows-extracted key returns 403 inside WSL, run devin login inside WSL and retry.
Add to ~/.claude.json under mcpServers:
{
"fast-context": {
"command": "npx",
"args": ["-y", "--prefer-online", "@sammysnake/fast-context-mcp"],
"env": {
"WINDSURF_API_KEY": "sk-ws-01-xxxxx"
}
}
}
For beta/next release:
{
"fast-context": {
"command": "npx",
"args": ["-y", "--prefer-online", "@sammysnake/fast-context-mcp@next"],
"env": {
"WINDSURF_API_KEY": "sk-ws-01-xxxxx"
}
}
}
Add to claude_desktop_config.json under mcpServers:
{
"fast-context": {
"command": "npx",
"args": ["-y", "--prefer-online", "@sammysnake/fast-context-mcp"],
"env": {
"WINDSURF_API_KEY": "sk-ws-01-xxxxx"
}
}
}
For beta/next release:
{
"fast-context": {
"command": "npx",
"args": ["-y", "--prefer-online", "@sammysnake/fast-context-mcp@next"],
"env": {
"WINDSURF_API_KEY": "sk-ws-01-xxxxx"
}
}
}
If
WINDSURF_API_KEYis omitted, the server auto-discovers it from your local Windsurf installation.
| Variable | Default | Description |
|---|---|---|
WINDSURF_API_KEY | (auto-discover) | Windsurf API key |
FC_MAX_TURNS | 3 | Search rounds per query (more = deeper but slower) |
FC_MAX_COMMANDS | 8 | Max parallel commands per round |
FC_TIMEOUT_MS | 30000 | Connect-Timeout-Ms for streaming requests |
FC_HIDE_EXTRACT_WINDSURF_KEY_TOOL | false | Hide extract_windsurf_key from MCP tools when set to 1, true, yes, or on |
FC_RESULT_MAX_LINES | 50 | Max lines per command output (truncation) |
FC_LINE_MAX_CHARS | 250 | Max characters per output line (truncation) |
WS_MODEL | MODEL_SWE_1_6_FAST | Windsurf model name |
WS_APP_VER | 1.48.2 | Windsurf app version (protocol metadata) |
WS_LS_VER | 1.9544.35 | Windsurf language server version (protocol metadata) |
The model can be changed by setting WS_MODEL (see environment variables above).

Default: MODEL_SWE_1_6_FAST — fastest speed, richest grep keywords, finest location granularity.
fast_context_searchAI-driven semantic code search with tunable parameters.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | Yes | — | Natural language search query |
project_path | string | No | cwd | Absolute path to project root |
tree_depth | integer | No | 3 | Directory tree depth for repo map (1-6). Higher = more context but larger payload. Auto falls back to lower depth if tree exceeds 250KB. Use 1-2 for huge monorepos (>5000 files), 3 for most projects, 4-6 for small projects. |
max_turns | integer | No | 3 | Search rounds (1-5). More = deeper search but slower. Use 1-2 for simple lookups, 3 for most queries, 4-5 for complex analysis. |
max_results | integer | No | 10 | Maximum number of files to return (1-30). Smaller = more focused, larger = broader exploration. |
Returns:
[config] line showing actual tree_depth used, tree size, and whether fallback occurred)Example output:
Found 3 relevant files.
[1/3] /project/src/auth/handler.py (L10-60, L120-180)
[2/3] /project/src/middleware/jwt.py (L1-40)
[3/3] /project/src/models/user.py (L20-80)
grep keywords: authenticate, jwt.*verify, session.*token
[config] tree_depth=3, tree_size=12.5KB, max_turns=3
Error output includes status-specific hints:
Error: Request failed: HTTP 403
[hint] 403 Forbidden: Authentication failed. The API key may be expired or revoked.
Try re-extracting with extract_windsurf_key, or set a fresh WINDSURF_API_KEY env var.
If you are running inside WSL, run `devin login` inside WSL so `~/.local/share/devin/credentials.toml` exists.
Error: Request failed: HTTP 413
[diagnostic] tree_depth_used=3, tree_size=280.0KB (auto fell back from requested depth)
[hint] If the error is payload-related, try a lower tree_depth value.
extract_windsurf_keyExtract Windsurf API Key from local installation. No parameters.
Set FC_HIDE_EXTRACT_WINDSURF_KEY_TOOL=1 at MCP server startup to hide this tool from tools/list. This does not disable internal API-key auto-discovery for fast_context_search.
fast-context-mcp/
├── package.json
├── src/
│ ├── server.mjs # MCP server entry point
│ ├── core.mjs # Auth, message building, streaming, search loop
│ ├── executor.mjs # Tool executor: rg, readfile, tree, ls, glob
│ ├── extract-key.mjs # Windsurf API Key extraction (SQLite)
│ └── protobuf.mjs # Protobuf encoder/decoder + Connect-RPC frames
├── README.md
└── LICENSE
/codebase pathFC_MAX_COMMANDS per round)max_turns rounds, Devstral returns file paths + line rangesMODEL_SWE_1_6_FAST, configurable)rg (bundled via @vscode/ripgrep), readfile (Node.js fs), tree (tree-node-cli), ls (Node.js fs), glob (Node.js fs)| Package | Purpose |
|---|---|
@modelcontextprotocol/sdk | MCP server framework |
@vscode/ripgrep | Bundled ripgrep binary (cross-platform) |
tree-node-cli | Cross-platform directory tree (replaces system tree) |
better-sqlite3 | Read Windsurf's local SQLite DB |
zod | Schema validation (MCP SDK requirement) |
MIT
com.mcparmory/google-search
io.github.pipeworx-io/brave-search
marcopesani/mcp-server-serper
brave/brave-search-mcp-server
com.mcparmory/google-search-console
acamolese/google-search-console-mcp