Skip to main content
Glama
code-index-mcp

code-index-mcp

by johnhuang316

코드 인덱스 MCP

MCP 서버 파이썬특허

코드 인덱싱, 검색, 분석을 위한 모델 컨텍스트 프로토콜 서버입니다.

코드 인덱스 MCP란 무엇인가요?

Code Index MCP는 지능형 코드 인덱싱 및 분석 기능을 제공하는 특수 MCP 서버입니다. 대규모 언어 모델(LML)이 코드 저장소와 상호 작용하여 복잡한 코드베이스를 실시간으로 분석하고 탐색할 수 있도록 지원합니다.

이 서버는 AI 모델이 외부 도구 및 데이터 소스와 상호 작용하는 표준화된 방식인 MCP( Model Context Protocol )와 통합됩니다.

Related MCP server: @lex-tools/codebase-context-dumper

주요 특징

  • 프로젝트 인덱싱 : 검색 가능한 코드 파일 인덱스를 구축하기 위해 디렉토리를 재귀적으로 스캔합니다.

  • 코드 검색 : 코드베이스 전반에서 패턴, 함수 정의 및 참조 찾기

  • 파일 분석 : 파일 구조, 가져오기 및 복잡성에 대한 자세한 통찰력을 얻으세요

  • 스마트 필터링 : 빌드 디렉토리, 종속성 및 비코드 파일을 자동으로 무시합니다.

  • 영구 저장소 : 세션 전반의 성능 향상을 위해 인덱스를 캐시합니다.

지원되는 파일 유형

서버는 다음을 포함한 여러 프로그래밍 언어와 파일 확장자를 지원합니다.

  • 파이썬(.py)

  • JavaScript/TypeScript(.js, .ts, .jsx, .tsx)

  • 자바(.java)

  • C/C++(.c, .cpp, .h, .hpp)

  • C#(.cs)

  • 고(.go)

  • 루비(.rb)

  • PHP(.php)

  • 스위프트(.swift)

  • 코틀린(.kt)

  • 녹(.rs)

  • 스칼라(.scala)

  • 쉘 스크립트(.sh, .bash)

  • 웹 파일(.html, .css, .scss)

  • 문서/구성(.md, .json, .xml, .yml, .yaml)

설치

필수 조건

  • Python 3.8 이상

  • uv 패키지 관리자(추천)

uvx 사용(권장)

code-index-mcp를 설치하고 사용하는 가장 쉬운 방법은 uvx를 사용하는 것입니다.

지엑스피1

pip 사용하기

또는 pip를 통해 설치할 수 있습니다.

pip install code-index-mcp

설치 후 모듈로 실행할 수 있습니다.

python -m code_index_mcp

Claude Desktop과 통합

Claude 설정에 다음을 추가하세요( ~/Library/Application Support/Claude/claude_desktop_config.json ):

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

구성을 추가한 후 Claude Desktop을 다시 시작하면 Code Index MCP 도구를 사용할 수 있습니다.

사용 가능한 도구

핵심 도구

  • set_project_path : 인덱싱을 위한 기본 프로젝트 경로를 설정합니다.

  • search_code : 인덱스된 파일 내에서 코드 일치 항목을 검색합니다.

  • find_files : 주어진 패턴과 일치하는 프로젝트에서 파일을 찾습니다.

  • get_file_summary : 줄 수, 함수, 가져오기 등을 포함하여 특정 파일의 요약을 가져옵니다.

  • refresh_index : 프로젝트 인덱스를 새로 고칩니다.

  • get_settings_info : 프로젝트 설정에 대한 정보를 가져옵니다.

유틸리티 도구

  • create_temp_directory : 인덱스 데이터를 저장하는 데 사용되는 임시 디렉토리를 생성합니다.

  • check_temp_directory : 인덱스 데이터를 저장하는 데 사용되는 임시 디렉토리를 확인합니다.

  • clear_settings : 모든 설정과 캐시된 데이터를 지웁니다.

Claude를 사용한 예시 사용

다음은 Claude와 함께 Code Index MCP를 사용하는 방법에 대한 몇 가지 예입니다.

프로젝트 경로 설정

Please set the project path to C:\Users\username\projects\my-python-project

코드 패턴 검색

Search the code for all occurrences of "def process_data" in Python files

파일 요약 가져오기

Give me a summary of the main.py file in the project

특정 유형의 모든 파일 찾기

Find all JavaScript files in the project

개발

소스에서 빌드

  1. 저장소를 복제합니다.

git clone https://github.com/username/code-index-mcp.git
cd code-index-mcp
  1. 종속성 설치:

uv sync
  1. 서버를 로컬로 실행합니다.

uv run code_index_mcp

디버깅

