Code Index MCP is a Model Context Protocol server that enables large language models (LLMs) to index, search, and analyze code in project directories.
This project uses uv for environment management and dependency installation.
Ensure you have Python 3.10 or later installed
Install uv (recommended):
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
Getting the code:
# Clone the repository
git clone https://github.com/your-username/code-index-mcp.git
# Run directly with uv - no additional dependency installation needed
uv run run.py
UV will automatically handle all dependency installations based on the project's configuration.
You can easily integrate Code Index MCP with Claude Desktop:
Ensure you have UV installed (see installation section above)
Find or create the Claude Desktop configuration file:
%APPDATA%\Claude\claude_desktop_config.json
~/Library/Application Support/Claude/claude_desktop_config.json
Add the following configuration (replace with your actual path):
For Windows:
{
"mcpServers": {
"code-indexer": {
"command": "uv",
"args": [
"--directory",
"C:\\Users\\username\\path\\to\\code-index-mcp",
"run",
"run.py"
]
}
}
}
For macOS/Linux:
{
"mcpServers": {
"code-indexer": {
"command": "uv",
"args": [
"--directory",
"/home/username/path/to/code-index-mcp",
"run",
"run.py"
]
}
}
}
Note: The --directory
option is important as it ensures uv runs in the correct project directory and can properly load all dependencies.
Restart Claude Desktop to use Code Indexer for analyzing code projects
No manual dependency installation is required - UV will automatically handle all dependencies when running the server.
Set Project Path (required first step):
Code Search:
File Analysis:
Project Navigation:
All index and settings data are stored in the .code_indexer
folder within the project directory:
config.json
: Project configuration informationfile_index.pickle
: File index datacontent_cache.pickle
: File content cacheThis ensures that the entire project doesn't need to be re-indexed each time it's used.
Code Index MCP uses UV for dependency management, which provides several advantages:
The following file types are currently supported for indexing and analysis:
.code_indexer
folder includes a .gitignore
file to prevent indexing data from being committedContributions via issues or pull requests to add new features or fix bugs are welcome.
For documentation in Chinese, please see README_zh.md.
{
"mcpServers": {
"code-indexer": {
"env": {},
"args": [
"--directory",
"C:\\Users\\username\\path\\to\\code-index-mcp",
"run",
"run.py"
],
"command": "uv"
}
}
}
Seamless access to top MCP servers powering the future of AI integration.