cursor-local-indexing
by: LuotoCompany
ChromaDB-powered local indexing support for Cursor, exposed as an MCP server
📌Overview
Purpose: The framework aims to enable local indexing of codebases for enhanced semantic search capabilities in development environments using Cursor.
Overview: This Python-based server utilizes ChromaDB to locally index codebases, facilitating a powerful semantic search tool via an MCP (Model Context Protocol) server. It integrates seamlessly with tools like Cursor, providing developers with the means to efficiently find and utilize code snippets within their projects.
Key Features:
-
Local Code Indexing: The server indexes specified code directories, allowing for quick and context-aware code searches that improve development speed and accuracy.
-
Semantic Search Tool: By implementing an MCP server, the framework enables advanced search functionalities that understand the context of code, making it easier to retrieve relevant snippets.
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.
-
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 performing local vector searches!