Workspace Code Search MCP Server
游标的本地代码索引
一个基于 Python 的实验性服务器,使用 ChromaDB在本地索引代码库,并通过 MCP(模型上下文协议)服务器为 Cursor 等工具提供语义搜索工具。
设置
克隆并进入存储库:
git clone <repository-url> cd cursor-local-indexing通过复制
.env.example创建.env文件:cp .env.example .env配置你的
.env文件:PROJECTS_ROOT=~/your/projects/root # Path to your projects directory FOLDERS_TO_INDEX=project1,project2 # Comma-separated list of folders to index例子:
PROJECTS_ROOT=~/projects FOLDERS_TO_INDEX=project1,project2启动索引服务器:
docker-compose up -d配置 Cursor 以使用本地搜索服务器:创建或编辑
~/.cursor/mcp.json:{ "mcpServers": { "workspace-code-search": { "url": "http://localhost:8978/sse" } } }重新启动 Cursor IDE 以应用更改。
服务器将开始索引您指定的项目,并且当这些项目处于活动状态时,您将能够在 Cursor 中使用语义代码搜索。
打开您配置为索引的项目。
创建一个.cursorrules文件并添加以下内容:
<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>开始使用光标代理模式并查看它进行本地向量搜索!
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Versioned documentation registry and semantic search for AI tools and coding assistants.
Shared memory for coding agents. Stop re-explaining your codebase every session.
A search engine that learns from your grades. Store text, records, images or embeddings.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA local server that provides powerful code analysis and search capabilities for software projects, helping AI assistants and development tools understand codebases for tasks like code generation and refactoring.4-
- FlicenseNot gradedqualityCmaintenanceHTTP-based server that provides semantic code search capabilities to IDEs through the Model Context Protocol, allowing efficient codebase exploration without repeated indexing.121-
- AlicenseNot gradedqualityDmaintenanceA local code indexing and search library that enables AI agents to perform semantic and keyword searches across codebases using tree-sitter and SQLite. It provides tools for indexing projects and finding precise code definitions without requiring external APIs, Docker, or server infrastructure.1,841 npm350MIT
- AlicenseBqualityBmaintenanceSemantic search server for code and documentation using Qdrant vector database. Supports multi-language indexing, live updates, and natural language queries.141Apache 2.0