code-index
A Model Context Protocol (MCP) server that helps large language models index, search, and analyze code repositories with minimal setup
claude mcp add --transport stdio johnhuang316-code-index-mcp uvx code-index-mcp
How to use
Code Index MCP provides intelligent indexing and analysis of a codebase to help AI assistants understand and navigate large projects. It uses a combination of tree-sitter based parsing for key languages and a broad fallback strategy to cover hundreds of file types, enabling precise symbol extraction, code navigation, and quick search across the repository. After starting, you can prompt your AI assistant to set a project path, locate usage of specific functions, or analyze components and imports across the codebase.
To use it, add the server to your MCP configuration (as shown in the Quick Start) and start the server with uvx. You can then issue natural language prompts or structured commands to explore code structure, find references, or perform architectural analysis. For example you can ask the AI to find all occurrences of a deprecated API, list top collaborators by module, or summarize the main components of a frontend project. If you provide a --project-path on startup, the server will index that repository automatically and you can skip the initial set_project_path step.
The server supports real-time indexing updates, so changes to the repository trigger incremental rebuilds, ensuring your AI has up-to-date information for tasks like code reviews, refactoring, and debugging assistance.
How to install
Prerequisites
- Python 3.10 or newer
- Access to install Python packages (pip)
- Optional: uv (requirements for the MCP server) if you don’t have it yet
Installation steps
- Install Python 3.10+ from https://www.python.org/downloads/
- Install uv (the MCP runtime) using pip: pip install uv
- Ensure you can run the MCP server binary from your environment. The Code Index MCP exposes an entrypoint named code-index-mcp via the uvx launcher. If you’re using a virtual environment, activate it first.
- Start the server (see Quick Start for exact command): uvx code-index-mcp
- Verify the server is reachable through your MCP client configuration by testing a simple prompt like: Set the project path to /path/to/your/repo and run a basic search.
Additional notes
Tips and common questions:
- You can specify --project-path when starting the server to auto-initialize with a repository path. This is equivalent to calling set_project_path after startup.
- For Codex CLI users, you can add the server configuration under mcp_servers.code-index with type = "stdio" and command = "uvx" in config.toml.
- The server uses a dual-strategy parser: tree-sitter for core languages and a fallback for other file types. Expect fast initial indexing, followed by deeper symbol metadata extraction after a build_deep_index run.
- To share manifests, publish the .well-known/mcp.json and .well-known/mcp.llmfeed.json files for discovery by clients.
- If you encounter environment path issues on Windows, ensure the HOME, APPDATA, LOCALAPPDATA, and SystemRoot values are set in the config.toml env block as described in the README.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP