$ show johnhuang316/code-index-mcp
The code-index-mcp repository implements a Model Context Protocol (MCP) server that provides code indexing and analysis capabilities for Large Language Models (LLMs). It enables AI assistants to query codebases for symbol definitions, call relationships, file contents, and project metadata through a standardized MCP interface. The system features a three-layer architecture separating technical tools (file system, search, monitoring), business services (code intelligence, index management, project management), and MCP entry points. It supports shallow indexing (file discovery) and deep indexing (symbol extraction via tree-sitter AST parsers) for over 10 programming languages, with SQLite persistence for indexes and real-time file watching for automatic updates. The application is designed for integration with MCP-compatible clients like Claude Desktop and Codex CLI.
The LLM identified 4 files worth highlighting for reuse:
Implements a robust file filtering system that combines .gitignore patterns, custom excludes, and glob matching. Provides efficient path matching with caching and supports complex exclusion rules. This utility is self-contained and can be extracted for use in any file processing application requiring ignore pattern handling.
Provides standardized functions for formatting MCP (Model Context Protocol) responses, including success responses and error responses with proper error codes. This isolated utility ensures consistent response formatting across all MCP tools and services, making it reusable in any MCP server implementation.
Defines the base interface for all language-specific parsing strategies, requiring implementations for symbol extraction and call relationship analysis. This abstract base class enables the strategy pattern for adding new language parsers without modifying core indexing logic, demonstrating a clean extensibility pattern.
Manages per-project instances of services and index managers using a cache keyed by project path. Provides thread-safe access to project-specific resources and automatic cleanup. This isolated component solves the common problem of multi-tenant resource management and can be reused in any application requiring per-context service instances.