Logo MCP Codebase Index

MCP Codebase Index

Cộng đồng
NgoTaiCo

AI-powered semantic search for your codebase in GitHub Copilot, Kiro, and other MCP-compatible editors

Nhà phát hànhNgoTaiCo
Kho mãmcp-codebase-index
Ngôn ngữTypeScript
Bản fork
2
Sao
20
Công cụ có sẵn
1
Phương thức truyền tảistdio
Danh mục
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    MCP Codebase Index cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 1 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    20 sao và 2 bản fork từ kho mã được liên kết.

MCP Codebase Index Server

AI-powered semantic search for your codebase in GitHub Copilot, Kiro, and other MCP-compatible editors

npm version License: MIT

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

Supported Editors:

  • ✅ VS Code with GitHub Copilot
  • ✅ VS Code with Roo Cline
  • ✅ GitHub Copilot CLI
  • ✅ Google Gemini CLI
  • ✅ Kiro AI Editor
  • ✅ Any MCP-compatible editor

📚 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)
  • � Vector Visualization - 2D/3D UMAP visualization of your codebase
  • 🏗️ Modular Architecture - Clean handler separation for maintainability
  • �📦 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

Choose your environment:

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:

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:


📖 Usage

Search Your Codebase

Ask GitHub Copilot:

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

Visualize Your Codebase

Ask GitHub Copilot:

"Visualize my codebase"
"Show me how my code is organized"
"Visualize authentication code"

📖 Complete guide: Vector Visualization Guide

Check Indexing Status

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

📖 More examples: Testing Guide

📊 Vector Visualization

See your codebase in 2D/3D space - Understand semantic relationships and code organization visually.

What is Vector Visualization?

Vector visualization transforms your codebase's 768-dimensional embeddings into interactive 2D or 3D visualizations using UMAP dimensionality reduction. This allows you to:

  • 🎨 Explore semantic relationships - Similar code clusters together
  • 🔍 Understand architecture - See your codebase structure at a glance
  • 🎯 Debug search results - Visualize why certain code was retrieved
  • 📈 Track code organization - Identify modules, patterns, and outliers

Quick Start

Visualize entire codebase:

User: "Visualize my codebase"

Result: Interactive clusters showing:
- API Controllers & Routes (28%)
- Database Models (23%)
- Authentication (19%)
- Business Logic (18%)
- Test Suites (12%)

Export as HTML:

User: "Export visualization as HTML"

Result: Standalone HTML file with:
- Interactive hover, zoom, pan
- Click clusters to highlight
- Modern gradient UI
- Works offline

Understanding the Visualization

Colors and Clusters:

  • Each color represents a semantic cluster (module/functionality)
  • Points close together = similar in meaning
  • Distance reflects semantic similarity
  • Outliers indicate unique/specialized code

Common Cluster Patterns:

  • Blue: Frontend/UI components
  • Orange: API endpoints and routes
  • Green: Database models and queries
  • Red: Authentication and security
  • Purple: Tests and validation
  • Gray: Utilities and helpers

Use Cases

  1. 🏗️ Architecture Understanding

    • Visualize to see module boundaries
    • Identify tightly coupled code
    • Find opportunities for refactoring
  2. 🔍 Code Discovery

    • Locate related functionality visually
    • Find all code touching a feature
    • Discover cross-cutting concerns
  3. 🐛 Search Debugging

    • Understand why results were retrieved
    • See semantic relationships
    • Refine queries based on visualization
  4. 👥 Team Onboarding

    • Export HTML for new developers
    • Visual guide to codebase structure
    • Interactive exploration tool
  5. ✅ Refactoring Validation

    • Visualize before/after refactoring
    • Verify improved code organization
    • Track architecture evolution

Performance

Collection SizeProcessing TimeRecommended maxVectors
Small (<500 vectors)~1s500
Medium (500-2K)~4s1000
Large (2K-10K)~15s2000
Very Large (>10K)~30s3000

Tips:

  • Use 2D for faster processing (40% faster than 3D)
  • Limit maxVectors for large codebases
  • Export HTML for offline exploration

📖 Learn More

For detailed documentation including:

  • Complete tool reference
  • Interpretation guide
  • Technical details (UMAP, clustering)
  • Troubleshooting
  • Best practices
  • Advanced use cases

See: Vector Visualization 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

json
{
  "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

json
{
  "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

MetricValue
Indexing Speed~25 files/min
Search Latency<100ms
Incremental Savings90%+ time reduction
Parallel Processing25 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?

bash
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
│   ├── CHANGELOG.md        # Version history
│   ├── NAVIGATION.md       # Navigation guide
│   ├── guides/             # Detailed guides
│   └── planning/           # Development planning
│
├── src/                     # Source code
│   ├── core/               # Core business logic
│   ├── storage/            # Data persistence
│   ├── enhancement/        # Prompt enhancement
│   ├── visualization/      # Vector visualization
│   ├── mcp/                # MCP server
│   │   ├── server.ts      # Server orchestration (1237 lines)
│   │   ├── handlers/      # Modular handlers (1045 lines)
│   │   ├── templates/     # HTML templates
│   │   └── types/         # Handler types
│   ├── types/              # Type definitions
│   └── index.ts            # Entry point
│
├── config/                  # Configuration files
├── .data/                   # Runtime data (gitignored)
├── package.json
└── README.md               # This file

📖 Detailed structure: Project Structure | Source Code Structure


🔧 Development

Build

bash
npm run build

Run Locally

bash
npm run dev

Test

bash
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!

Cài đặt

TypingMind
{
  "mcpServers": {
    "mcp-codebase-index": {
      "command": "npx",
      "args": [
        "-y",
        "@ngotaico/mcp-codebase-index"
      ],
      "env": {
        "REPO_PATH": "<REPO_PATH>",
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}

Công cụ có sẵn

  • search_codebase

    Search your codebase using natural language queries. Returns relevant code snippets with file paths and line numbers.

Dùng MCP MCP Codebase Index với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối MCP Codebase Index, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm MCP Codebase Index làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của MCP Codebase Index.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "mcp-codebase-index": {
      "command": "npx",
      "args": [
        "-y",
        "@ngotaico/mcp-codebase-index"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của MCP Codebase Index, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của MCP Codebase Index.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng MCP Codebase Index giúp tôi làm việc này không?
MCP Codebase Index
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng MCP Codebase Index.

Câu hỏi thường gặp

Máy chủ MCP MCP Codebase Index dùng để làm gì?

MCP Codebase Index là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP MCP Codebase Index với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng MCP Codebase Index với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP MCP Codebase Index với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối MCP Codebase Index, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP MCP Codebase Index với TypingMind?

MCP Codebase Index hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP MCP Codebase Index cung cấp những công cụ nào trong TypingMind?

MCP Codebase Index cung cấp 1 công cụ MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP MCP Codebase Index không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu MCP Codebase Index yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Codebase Index Status

Collection: codebase (0 vectors)

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