ClaudeCodeMod

All shelves / MCP servers

Code Index

johnhuang316/code-index-mcp · 942 stars · Python · MIT

MCP server A Model Context Protocol (MCP) server that helps large language models index, search, and analyze code repositories with minimal setup

Install

In your shell
pip install code-index-mcp

These repos do not share one command. When an entry shows a command, it was copied as published. Check the repo's README before you run it.

Open the repo

Files

README.md

Code Index MCP

Intelligent code indexing and analysis for Large Language Models

Transform how AI understands your codebase with advanced search, analysis, and navigation capabilities.

Overview

Code Index MCP is a Model Context Protocol server that bridges the gap between AI models and complex codebases. It provides intelligent indexing, advanced search capabilities, and detailed code analysis to help AI assistants understand and navigate your projects effectively.

Perfect for: Code review, refactoring, documentation generation, debugging assistance, and architectural analysis.

Quick Start

🚀 Recommended Setup (Most Users)

The easiest way to get started with any MCP-compatible application:

Prerequisites: Python 3.10+ and uv

  1. Add to your MCP configuration (e.g., claude_desktop_config.json or ~/.claude.json):
   {
     "mcpServers": {
       "code-index": {
         "command": "uvx",
         "args": ["code-index-mcp"]
       }
     }
   }

Optional: append --project-path /absolute/path/to/repo to the args array so the server initializes with that repository automatically (equivalent to calling set_project_path after startup).

  1. Restart your application – uvx automatically handles installation and execution
  1. Start using (give these prompts to your AI assistant):
   Set the project path to /Users/dev/my-react-app
   Find all TypeScript files in this project  
   Search for "authentication" functions
   Analyze the main App.tsx file

If you launch with --project-path, you can skip the first command above - the server already knows the project location.

Codex CLI Configuration

If you are using Anthropic's Codex CLI, add the server to ~/.codex/config.toml. On Windows the file lives at C:\Users\<you>\.codex\config.toml:

[mcp_servers.code-index]
type = "stdio"
command = "uvx"
args = ["code-index-mcp"]

You can append --project-path C:/absolute/path/to/repo to the args list to set the project automatically on startup (same effect as running the set_project_path tool).

On Windows, uvx needs the standard profile directories to be present. Keep the environment override in the same block so the MCP starts reliably:

env = {
  HOME = "C:\\Users\\<you>",
  APPDATA = "C:\\Users\\<you>\\AppData\\Roaming",
  LOCALAPPDATA = "C:\\Users\\<you>\\AppData\\Local",
  SystemRoot = "C:\\Windows"
}

Linux and macOS already expose the required XDG paths and HOME, so you can usually omit the env table there. Add overrides only if you run the CLI inside a restricted container.

FastMCP & Discovery Manifests

  • Run fastmcp run fastmcp.json to launch the server via FastMCP with

the correct source entrypoint and dependency metadata. Pass --project-path (or call the set_project_path tool after startup) so the index boots against the right repository.

  • Serve or copy .well-known/mcp.json to share a standards-compliant MCP manifest. Clients that

support the .well-known convention (e.g., Claude Desktop, Codex CLI) can import this file directly instead of crafting configs manually.

  • Publish .well-known/mcp.llmfeed.json when you want to expose the richer LLM Feed metadata.

It references the same code-index server definition plus documentation/source links, which helps registries present descriptions, tags, and capabilities automatically.

When sharing the manifests, remind consumers to supply --project-path (or to call set_project_path) so the server indexes the intended repository.

Typical Use Cases

Code Review: "Find all places using the old API" Refactoring Help: "Where is this function called?" Learning Projects: "Show me the main components of this React project" Debugging: "Search for all error handling related code"

Key Features

🔍 Intelligent Search & Analysis

  • Dual-Strategy Architecture: Specialized tree-sitter parsing for 10 core languages, fallback strategy for 50+ file types
  • Direct Tree-sitter Integration: No regex fallbacks for specialized languages - fail fast with clear errors
  • Advanced Search: Auto-detects and uses the best available tool (ugrep, ripgrep, ag, or grep)
  • Universal File Support: Comprehensive coverage from advanced AST parsing to basic file indexing
  • File Analysis: Deep insights into structure, imports, classes, methods, and complexity metrics after running build_deep_index

