
Code Index
STDIOMCP server for code indexing, searching, and analysis across repositories
MCP server for code indexing, searching, and analysis across repositories
Intelligent code indexing and analysis for Large Language Models
Transform how AI understands your codebase with advanced search, analysis, and navigation capabilities.
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.
The easiest way to get started with any MCP-compatible application:
Prerequisites: Python 3.10+ and uv
Add to your MCP configuration (e.g., claude_desktop_config.json
or ~/.claude.json
):
{ "mcpServers": { "code-index": { "command": "uvx", "args": ["code-index-mcp"] } } }
Restart your application – uvx
automatically handles installation and execution
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
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"
Languages with Specialized Tree-sitter Strategies:
.py
, .pyw
) - Full AST analysis with class/method extraction and call tracking.js
, .jsx
, .mjs
, .cjs
) - ES6+ class and function parsing with tree-sitter.ts
, .tsx
) - Complete type-aware symbol extraction with interfaces.java
) - Full class hierarchy, method signatures, and call relationships.go
) - Struct methods, receiver types, and function analysis.m
, .mm
) - Class/instance method distinction with +/- notation.zig
, .zon
) - Function and struct parsing with tree-sitter ASTAll Other Programming Languages: All other programming languages use the FallbackParsingStrategy which provides basic file indexing and metadata extraction. This includes:
.c
, .cpp
, .h
, .hpp
), Rust (.rs
).cs
), Kotlin (.kt
), Scala (.scala
), Swift (.swift
).rb
), PHP (.php
), Shell (.sh
, .bash
)Frameworks & Libraries:
.vue
).svelte
).astro
)Styling:
.css
, .scss
, .less
, .sass
, .stylus
, .styl
).html
)Templates:
.hbs
, .handlebars
).ejs
).pug
)SQL Variants:
.sql
, .ddl
, .dml
).mysql
, .postgresql
, .psql
, .sqlite
, .mssql
, .oracle
, .ora
, .db2
)Database Objects:
.proc
, .procedure
, .func
, .function
).view
, .trigger
, .index
)Migration & Tools:
.migration
, .seed
, .fixture
, .schema
).liquibase
, .flyway
)NoSQL & Modern:
.cql
, .cypher
, .sparql
, .gql
).md
, .mdx
).json
, .xml
, .yml
, .yaml
)For contributing or local development:
Clone and install:
git clone https://github.com/johnhuang316/code-index-mcp.git cd code-index-mcp uv sync
Configure for local development:
{ "mcpServers": { "code-index": { "command": "uv", "args": ["run", "code-index-mcp"] } } }
Debug with MCP Inspector:
npx @modelcontextprotocol/inspector uv run code-index-mcp
If you prefer traditional pip management:
pip install code-index-mcp
Then configure:
{ "mcpServers": { "code-index": { "command": "code-index-mcp", "args": [] } } }
Tool | Description |
---|---|
set_project_path | Initialize indexing for a project directory |
refresh_index | Rebuild the project index after file changes |
get_settings_info | View current project configuration and status |
Tool | Description |
---|---|
search_code_advanced | Smart search with regex, fuzzy matching, and file filtering |
find_files | Locate files using glob patterns (e.g., **/*.py ) |
get_file_summary | Analyze file structure, functions, imports, and complexity |
Tool | Description |
---|---|
get_file_watcher_status | Check file watcher status and configuration |
configure_file_watcher | Enable/disable auto-refresh and configure settings |
Tool | Description |
---|---|
create_temp_directory | Set up storage directory for index data |
check_temp_directory | Verify index storage location and permissions |
clear_settings | Reset all cached data and configurations |
refresh_search_tools | Re-detect available search tools (ugrep, ripgrep, etc.) |
1. Initialize Your Project
Set the project path to /Users/dev/my-react-app
Automatically indexes your codebase and creates searchable cache
2. Explore Project Structure
Find all TypeScript component files in src/components
Uses: find_files
with pattern src/components/**/*.tsx
3. Analyze Key Files
Give me a summary of src/api/userService.ts
Uses: get_file_summary
to show functions, imports, and complexity
Search for all function calls matching "get.*Data" using regex
Finds: getData()
, getUserData()
, getFormData()
, etc.
Find authentication-related functions with fuzzy search for 'authUser'
Matches: authenticateUser
, authUserToken
, userAuthCheck
, etc.
Search for "API_ENDPOINT" only in Python files
Uses: search_code_advanced
with file_pattern: "*.py"
Configure automatic index updates when files change
Uses: configure_file_watcher
to enable/disable monitoring and set debounce timing
I added new components, please refresh the project index
Uses: refresh_index
to update the searchable cache
If automatic index updates aren't working when files change, try:
pip install watchdog
(may resolve environment isolation issues)refresh_index
tool after making file changesget_file_watcher_status
to verify monitoring is activegit clone https://github.com/johnhuang316/code-index-mcp.git cd code-index-mcp uv sync uv run code-index-mcp
npx @modelcontextprotocol/inspector uvx code-index-mcp
Contributions are welcome! Please feel free to submit a Pull Request.