JSPM

  • Created
  • Published
  • Downloads 67
  • Score
    100M100P100Q56950F
  • License MIT

MCP server for AI-powered codebase indexing with auto-save checkpoints, incremental updates, real-time progress tracking, and index verification tools

Package Exports

  • @ngotaico/mcp-codebase-index
  • @ngotaico/mcp-codebase-index/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ngotaico/mcp-codebase-index) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

MCP Codebase Index Server

AI-powered semantic search for your codebase in GitHub Copilot

npm version License: MIT

A Model Context Protocol (MCP) server that enables GitHub Copilot to search and understand your codebase using Google's Gemini embeddings and Qdrant vector storage.


πŸ“š Quick Navigation

πŸš€ Getting Started

πŸ’» For Developers

πŸ”§ Resources


✨ Features

  • πŸ” Semantic Search - Find code by meaning, not just keywords
  • 🎯 Smart Chunking - Automatically splits code into logical functions/classes
  • πŸ”„ Incremental Indexing - Only re-indexes changed files (90%+ time savings)
  • πŸ’Ύ Auto-save Checkpoints - Saves progress every 10 files, resume anytime
  • πŸ“Š Real-time Progress - Track indexing with ETA and performance metrics
  • ⚑ Parallel Processing - 25x faster indexing with batch execution
  • πŸ”„ Real-time Watch - Auto-updates index on file changes
  • 🌐 Multi-language - Supports 15+ programming languages
  • ☁️ Vector Storage - Uses Qdrant for persistent storage
  • πŸ€– Prompt Enhancement - AI-powered query improvement (optional)
  • πŸ“¦ Simple Setup - Just 4 environment variables

πŸš€ Quick Start

Prerequisites

  1. Gemini API Key - Get free at Google AI Studio
  2. Qdrant Cloud Account - Sign up free at cloud.qdrant.io

Installation

Step 1: Open MCP Configuration in VS Code

  1. Open GitHub Copilot Chat (Ctrl+Alt+I / Cmd+Alt+I)
  2. Click Settings icon β†’ MCP Servers β†’ MCP Configuration (JSON)

Step 2: Add this configuration to mcp.json:

{
  "servers": {
    "codebase": {
      "command": "npx",
      "args": ["-y", "@ngotaico/mcp-codebase-index"],
      "env": {
        "REPO_PATH": "/absolute/path/to/your/project",
        "GEMINI_API_KEY": "AIzaSyC...",
        "QDRANT_URL": "https://your-cluster.gcp.cloud.qdrant.io:6333",
        "QDRANT_API_KEY": "eyJhbGci..."
      },
      "type": "stdio"
    }
  }
}

Step 3: Restart VS Code

The server will automatically:

  • Connect to Qdrant Cloud
  • Index your codebase
  • Watch for file changes

πŸ“– Detailed instructions: Setup Guide


πŸ“– Usage

Search Your Codebase

Ask GitHub Copilot:

"Find the authentication logic"
"Show me how database connections are handled"
"Where is error logging implemented?"

Check Indexing Status

"Check indexing status"
"Show me detailed indexing progress"

πŸ“– More examples: Testing Guide


🎯 Prompt Enhancement (Optional)

TL;DR: Prompt enhancement is a transparent background tool that automatically improves search quality. Just ask naturally - no need to mention "enhance" in your prompts.

Quick Overview

When enabled (PROMPT_ENHANCEMENT=true), the AI automatically:

  1. Enhances your search query with codebase context
  2. Searches with the improved query
  3. Continues with your original request (implement, fix, explain, etc.)

Good Prompts βœ…

βœ… "Find authentication logic and add 2FA support"
βœ… "Locate payment flow and fix the timeout issue"
βœ… "Search for profile feature and add bio field"

Why these work: Clear goal (find + action) β†’ AI knows what to do

Bad Prompts ❌

❌ "Enhance and search for authentication"
❌ "Use prompt enhancement to find profile"

Why these fail: No clear action β†’ AI stops after search

