Fast Context MCP
MCP server for AI-driven semantic code search over local codebases using natural language, with tunable search depth/rounds and automatic API key extraction.
fast_context_search: Perform natural-language queries (e.g., "where is auth handled") to find relevant files with line ranges and suggested grep keywords. Tune
tree_depth,max_turns,max_results, andexclude_pathsto balance speed vs. depth.extract_windsurf_key: Automatically extract a Windsurf API key from your local installation (macOS/Windows/Linux) and use it for search.
Auto-discovers API key from Devin/Windsurf installations or via
WINDSURF_API_KEYenv var; works with any MCP client (Claude Code, Cursor, etc.).Bundled tools (ripgrep, tree) require no system dependencies; cross-platform support.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Fast Context MCP where is the authentication and session logic located?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Fast Context MCP
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.
How It Works
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.*tokenRelated MCP server: code-rag
Prerequisites
Node.js >= 18
Windsurf account — free tier works (needed for API key)
No need to install ripgrep — it's bundled via @vscode/ripgrep.
Installation
Option 1: npm (Recommended)
# Latest stable release
npm install @sammysnake/fast-context-mcp
# Or beta/next release
npm install @sammysnake/fast-context-mcp@nextOption 2: From Source
git clone https://github.com/SammySnake-d/fast-context-mcp.git
cd fast-context-mcp
npm installSetup
1. Get Your Windsurf/Devin API Key
The server auto-extracts the API key from Devin CLI/Desktop or a legacy Windsurf installation. You can also use the extract_windsurf_key MCP tool after setup, or set WINDSURF_API_KEY manually.
Desktop credentials are discovered in this order: Devin, legacy Deviv, then Windsurf.
Platform | Path |
macOS |
|
Windows |
|
Linux |
|
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.
2. Configure MCP Client
Claude Code
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"
}
}
}Claude Desktop
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.
Environment Variables
Variable | Default | Description |
| (auto-discover) | Windsurf API key |
|
| Search rounds per query (more = deeper but slower) |
|
| Max parallel commands per round |
|
| Connect-Timeout-Ms for streaming requests |
|
| Hide |
|
| Max lines per command output (truncation) |
|
| Max characters per output line (truncation) |
| (unset) | Disable the in-memory result cache with |
|
| Result-cache TTL; |
|
| Maximum in-memory cache entries |
| (unset) | Set to |
|
| Windsurf model name |
|
| Windsurf app version (protocol metadata) |
|
| Windsurf language server version (protocol metadata) |
Available Models
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.
MCP Tools
fast_context_search
AI-driven semantic code search with tunable parameters.
Parameter | Type | Required | Default | Description |
| string | Yes | — | Natural language search query |
| string | No | cwd | Absolute path to project root |
| integer | No |
| 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. |
| integer | No |
| Search rounds (1-5). More = deeper search but slower. Use 1-2 for simple lookups, 3 for most queries, 4-5 for complex analysis. |
| integer | No |
| Maximum number of files to return (1-30). Smaller = more focused, larger = broader exploration. |
| string[] | No |
| Directory/file patterns excluded from the repository map and search context. |
Returns:
Relevant files with line ranges
Suggested search keywords (rg patterns used during AI search)
Diagnostic metadata (
[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=3Error 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_key
Extract 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.
Project Structure
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)
│ ├── path-safety.mjs # Project-root confinement for model-selected paths
│ ├── response-repair.mjs # Malformed response repair and evidence salvage
│ ├── shared.mjs # Repository map, answer parser, prompt builder
│ ├── cache.mjs # In-memory search-result cache
│ └── protobuf.mjs # Protobuf encoder/decoder + Connect-RPC frames
├── test/ # Unit and MCP stdio integration tests
├── README.md
└── LICENSEHow the Search Works
Project directory is mapped to virtual
/codebasepathDirectory tree generated at requested depth (default L=3), with automatic fallback to lower depth if tree exceeds 250KB
Query + directory tree sent to Windsurf's Devstral model via Connect-RPC/Protobuf
Devstral generates tool commands (ripgrep, file reads, tree, ls, glob)
Commands executed locally in parallel (up to
FC_MAX_COMMANDSper round)Results sent back to Devstral for the next round
After
max_turnsrounds, Devstral returns file paths + line rangesAll rg patterns used during search are collected as suggested keywords
Diagnostic metadata appended to help the calling AI tune parameters
Technical Details
Protocol: Connect-RPC over HTTP/1.1, Protobuf encoding, gzip compression
Model: Devstral (
MODEL_SWE_1_6_FAST, configurable)Local tools:
rg(bundled via @vscode/ripgrep),readfile(Node.js fs),tree(tree-node-cli),ls(Node.js fs),glob(Node.js fs)Auth: API Key → JWT (auto-fetched per session)
Runtime: Node.js >= 18 (ESM)
Dependencies
Package | Purpose |
| MCP server framework |
| Bundled ripgrep binary (cross-platform) |
| Cross-platform directory tree (replaces system |
| Read Devin/Windsurf's local SQLite DB without a native build step |
| Schema validation; avoids the incomplete |
友情链接
License
MIT
Available Tools
2 toolsextract_windsurf_keyA
Extract Windsurf API Key from local installation. Auto-detects OS (macOS/Windows/Linux) and reads the API key from Windsurf's local database. Set the result as WINDSURF_API_KEY env var.
Inputs: no named parameters.
fast_context_searchA
AI-driven semantic code search using Windsurf's Devstral model. Searches a codebase with natural language and returns relevant file paths with line ranges, plus suggested grep keywords for follow-up searches. Parameter tuning guide:
tree_depth: Controls how much directory structure the remote AI sees before searching. If you get a payload/size error, REDUCE this value. If search results are too shallow (missing files in deep subdirectories), INCREASE this value.
max_turns: Controls how many search-execute-feedback rounds the remote AI gets. If results are incomplete or the AI didn't find enough files, INCREASE this value. If you want a quick rough answer, use 1. Response includes a [config] line showing actual parameters used — use this to decide adjustments on retry.
Inputs: query (required), project_path, tree_depth, max_turns, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have completely distinct purposes: one extracts an API key from a local installation, the other performs semantic code search. No overlap or ambiguity exists.
Both tools use snake_case and follow a descriptive pattern (extract_* and fast_*). Although the verb style differs slightly (command vs. brand adjective), the naming is clear and consistent in format.
With only two tools, the server feels minimal. While the tools are focused, the count is on the low end of what is typically expected, making it borderline appropriate.
The server covers API key extraction and semantic search, but lacks related operations like API key management, file content retrieval, or result navigation. Significant gaps exist for a context-focused server.
Maintenance
Related MCP Connectors
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
An MCP server that gives your AI access to the source code and docs of all public github repos
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI-driven semantic code search using Windsurf's reverse-engineered SWE-grep protocol to query local codebases with natural language. It executes local search tools like ripgrep and tree-node-cli to return relevant file paths and line ranges to MCP-compatible clients.2131 npmMIT
- FlicenseNot gradedqualityCmaintenanceA semantic code search MCP server that enables natural language queries against your codebase, supporting features like related file discovery and context expansion, all running locally.2-
- AlicenseAqualityDmaintenanceLocal-first MCP server for semantic + keyword hybrid code search. Zero external services, no API keys required.2MIT
- AlicenseAqualityCmaintenanceSemantic code search MCP server that reduces token usage by ~95% by returning top relevant code chunks instead of full files.810MIT