Fast Context MCP logo

Fast Context MCP

Community
SammySnake-d

AI-driven semantic code search as an MCP tool — powered by Windsurf's reverse-engineered SWE-grep protocol

PublisherSammySnake-d
Repositoryfast-context-mcp
LanguageJavaScript
Forks
53
Stars
362
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Fast Context MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    362 stars and 53 forks from the linked repository.

Fast Context MCP

npm version node version license MCPVault: claimed

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.*token

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)

bash
# Latest stable release
npm install @sammysnake/fast-context-mcp

# Or beta/next release
npm install @sammysnake/fast-context-mcp@next

Option 2: From Source

bash
git clone https://github.com/SammySnake-d/fast-context-mcp.git
cd fast-context-mcp
npm install

Setup

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.

PlatformPath
macOS~/Library/Application Support/Devin/User/globalStorage/state.vscdb
Windows%APPDATA%/Devin/User/globalStorage/state.vscdb
Linux~/.config/Devin/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.

2. Configure MCP Client

Claude Code

Add to ~/.claude.json under mcpServers:

json
{
  "fast-context": {
    "command": "npx",
    "args": ["-y", "--prefer-online", "@sammysnake/fast-context-mcp"],
    "env": {
      "WINDSURF_API_KEY": "sk-ws-01-xxxxx"
    }
  }
}

For beta/next release:

json
{
  "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:

json
{
  "fast-context": {
    "command": "npx",
    "args": ["-y", "--prefer-online", "@sammysnake/fast-context-mcp"],
    "env": {
      "WINDSURF_API_KEY": "sk-ws-01-xxxxx"
    }
  }
}

For beta/next release:

json
{
  "fast-context": {
    "command": "npx",
    "args": ["-y", "--prefer-online", "@sammysnake/fast-context-mcp@next"],
    "env": {
      "WINDSURF_API_KEY": "sk-ws-01-xxxxx"
    }
  }
}

If WINDSURF_API_KEY is omitted, the server auto-discovers it from your local Windsurf installation.

Environment Variables

VariableDefaultDescription
WINDSURF_API_KEY(auto-discover)Windsurf API key
FC_MAX_TURNS3Search rounds per query (more = deeper but slower)
FC_MAX_COMMANDS8Max parallel commands per round
FC_TIMEOUT_MS30000Connect-Timeout-Ms for streaming requests
FC_HIDE_EXTRACT_WINDSURF_KEY_TOOLfalseHide extract_windsurf_key from MCP tools when set to 1, true, yes, or on
FC_RESULT_MAX_LINES50Max lines per command output (truncation)
FC_LINE_MAX_CHARS250Max characters per output line (truncation)
FC_CACHE_DISABLED(unset)Disable the in-memory result cache with 1, true, yes, or on
FC_CACHE_TTL_MS300000Result-cache TTL; <=0 disables caching
FC_CACHE_MAX_ENTRIES200Maximum in-memory cache entries
FC_ALLOW_INSECURE_TLS(unset)Set to 1 only when a trusted corporate proxy requires disabled TLS verification
WS_MODELMODEL_SWE_1_6_FASTWindsurf model name
WS_APP_VER1.48.2Windsurf app version (protocol metadata)
WS_LS_VER1.9544.35Windsurf language server version (protocol metadata)

Available Models

The model can be changed by setting WS_MODEL (see environment variables above).

Available Models

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.

ParameterTypeRequiredDefaultDescription
querystringYes—Natural language search query
project_pathstringNocwdAbsolute path to project root
tree_depthintegerNo3Directory 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_turnsintegerNo3Search rounds (1-5). More = deeper search but slower. Use 1-2 for simple lookups, 3 for most queries, 4-5 for complex analysis.
max_resultsintegerNo10Maximum number of files to return (1-30). Smaller = more focused, larger = broader exploration.
exclude_pathsstring[]No[]Directory/file patterns excluded from the repository map and search context.

Returns:

  1. Relevant files with line ranges
  2. Suggested search keywords (rg patterns used during AI search)
  3. 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=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_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
└── LICENSE

How the Search Works

  1. Project directory is mapped to virtual /codebase path
  2. Directory tree generated at requested depth (default L=3), with automatic fallback to lower depth if tree exceeds 250KB
  3. Query + directory tree sent to Windsurf's Devstral model via Connect-RPC/Protobuf
  4. Devstral generates tool commands (ripgrep, file reads, tree, ls, glob)
  5. Commands executed locally in parallel (up to FC_MAX_COMMANDS per round)
  6. Results sent back to Devstral for the next round
  7. After max_turns rounds, Devstral returns file paths + line ranges
  8. All rg patterns used during search are collected as suggested keywords
  9. 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

PackagePurpose
@modelcontextprotocol/sdkMCP server framework
@vscode/ripgrepBundled ripgrep binary (cross-platform)
tree-node-cliCross-platform directory tree (replaces system tree)
sql.jsRead Devin/Windsurf's local SQLite DB without a native build step
zod (^3.25.76)Schema validation; avoids the incomplete 3.25.0 tarball served by some npm mirrors

友情链接

License

MIT

Installation

TypingMind
{
  "mcpServers": {
    "fast-context-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/fast-context-mcp",
        "run",
        "server.py"
      ]
    }
  }
}

Use Fast Context MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Fast Context MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Fast Context MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Fast Context MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "fast-context-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Fast Context MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Fast Context MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Fast Context MCP to help me with this task?
Fast Context MCP
Sure. I read it.
Here is what I found using Fast Context MCP.

Frequently asked questions

What is the Fast Context MCP MCP server used for?

Fast Context MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Fast Context MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Fast Context MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Fast Context MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Fast Context MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Fast Context MCP MCP to TypingMind?

Fast Context MCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Fast Context MCP MCP provide in TypingMind?

Fast Context MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Fast Context MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Fast Context MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