MCP 검사기를 사용하여 서버를 디버깅할 수 있습니다.

npx @modelcontextprotocol/inspector uvx code-index-mcp

특허

MIT 라이센스

기여하다

기여를 환영합니다! 풀 리퀘스트를 제출해 주세요.

언어

Available Tools

14 tools
build_deep_indexA
Build the deep index (full symbol extraction) for the current project.

This performs a complete re-index and loads it into memory.
Uses parallel processing by default. For large codebases (3000+ files),
tuning max_workers can significantly improve build times.

Args:
    max_workers: Maximum number of parallel workers for file processing.
        Defaults to min(4, cpu_count) when not specified.
        Increase for I/O-bound workloads on machines with many cores.
    timeout: Parallel build timeout in seconds. When not specified,
        scales dynamically based on file count (0.5s per file,
        min 30s, max 600s).

Inputs: max_workers, timeout. Returns: result

check_temp_directoryA

Check the temporary directory used for storing index data.

Inputs: no named parameters. Returns: object

clear_settingsB

Clear all settings and cached data.

Inputs: no named parameters. Returns: result

configure_file_watcherA

Configure file watcher service settings.

Args:
    enabled: Whether to enable file watcher
    debounce_seconds: Debounce time in seconds before triggering rebuild
    additional_exclude_patterns: Additional directory/file patterns to exclude
    observer_type: Observer backend to use. Options:
        - "auto" (default): platform default observer
        - "kqueue": Force kqueue observer (macOS/BSD)
        - "fsevents": Force FSEvents observer (macOS only, has known reliability issues)
        - "polling": Cross-platform polling fallback (slower but most compatible)

Inputs: enabled, debounce_seconds, additional_exclude_patterns, observer_type. Returns: result

create_temp_directoryA

Create the temporary directory used for storing index data.

Inputs: no named parameters. Returns: object

find_filesA

Find files matching glob pattern using in-memory index. Supports path patterns (.py, test_.js) and filename-only matching (README.md).

Inputs: pattern (required). Returns: result

get_file_summaryB
Get a summary of a specific file, including:
- Line count
- Function/class definitions (for supported languages)
- Import statements
- Basic complexity metrics

Inputs: file_path (required). Returns: object

get_file_watcher_statusA

Get file watcher service status and statistics.

Inputs: no named parameters. Returns: object

get_settings_infoB

Get information about the project settings.

Inputs: no named parameters. Returns: object

get_symbol_bodyA
Get the source code body of a specific symbol (function, method, or class).

This tool retrieves only the code for the specified symbol, enabling efficient
context usage by avoiding loading entire files.

Args:
    file_path: Path to the file containing the symbol
    symbol_name: Name of the symbol to retrieve (e.g., "process_data", "MyClass.my_method")

Returns:
    Dictionary containing:
    - status: "success" or "error"
    - symbol_name: Name of the symbol
    - type: Type of symbol (function, method, class)
    - line: Start line number
    - end_line: End line number
    - code: The actual source code
    - signature: Function/method signature (if available)
    - docstring: Documentation string (if available)
    - called_by: List of symbols that call this symbol

Inputs: file_path (required), symbol_name (required). Returns: object

refresh_indexA

Manually rebuild the project file index. Use after git operations or when index seems stale.

Inputs: no named parameters. Returns: result

refresh_search_toolsA

Manually re-detect the available command-line search tools on the system. This is useful if you have installed a new tool (like ripgrep) after starting the server.

Inputs: no named parameters. Returns: result

search_code_advancedA

Search for code pattern with pagination. Auto-selects best search tool (ugrep/ripgrep/ag/grep). Supports glob file_pattern (e.g., "*.py"), explicit regex mode, and fuzzy matching (ugrep only). Regex matching requires passing regex=True and may require an external search tool.

Inputs: pattern (required), case_sensitive, context_lines, file_pattern, +4 more. Returns: object

set_project_pathC

Set the base project path for indexing.

Inputs: path (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 14 tools

    Disambiguation5/5

    Each tool targets a distinct action: index building, file watching, settings management, searching, etc. Overlap is minimal and descriptions clarify the differences.

    Naming Consistency5/5

    All tool names use a consistent verb_noun snake_case pattern (e.g., build_deep_index, check_temp_directory, get_file_summary). No mixing of conventions.

    Tool Count5/5

    14 tools cover indexing, searching, file details, symbol retrieval, settings, and utilities. This is well-scoped for a code index server, neither sparse nor excessive.

    Completeness4/5

    Covers core operations: index build/refresh, file and code search, symbol body retrieval, settings, file watcher. Minor gaps like listing symbols or index statistics exist but do not hinder primary use.

    Maintenance

    ActivityInactive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers