KC

kandrwmrtn/cplusplus_mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

34 stars 6 forks 품질 83 트렌드 26MIT

MCP (모델 Context Protocol) 서버는 libclang을 사용하여 C++ codebase를 분석합니다.

개요

MCP (모델 Context Protocol) 서버는 libclang을 사용하여 C++ codebase를 분석합니다. C++ codebase를 통해 Claude grep을 갖는 대신 구조물을 이해하려고 합니다. 이 서버는 코드의 semantic 이해를 제공합니다. Claude는 수천 개의 파일에서 손실없이 클래스, 기능 및 그들의 관계를 즉시 찾을 수 있습니다. C++ 구문, 상속 계층을 이해하고, 그래프를 호출 - IDE처럼 코드를 탐색 할 수있는 능력을 부여합니다. Context-efficient C++ 코드 분석: - 이름 패턴에 의해 클래스 찾기 - - 이름 패턴에 의해 기능을 찾기 - - 추가 클래스 정보 얻기 (methods, 회원, 상속) - - 기능 서명 및 매개 변수를 얻으십시오 - 특정 파일 내의 검색 기호 - - 클래스에 대한 전체 상속 계층을 얻기 - 기본 클래스에서 상속하는 모든 클래스를 찾기 - 특정 함수를 호출하는 모든 기능을 찾기 - 특정 함수에 의해 호출 모든 기능을 찾기 - - 특정 함수에 의해 호출하는 모든 기능을 찾기 - 하나의 함수에서 경로 호출을 찾아...

개요(AI 번역)

MCP (모델 Context Protocol) 서버는 libclang을 사용하여 C++ codebase를 분석합니다.

왜 이것을 사용합니까?

C++ codebase를 통해 Claude grep을 갖는 대신 구조물을 이해하려고 합니다. 이 서버는 코드의 semantic 이해를 제공합니다. Claude는 수천 개의 파일에서 손실없이 클래스, 기능 및 그들의 관계를 즉시 찾을 수 있습니다. C++ 구문, 상속 계층을 이해하고, 그래프를 호출 - IDE처럼 코드를 탐색 할 수있는 능력을 부여합니다.

특징

Context-efficient C++ 부호 분석:

  • search classes - 이름 패턴으로 클래스 찾기
  • search functions - 이름 패턴에 의한 기능 찾기
  • get class info - 상세한 클래스 정보를 얻기 (methods, member, 상속)
  • get function signature - 기능 서명 및 매개 변수 가져오기
  • find in file - 특정 파일 내 검색 기호
  • get class hierarchy - 클래스에 대한 전체 상속 계층을 얻기
  • get derived classes - 기본 클래스에서 상속되는 모든 클래스를 찾습니다.
  • find callers - 특정 함수를 호출하는 모든 함수를 찾습니다.
  • find callees - 특정 함수에 의해 호출된 모든 함수를 찾습니다

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

C++ MCP Server

An MCP (Model Context Protocol) server for analyzing C++ codebases using libclang.

Why Use This?

Instead of having Claude grep through your C++ codebase trying to understand the structure, this server provides semantic understanding of your code. Claude can instantly find classes, functions, and their relationships without getting lost in thousands of files. It understands C++ syntax, inheritance hierarchies, and call graphs - giving Claude the ability to navigate your codebase like an IDE would.

Features

Context-efficient C++ code analysis:

  • search_classes - Find classes by name pattern
  • search_functions - Find functions by name pattern
  • get_class_info - Get detailed class information (methods, members, inheritance)
  • get_function_signature - Get function signatures and parameters
  • find_in_file - Search symbols within specific files
  • get_class_hierarchy - Get complete inheritance hierarchy for a class
  • get_derived_classes - Find all classes that inherit from a base class
  • find_callers - Find all functions that call a specific function
  • find_callees - Find all functions called by a specific function
  • get_call_path - Find call paths from one function to another

Prerequisites

  • Python 3.9 or higher
  • pip (Python package manager)
  • Git (for cloning the repository)
  • LLVM’s libclang (the setup scripts will attempt to download a portable build)

Setup

  1. Clone the repository:
git clone 
cd CPlusPlus-MCP-Server
  1. Run the setup script for your platform (this creates a virtual environment, installs dependencies, and fetches libclang if possible):

    • Windows
      server_setup.bat
      
    • Linux/macOS
      ./server_setup.sh
      
  2. Test the installation (recommended):

# Activate the virtual environment first
mcp_env\Scripts\activate

# Run the installation test
python scripts\test_installation.py

This will verify that all components are properly installed and working. The test script lives at scripts/test_installation.py.

Configuring Claude Code

To use this MCP server with Claude Code, you need to add it to your Claude configuration file.

  1. Find and open your Claude configuration file. Common locations include:

    C:\Users\\.claude.json
    C:\Users\\AppData\Roaming\Claude\.claude.json
    %APPDATA%\Claude\.claude.json
    

    The exact location may vary depending on your Claude installation.

  2. Add the C++ MCP server to the mcpServers section:

    {
      "mcpServers": {
        "cpp-analyzer": {
          "command": "python",
          "args": [
            "-m",
            "mcp_server.cpp_mcp_server"
          ],
          "cwd": "YOUR_INSTALLATION_PATH_HERE",
          "env": {
            "PYTHONPATH": "YOUR_INSTALLATION_PATH_HERE"
          }
        }
      }
    }
    
GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "cpp-analyzer": { "command": "python", "args": [ "-m", "mcp_server.cpp_mcp_server" ], "cwd": "YOUR_INSTALLATION_PATH_HERE", "env": { "PYTHONPATH": "YOUR_INSTALLATION_PATH_HERE" } } } }