Local Code Indexing for Cursor
A Python-based server that locally indexes codebases using ChromaDB to provide semantic search for tools like Cursor.
Local Code Indexing for Cursor
An experimental Python-based server that locally indexes codebases using ChromaDB and provides a semantic search tool via an MCP (Model Context Protocol) server for tools like Cursor.
Setup
-
Clone and enter the repository:
git clone <repository-url> cd cursor-local-indexing
-
Create a
.env
file by copying.env.example
:cp .env.example .env
-
Configure your
.env
file:PROJECTS_ROOT=~/your/projects/root # Path to your projects directory FOLDERS_TO_INDEX=project1,project2 # Comma-separated list of folders to index
Example:
PROJECTS_ROOT=~/projects FOLDERS_TO_INDEX=project1,project2
-
Start the indexing server:
docker-compose up -d
-
Configure Cursor to use the local search server: Create or edit
~/.cursor/mcp.json
:{ "mcpServers": { "workspace-code-search": { "url": "http://localhost:8978/sse" } } }
-
Restart Cursor IDE to apply the changes.
The server will start indexing your specified projects, and you'll be able to use semantic code search within Cursor when those projects are active.
- Open a project that you configured as indexed.
Create a .cursorrules
file and add the following:
<instructions>
For any request, use the @search_code tool to check what the code does.
Prefer that first before resorting to command line grepping etc.
</instructions>
- Start using the Cursor Agent mode and see it doing local vector searches!
Related Servers
MCP RAG Server
A Python server providing Retrieval-Augmented Generation (RAG) functionality. It indexes various document formats and requires a PostgreSQL database with pgvector.
MCPCLIHost
A CLI host that allows Large Language Models (LLMs) to interact with external tools using the Model Context Protocol (MCP).
MCP Design System Extractor
Extracts component information, including HTML, styles, and metadata, from Storybook design systems.
Replicate Imagen 4 MCP Server
Access Google's Imagen 4 Ultra model via the Replicate platform for high-quality image generation.
DIY MCP
A from-scratch implementation of the Model Context Protocol (MCP) for building servers and clients, using a Chinese tea collection as an example.
MCPSwift
A Swift framework for building Model Context Protocol (MCP) servers with a simplified API.
MCP Server with GitHub OAuth
An MCP server with built-in GitHub OAuth support, designed for deployment on Cloudflare Workers.
Knowledge Graph Memory Server
Enables persistent memory for Claude using a local knowledge graph of entities, relations, and observations.
MCP Server
A backend service providing tools, resources, and prompts for AI models using the Model Context Protocol (MCP).
MCP Experiments
An experimental dotnet MCP server that returns the current time, based on Laurent Kempé's tutorial.