Skip to main content
Glama
Fast Context MCP

Fast Context MCP

by meimingqi222

Fast Context MCP

AI-driven semantic code search via reverse-engineered Windsurf protocol (Python implementation).

Python License: MIT MCP

Overview

Fast Context MCP provides an AI-powered semantic code search tool through the Model Context Protocol (MCP). It leverages a reverse-engineered Windsurf protocol to deliver intelligent code context retrieval for LLMs and development workflows.

Related MCP server: Cortex

Features

  • AI-Powered Semantic Search: Natural language queries to find relevant code

  • MCP Server Integration: Compatible with MCP-enabled clients (Claude Desktop, etc.)

  • Protobuf Protocol: Efficient binary communication with Windsurf API

  • Tree-based Context: Includes directory structure for better code understanding

  • Multi-language Support: Works with any codebase (Python, JavaScript, Go, etc.)

Installation

pip install fast-context-mcp

From Source

git clone https://github.com/YOUR_USERNAME/fast-context-mcp-py.git
cd fast-context-mcp-py
pip install -e .

Usage

As an MCP Server

Add to your Claude Desktop configuration (claude_desktop_config.json):

{
  "mcpServers": {
    "fast-context": {
      "command": "python",
      "args": ["-m", "fast_context_mcp.server"]
    }
  }
}

Programmatic Usage

from fast_context_mcp.search import search_with_content

result = search_with_content(
    query="Find the authentication middleware",
    project_root="/path/to/your/project"
)
print(result)

Available Tools

search_code

Search for relevant code in a codebase using AI-powered semantic search.

Parameters:

  • query (string): Natural language description of what you're looking for

  • project_root (string): Absolute path to the project root directory

Returns: JSON-formatted search results with relevant file paths and line ranges.

Architecture

fast_context_mcp/
├── core.py        # Core search implementation & API communication
├── search.py      # Search orchestration and result formatting
├── server.py      # MCP server implementation
├── protobuf.py    # Protobuf encoding/decoding
├── executor.py    # Tool execution with context management
└── rg_installer.py # Ripgrep auto-installer

Protocol Details

The project implements a reverse-engineered version of Windsurf's internal protocol:

  1. Connect Frame: Binary protobuf handshake with magic bytes (0x0001)

  2. Session Management: UUID-based session tracking

  3. Tool Definitions: JSON Schema-based tool specifications

  4. Response Streaming: Chunked protobuf responses with gzip compression

Development

Setup

# Install development dependencies
pip install -e ".[dev]"

Running Tests

pytest

Linting

ruff check .
ruff format .

License

MIT License - see LICENSE file for details.

Acknowledgments

Disclaimer

This project is a reverse-engineered implementation for educational purposes. It is not affiliated with or endorsed by Codeium/Windsurf.

Available Tools

1 tool
search_codeB

Search for relevant code in a codebase using AI-powered semantic search.

Args: query: Natural language description of what you're looking for. project_root: Absolute path to the project root directory.

Inputs: query (required), project_root (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 1 tool

    Disambiguation5/5

    Only one tool exists, so there is no possibility of confusion with any other tool in this server.

    Naming Consistency5/5

    The single tool name 'search_code' follows a clear verb_noun convention, though consistency across a set cannot be meaningfully evaluated with one tool.

    Tool Count2/5

    A single tool for an entire MCP server is thin; even for a narrow semantic search service, users would likely expect at least indexing or context-management operations.

    Completeness2/5

    The surface is severely limited: there is no indexing, no result retrieval beyond search, no configuration, and no way to manage or refresh the codebase context.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables semantic search over codebases using natural language queries, returning relevant code snippets with source locations. Integrates with Claude Code for automatic codebase exploration.
      1
      31 PyPI
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI coding assistants to semantically search and retrieve relevant code patterns, documentation, and implementations from a codebase via MCP tools.
      8
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables semantic code search across indexed codebases using natural language queries, with support for CLI and MCP interfaces.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables semantic code search across repositories via MCP, returning exact source excerpts with paths and line numbers.
      40 npm
      114
      MIT