JC

johnhuang316/code-index-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

1004 stars 121 forks 质量 76 趋势 4MIT

一个模型上下文协议(MCP)服务器,帮助大型语言模型以最少的设置方式索引、搜索和分析代码仓库

概览

通过先进的搜索、分析和导航功能,改变AI对你代码库的理解。 代码索引MCP是一款模型上下文协议服务器,连接了AI模型与复杂代码库之间的差距。它提供智能索引、高级搜索功能和详细代码分析,帮助AI助手有效理解和导航你的项目。 代码审查、重构、文档生成、调试协助和架构分析。 使用任何兼容MCP的应用程序最简单的方法: 1. (例如 claude_desktop_config.json 或 ~/.claude.json):可选:将 --project-path /absolute/path/to/repo 添加到 args 数组,使服务器自动初始化该仓库(相当于启动后调用 set_project_path)。 2. – UVX 自动处理安装和执行 3.

概述(AI 翻译)

大型语言模型的智能代码索引与分析

通过先进的搜索、分析和导航功能,改变AI对你代码库的理解。

概述

代码索引MCP是一款模型上下文协议服务器,连接了AI模型与复杂代码库之间的差距。它提供智能索引、高级搜索功能和详细代码分析,帮助AI助手有效理解和导航你的项目。

** 非常适合:** 代码审查、重构、文档生成、调试协助和架构分析。

快速启动

🚀 推荐设置(大多数用户)

使用任何兼容MCP的应用程序最简单的方法:

前提条件: Python 3.10+ 和 uv

  1. 添加到你的MCP配置(例如,claude_desktop_config.json或~/.claude.json):

可选:将--project-path /absolute/path/to/repo附加到args数组中,使服务器 会自动初始化该仓库(相当于调用 set_project_path 启动后)。

  1. 重启您的应用程序 – uvx 自动处理安装和执行

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Code Index MCP

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).

  2. Restart your application – uvx automatically handles installation and execution

  3. 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\\.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 = {
在 GitHub 查看完整 README

安装

uvx code-index-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "code-index": { "command": "uvx", "args": ["code-index-mcp"] } } }