Code-Index-MCP

by viperjuice

121 downloads
Not rated
GitHub

About

A local-first code indexer that enhances LLMs with deep code understanding. It integrates with AI assistants via the Model Context Protocol (MCP) and supports AI-powered semantic search.

Details

Author
viperjuice
Downloads
121
Categories
Developer Tools, Other, Knowledge Base, Search

- Local-first architecture for speed and privacy
- Plugin-based design for extensibility
- Multi-language support (Python, C/C++, JavaScript, Dart, HTML/CSS)
- Real-time file system monitoring for instant index updates
- AI-powered semantic search with Voyage AI embeddings
- Rich code intelligence: symbol resolution, type inference, dependency tracking

Clone the repository, create a Python virtual environment, install dependencies from requirements.txt, and start the server with uvicorn mcp_server.gateway:app --reload --host 0.0.0.0 --port 8000. Test the API using curl endpoints like /status and /search. Optionally configure via a .env file (e.g., VOYAGE_AI_API_KEY for semantic search). Docker deployment options are also provided.

Give your AI coding assistant instant, precise search across your whole codebase — so it finds the exact code it needs in milliseconds instead of burning time and tokens reading whole files.

Code-Index-MCP is a fast,local-firstsearch index for your code. It plugs into Claude Code and other AI assistants (through the Model Context Protocol, "MCP") and lets them look up any symbol or search any text in your repository almost instantly — without your code ever leaving your machine.

New to Code-Index-MCP?Start with theGetting Started Guide.

Status:v1.4.0 stable surface prepared — MCP tools (search_code,symbol_lookup) are the primary interface; a FastAPI admin gateway is available for diagnostics.

Stable-surface prep status: This guide targets the repo-owned1.4.0hardening release candidate. MCP STDIO remains the primary LLM surface and FastAPI remains a secondary admin surface. A July 10, 2026 collision check found no liveindex-it-mcp==1.4.0, so this guide uses source and local-wheel proof instead of claiming that the prepared1.4.0surface is published.

Version: 1.4.0 (repo-owned prepared surface; unpublished as of July 10, 2026)Python distribution:index-it-mcpContainer image:ghcr.io/consiliency/code-index-mcpPrimary surface: MCP tools (search_code,symbol_lookup) via the STDIO runner when repository readiness isreadySecondary surface: FastAPI admin REST gateway for diagnostics and scripting — see "Admin REST Interface (secondary)" belowCore features: local indexing, symbol/text search, registry-based language coverage; seedocs/SUPPORT_MATRIX.mdOptional features: semantic search (requires Voyage AI or a local vLLM endpoint), GitHub Artifacts index syncPerformance: sub-100ms symbol lookup and sub-500ms search on indexed repos (benchmarked on this codebase; results vary by repo size and language mix)GA decision: seedocs/validation/ga-final-decision.md; the current product decision isship GA, while install-surface claims remain bounded bydocs/status/public-package-identity.md.GA readiness contract: seedocs/validation/ga-readiness-checklist.mdfor the frozen release boundary, support-tier labels, evidence ownership, and rollback expectations that apply before dispatch.Release dispatch: the historical governance record names this boundaryGADISP; the current workflow implements it as a separatepublishmode restricted to protectedmain.Repository model: one server can serve many unrelated repositories, with one registered worktree per git common directory. Only the tracked/default branch is indexed automatically. Indexed MCP results are authoritative only when readiness isready; unavailable indexes returnindex_unavailablewithsafe_fallback: "native_search".

MCP_CLIENT_SECRETis a local STDIO handshake guard formcp-index stdio. The FastAPI gateway uses separate admin/debug bearer token authentication, and no remote MCP authorization is implemented while remote MCP transport remains deferred.

When an AI assistant works in a large codebase, it often reads big chunks of files just to find what it needs. That's slow, and every file it reads costs tokens (money). Code-Index-MCP builds a local index so the assistant can jump straight to the right function, class, or line —cutting token cost and making answers faster and more accurate.