Key Principle

Prompt enhancement is invisible infrastructure.

Just tell the AI what you want to accomplish. It will automatically use enhancement to improve search quality behind the scenes.

Think of it like autocomplete: You don't say "use autocomplete" - you just type and it helps automatically.

πŸ“– Learn More

For detailed guide including:

  • Technical details and architecture
  • Configuration options
  • Real-world examples (TypeScript, Python, Dart, etc.)
  • Performance tips and optimization
  • Troubleshooting and FAQ
  • Advanced use cases

See: Prompt Enhancement Guide


πŸŽ›οΈ Configuration

Required Variables

{
  "env": {
    "REPO_PATH": "/Users/you/Projects/myapp",
    "GEMINI_API_KEY": "AIzaSyC...",
    "QDRANT_URL": "https://xxx.gcp.cloud.qdrant.io:6333",
    "QDRANT_API_KEY": "eyJhbGci..."
  }
}

Optional Variables

{
  "env": {
    "QDRANT_COLLECTION": "my_project",
    "WATCH_MODE": "true",
    "BATCH_SIZE": "50",
    "EMBEDDING_MODEL": "text-embedding-004",
    "PROMPT_ENHANCEMENT": "true"
  }
}

πŸ“– Full configuration guide: Setup Guide


🌍 Supported Languages

Python β€’ TypeScript β€’ JavaScript β€’ Dart β€’ Go β€’ Rust β€’ Java β€’ Kotlin β€’ Swift β€’ Ruby β€’ PHP β€’ C β€’ C++ β€’ C# β€’ Shell β€’ SQL β€’ HTML β€’ CSS


πŸ“Š Performance

Metric Value
Indexing Speed ~25 files/min
Search Latency <100ms
Incremental Savings 90%+ time reduction
Parallel Processing 25 chunks/sec

πŸ“– Performance details: Main Documentation


πŸ› Troubleshooting

Server not appearing?

  1. Check Copilot Chat β†’ Settings β†’ MCP Servers β†’ Show Output
  2. Verify all 4 env variables are set
  3. Ensure REPO_PATH is absolute path

Can't connect to Qdrant?

curl -H "api-key: YOUR_KEY" \
  https://YOUR_CLUSTER.gcp.cloud.qdrant.io:6333/collections

Indexing too slow?

  • Large repos take 5-10 minutes initially
  • Subsequent runs only index changed files (90%+ faster)

πŸ“– More troubleshooting: Main Documentation


πŸ“ Project Structure

mcp-codebase-index/
β”œβ”€β”€ docs/                    # All documentation
β”‚   β”œβ”€β”€ README.md           # Main documentation
β”‚   β”œβ”€β”€ SETUP.md            # Setup guide
β”‚   β”œβ”€β”€ NAVIGATION.md       # Navigation guide
β”‚   β”œβ”€β”€ guides/             # Detailed guides
β”‚   └── planning/           # Development planning
β”‚
β”œβ”€β”€ src/                     # Source code
β”‚   β”œβ”€β”€ core/               # Core business logic
β”‚   β”œβ”€β”€ storage/            # Data persistence
β”‚   β”œβ”€β”€ enhancement/        # Prompt enhancement
β”‚   β”œβ”€β”€ mcp/                # MCP server
β”‚   β”œβ”€β”€ types/              # Type definitions
β”‚   └── index.ts            # Entry point
β”‚
β”œβ”€β”€ config/                  # Configuration files
β”œβ”€β”€ .data/                   # Runtime data (gitignored)
β”œβ”€β”€ package.json
└── README.md               # This file

πŸ“– Detailed structure: Source Code Structure


πŸ”§ Development

Build

npm run build

Run Locally

npm run dev

Test

npm test

πŸ“– Development guide: Source Code Structure


🀝 Contributing

Contributions welcome! Check out:


πŸ“„ License

MIT Β© NgoTaiCo


πŸ“ž Support


⭐ If you find this useful, please star the repo!