🗂️ Multi-Language Support

  • 10 Languages with Tree-sitter AST Parsing: Python, JavaScript, TypeScript, Java, Kotlin, C#, Go, Objective-C, Zig, Rust
  • 50+ File Types with Fallback Strategy: C/C++, Ruby, PHP, and all other programming languages
  • Document & Config Files: Markdown, JSON, YAML, XML with appropriate handling
  • Web Frontend: Vue, React, Svelte, HTML, CSS, SCSS
  • Java Web & Build: JSP/Tag files (.jsp, .jspx, .jspf, .tag, .tagx), Grails/GSP (.gsp), Gradle & Groovy builds (.gradle, .groovy), .properties, and Protocol Buffers (.proto)
  • Database: SQL variants, NoSQL, stored procedures, migrations
  • Configuration: JSON, YAML, XML, Markdown
  • View complete list

⚡ Real-time Monitoring & Auto-refresh

  • File Watcher: Automatic index updates when files change
  • Cross-platform: Native OS file system monitoring
  • Smart Processing: Batches rapid changes to prevent excessive rebuilds
  • Shallow Index Refresh: Watches file changes and keeps the file list current; run a deep rebuild when you need symbol metadata

⚡ Performance & Efficiency

  • Tree-sitter AST Parsing: Native syntax parsing for accurate symbol extraction
  • Persistent Caching: Stores indexes for lightning-fast subsequent access
  • Smart Filtering: Intelligent exclusion of build directories and temporary files
  • Memory Efficient: Optimized for large codebases
  • Direct Dependencies: No fallback mechanisms - fail fast with clear error messages

Supported File Types

Languages with Specialized Tree-sitter Strategies:

  • Python (.py, .pyw) - Full AST analysis with class/method extraction and call tracking
  • JavaScript (.js, .jsx, .mjs, .cjs) - ES6+ class and function parsing with tree-sitter
  • TypeScript (.ts, .tsx) - Complete type-aware symbol extraction with interfaces
  • Java (.java) - Full class hierarchy, method signatures, and call relationships
  • Kotlin (.kt, .kts) - Package-aware symbol extraction with methods and call relationships
  • C# (.cs) - Namespace-aware type/member extraction with call relationships
  • Go (.go) - Struct methods, receiver types, and function analysis
  • Rust (.rs) - Functions, module-aware names, impl methods, structs/enums/traits, and basic call relationships
  • Objective-C (.m, .mm) - Class/instance method distinction with +/- notation
  • Zig (.zig, .zon) - Function and struct parsing with tree-sitter AST

All Other Programming Languages: All other programming languages use the FallbackParsingStrategy which provides basic file indexing and metadata extraction. This includes:

  • System & Low-Level: C/C++ (.c, .cpp, .h, .hpp)
  • Object-Oriented: Scala (.scala), Swift (.swift)
  • Scripting & Dynamic: Ruby (.rb), PHP (.php), Shell (.sh, .bash)
  • And 40+ more file types - All handled through the fallback strategy for basic indexing

Frameworks & Libraries:

  • Vue (.vue)
  • Svelte (.svelte)
  • Astro (.astro)

Styling:

  • CSS (.css, .scss, .less, .sass, .stylus, .styl)
  • HTML (.html)

Templates:

  • Handlebars (.hbs, .handlebars)
  • EJS (.ejs)
  • Pug (.pug)
  • FreeMarker (.ftl)
  • Mustache (.mustache)
  • Liquid (.liquid)
  • ERB (.erb)

SQL Variants:

  • Standard SQL (.sql, .ddl, .dml)
  • Database-specific (.mysql, .postgresql, .psql, .sqlite, .mssql, .oracle, .ora, .db2)

Database Objects:

  • Procedures & Functions (.proc, .procedure, .func, .function)
  • Views & Triggers (.view, .trigger, .index)

Migration & Tools:

  • Migration files (.migration, .seed, .fixture, .schema)
  • Tool-specific (.liquibase, .flyway)

NoSQL & Modern:

Facts

Kind
MCP server
Repo
johnhuang316/code-index-mcp
Group
Uncategorized
Stars
942
License
MIT
Language
Python
Last push
2026-07-27
Forks
121

More on this shelf

  1. 1Everythingmodelcontextprotocol/serversThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.85.8k
  2. 2Fetchmodelcontextprotocol/serversA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.85.8k
  3. 3Gitmodelcontextprotocol/serversA Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.85.8k
  4. 4Memorymodelcontextprotocol/serversA basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.85.8k
  5. 5Sequential Thinkingmodelcontextprotocol/serversAn MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process.85.8k
  6. 6Timemodelcontextprotocol/serversA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.85.8k