Provides semantic code search, analysis, and project context for AI language models.
Configuration
View docs{
"mcpServers": {
"zxfgds-mcp-code-indexer": {
"command": "python",
"args": [
"-m",
"server.app"
]
}
}
}MCP Code Indexer is an intelligent code-search and analysis tool designed to empower AI language models with fast, semantic code retrieval and insightful project analysis. It helps you understand large codebases, extract meaningful context, and perform targeted searches across languages to improve code comprehension, navigation, and quality.
To work with the MCP Code Indexer, run the provided MCP server and connect your client to the local or remote endpoint. Use the available tools to identify your project, index code, and perform targeted searches. You can then analyze code structure, measure quality, extract documentation, and explore dependencies to gain deep insights into your codebase.
Prerequisites: make sure Python is installed on your system.
# Install dependencies
pip install -r requirements.txt
# Install the MCP Code Indexer package locally
python setup.py installConfigure the MCP server connection in your client settings. The standard stdio-based local server uses Python to run the application module.
{
"mcpServers": {
"code_indexer": {
"command": "python",
"args": ["-m", "server.app"],
"cwd": "安装目录路径",
"env": {},
"disabled": false,
"alwaysAllow": []
}
}
}Set up the Claude Desktop configuration to connect to the MCP Code Indexer server.
{
"mcpServers": {
"code-indexer": {
"command": "python",
"args": ["-m", "server.app"],
"cwd": "安装目录路径",
"env": {},
"disabled": false,
"alwaysAllow": []
}
}
}Configure the VSCode extension to connect to the MCP Code Indexer server.
{
"mcpServers": {
"code-indexer": {
"command": "python",
"args": ["-m", "server.app"],
"cwd": "安装目录路径",
"env": {},
"disabled": false,
"alwaysAllow": []
}
}
}Common workflows include identifying a project, indexing its code, and then searching for relevant snippets. After indexing, you can inspect code structure, evaluate quality, extract documentation, locate similar code, gather metrics, and analyze dependencies to improve understanding and maintainability.
The MCP Code Indexer exposes a set of tools to streamline your work with code. Use these core actions to interact with your project:
identify_project
index_project
search_code
get_code_structure
analyze_code_quality
extract_documentation
find_similar_code
get_code_metrics
analyze_dependenciesKeep your environment secure by running the MCP server in trusted networks and restricting access to authorized clients. Use appropriate environment variables for sensitive configurations if provided by your setup.
Identify the target project to be indexed to determine its scope and structure.
Index the project's codebase to build a semantic, queryable representation.
Search for relevant code snippets across indexed projects using semantic understanding.
Analyze and retrieve the code structure, including classes, functions, and dependencies.
Assess code quality metrics and identify improvement opportunities.
Extract documentation and comments to support documentation generation.
Detect and surface similar or duplicate code across the index.
Provide code metrics and statistics for analysis and reporting.
Analyze project dependencies and their relationships.