project-index-mcp

nasiridrishi/project-index-mcp

3.1

If you are the rightful owner of project-index-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

Project Index is a semantic code search server that integrates with MCP-compatible AI assistants to provide natural language code search capabilities.

Project Index - Semantic Code Search MCP Server

🔍 Natural language code search for AI coding assistants via Model Context Protocol

License: MIT Python 3.10+

Search your codebase using natural language queries through any MCP-compatible AI assistant (Claude Desktop, Cline, etc.). Combines keyword search (BM25) with semantic search (vector embeddings) for accurate results.


Features

  • Hybrid Search: BM25 keyword + vector embeddings with smart fusion
  • Intelligent Ranking: Boosts exact matches, primary definitions, and implementation files over tests
  • Query Expansion: Automatically adds programming synonyms to improve results
  • Smart Chunking: Adaptive chunk sizes (600-1500 chars) based on file type
  • Rich Metadata: Extracts packages, imports, classes, methods, annotations
  • File Classification: Auto-categorizes as implementation, test, documentation, or config
  • Local & Private: All data stored locally, no external services except OpenAI embeddings

Installation

Prerequisites

  • Python 3.10+
  • OpenAI API key

Setup

# Clone and install
git clone https://github.com/yourusername/project-index.git
cd project-index
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

# Create .env file with your API key
echo "OPENAI_API_KEY=sk-your-key-here" > .env

Configure MCP Client

Add to your MCP client config (e.g., Claude Desktop's claude_desktop_config.json):

{
  "mcpServers": {
    "project-index": {
      "command": "/absolute/path/to/project-index/venv/bin/python3",
      "args": ["/absolute/path/to/project-index/mcp_server.py"]
    }
  }
}

Note: The server needs OPENAI_API_KEY from in .env file. Use absolute paths in the config. On Windows, use python.exe and escape backslashes.

Restart your MCP client to load the server.


Usage

Your AI assistant can now use these tools:

Index a Codebase

You: "Index this project"
AI: [calls index_codebase tool]

Search Code

You: "Find the NotificationService class"
AI: [calls search_code with intelligent ranking]

You: "Search for email sending implementation"
AI: [uses hybrid search with query expansion]

You: "Show me authentication tests"
AI: [boosts test files in results]

Performance

Speed

  • Small project (100 files): ~30 seconds
  • Medium project (1000 files): ~5 minutes
  • Large project (10000 files): ~30 minutes

Indexing time depends on OpenAI API rate limits

Accuracy

  • Validation score: 96/100
  • Implementation files correctly ranked above tests
  • Exact filename matches strongly boosted
  • Smart deduplication at file level

Storage

Data stored in ~/.project_indexes/ (Windows: %USERPROFILE%\.project_indexes\):

  • ChromaDB for vector embeddings
  • SQLite for BM25 keyword index

Supported Languages

Python, JavaScript, TypeScript, Java, Go, Rust, C/C++, C#, Kotlin, Ruby, PHP, Swift, and configuration files.


License

MIT License