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. This implementation allows developers to perform semantic code searches within their local projects directly from the Cursor IDE.
Clone the Repository:
shell
git clone <repository-url>
cd cursor-local-indexing
Create .env
File:
shell
cp .env.example .env
Configure .env
File:
dotenv
PROJECTS_ROOT=~/your/projects/root # Path to your projects directory
FOLDERS_TO_INDEX=project1,project2 # Comma-separated list of folders to index
Example:
dotenv
PROJECTS_ROOT=~/projects
FOLDERS_TO_INDEX=project1,project2
Start the Indexing Server:
shell
docker-compose up -d
Configure Cursor:
Create or edit ~/.cursor/mcp.json
:
json
{
"mcpServers": {
"workspace-code-search": {
"url": "http://localhost:8978/sse"
}
}
}
Restart Cursor IDE to apply the changes.
Open a Project:
Open a project that you configured as indexed.
Create .cursorrules
File:
Add the following instructions:
plaintext
For any request, use the @search_code tool to check what the code does.
Prefer that first before resorting to command line grepping etc.
Start Using Cursor Agent Mode:
Begin using the Cursor Agent mode and see it performing local vector searches!
This project provides ChromaDB-powered local indexing support for Cursor, exposed as an MCP server. It enables developers to perform semantic searches within their codebases directly from the Cursor IDE, enhancing productivity and code navigation.