Developers and teams using AI coding assistants on real, sizable codebases who wantfaster, cheaper, more accurateresults — and who want their code to stayprivate, on their own machine.

- ⚡ Instant lookups— sub-100ms symbol lookup, sub-500ms search on indexed repos.
- 🔒 Local-first & private— indexing runs on your machine; your code isn't shipped to a cloud.
- 💸 Lower token cost— the assistantsearchesinstead of reading whole files (see the charts below).
- 🧠 Semantic search (optional)— natural-language code search via embeddings.
- 🌐 Many languages, many repos— one server can index multiple repositories with mixed languages.
- 🔌 Plugin-based & extensible— add language support without touching the core.

Benchmarks in this repository show large token/cost reductions when an assistant searches with Code-Index-MCP instead of reading files directly:

(Charts generated from the benchmarks inreports/; numbers vary by repo size and language mix.)

- 🚀 Local-First Architecture: All indexing happens locally for speed and privacy
- 📂 Local Index Storage: All indexes stored at.indexes/(relative to MCP server)
- 🔌 Plugin-Based Design: Easily extensible with language-specific plugins
- 🔍 Language support: Tiered language/runtime support is documented in
[docs/SUPPORT_MATRIX.md
- ⚡ Real-Time Updates: File system monitoring for instant index updates
- 🧠 Semantic Search: AI-powered code search with Voyage AI embeddings
- 📊 Rich Code Intelligence: Symbol resolution, type inference, dependency tracking
- 🚀 Enhanced Performance: Sub-100ms queries with timeout protection and BM25 bypass
- 🔄 Git Synchronization: Automatic index updates tracking repository changes
- 📦 Portable Index Management: Zero-cost index sharing via GitHub Artifacts
- 🔄 Automatic Index Sync: Pull indexes on clone, push on changes
- 🎯 Smart Result Reranking: Multi-strategy reranking for improved relevance
- 🎯 Query-Intent Routing: Symbol-pattern queries (class Foo,def bar, CamelCase) bypass BM25 and hit the symbols table directly for sub-5ms lookups
- 🔒 Security-Aware Export: Automatic filtering of sensitive files from shared indexes
- 🔍 Hybrid Search: BM25 + semantic search with configurable fusion
- 🔐 Index Everything Locally: Search .env files and secrets on your machine
- 🚫 Smart Filtering on Share: .gitignore and .mcp-index-ignore patterns applied only during export
- 🌐 Multi-Language Indexing: Index entire repositories with mixed languages

The Code-Index-MCP follows a modular, plugin-based architecture designed for extensibility and performance:

- Developer interacts with Claude Code or other LLMs
- MCP protocol provides standardized tool interface
- Local-first processing with optional cloud features
- Performance SLAs: <100ms symbol lookup, <500ms search

┌─────────────────┐ ┌──────────────┐ ┌─────────────┐ │ API Gateway │────▶│ Dispatcher │────▶│ Plugins │ │ (FastAPI) │ │ │ │ (Language) │ └─────────────────┘ └──────────────┘ └─────────────┘ │ │ │ ▼ ▼ ▼ ┌─────────────────┐ ┌──────────────┐ ┌─────────────┐ │ Local Index │ │ File Watcher │ │ Embedding │ │ (SQLite+FTS5) │ │ (Watchdog) │ │ Service │ └─────────────────┘ └──────────────┘ └─────────────┘

- Gateway Controller: RESTful API endpoints
- Dispatcher Core: Plugin routing and lifecycle
- Plugin Base: Standard interface for all plugins
- Language Plugins: Specialized parsers and analyzers
- Index Manager: SQLite with FTS5 for fast searches
- Watcher Service: Real-time file monitoring

Code-Index-MCP implements defense-in-depth security hardening (Phase 15):

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.