Skip to main content
Glama
GusDawn123

cpp-analysis-mcp

by GusDawn123

cpp-analysis-mcp

AI 코딩 에이전트가 C++ 코드를 그냥 읽기만 하는 대신 실제로 테스트할 수 있게 해주는 MCP 서버입니다.

문제

일부 C++ 버그는 소스 코드에서 보이지 않습니다. 이 코드는 정상적으로 보입니다:

void deposit(int amt) {
    balance += amt;   // no lock
}

100개의 스레드에서 실행하면 업데이트가 유실됩니다. 버그는 텍스트가 아닌 타이밍에 존재하므로, 파일만 읽는 AI는 이 코드를 정상이라고 판단할 것입니다.

이러한 버그를 잡는 도구는 이미 존재하며 훌륭합니다. 다만 AI 어시스턴트에 연결되지 않은 명령줄 프로그램일 뿐입니다. 이 프로젝트가 바로 그 연결 작업입니다.

Related MCP server: cpp-semantic-graph

기능

여덟 가지 도구, 세 가지 질문:

질문

도구

비용

뭔가 잘못된 게 있나?

static_check_file / _snippet

수 초

실제로 잘못된 건가?

sanitize_file / _project / _snippet

수 분

어디가 느린가?

profile_file / _project

수 분

에이전트는 저비용 검사부터 시작하여 필요한 경우에만 고비용 검사로 전환합니다. 여덟 번째 도구인 capabilities는 이 머신에서 실제로 실행할 수 있는 것을 보고합니다.

내부적으로는 데이터 경쟁에 ThreadSanitizer, 메모리 손상에 AddressSanitizer, 누수에 LeakSanitizer, 정의되지 않은 동작에 UBSan, 컴파일 타임에 clang-tidy와 -Wthread-safety, 프로파일링에 perf를 사용합니다.

플랫폼 지원

Linux

macOS

Windows

ASan, UBSan, 정적 검사

TSan, LSan

예, WSL 경유

프로파일러 (perf)

아직 없음

예, WSL 경유

Windows에서 서버는 WSL 배포판을 자동으로 찾아 Linux 전용 도구를 그 경유로 라우팅합니다. 일반적인 C:\ 경로를 계속 전달하면 됩니다. 실행할 수 없는 것이 있으면 서버는 그 사실을 명확히 알리고 이를 해결할 명령어를 제시합니다.

설정

Python 3.11+, uv, C++ 컴파일러(clang 또는 gcc)가 필요합니다.

git clone https://github.com/GusDawn123/cpp-analysis-mcp
cd cpp-analysis-mcp
uv sync

그런 다음 에이전트에 등록합니다. Claude Code의 경우:

claude mcp add cpp-analysis -- uv run --directory <path-to-repo> cpp-analysis-mcp

다른 MCP 클라이언트의 경우, 동일한 명령을 해당 설정 파일에 추가합니다:

{ "mcpServers": { "cpp-analysis": {
    "command": "uv",
    "args": ["run", "--directory", "<path-to-repo>", "cpp-analysis-mcp"]
}}}

첫 시작은 1분 정도 걸립니다. 서버는 각 분석에 대해 아주 작은 버그 프로그램을 컴파일하고 실행하여 도구가 실제로 머신에서 작동하는지 검증한 후 결과를 캐시합니다.

빈 결과를 신뢰할 수 있는 이유

서버는 도구의 말을 그대로 믿지 않습니다. 시작 시 실제 버그(데이터 경쟁, 누수, 오버플로)를 심어 두고 각 탐지기가 이를 잡아내도록 요구합니다. 알려진 버그에서 조용히 넘어가는 탐지기는 사용 불가로 보고되며, 그 이유와 해결을 위한 설치 명령어가 함께 제공됩니다.

따라서 빈 보고서는 이 머신에서 작동이 입증된 탐지기가 아무것도 보지 못했다는 뜻입니다. 이 차이는 중요합니다. 조용히 고장 난 도구는 깨끗한 코드와 똑같이 보이기 때문입니다.

아키텍처

your AI agent (Claude Code, Cursor, anything that speaks MCP)
        |
    server.py        eight tools, no logic of its own
        |
    pipelines/       the recipes: check, sanitize, profile
        |
   +----------+-------------+
   |          |             |
 build/    process.py    parsers/
 compiles  runs tools    raw tool output in,
 the code  safely, with  clean findings out
   |       timeouts
   |
   +-- platforms/    what Linux, macOS, and Windows each need
   +-- toolchains/   what clang and gcc each need
   +-- wsl.py        Windows borrowing Linux for what it lacks

레이어 규칙은 소스 트리를 파싱하는 테스트로 강제되므로 무너지지 않습니다: server.py는 제어 흐름을 가지지 않으며, process.py만 하위 프로세스를 생성할 수 있고, 파서는 파일을 건드리지 않으며, 이 머신이 무엇인지 묻는 모듈은 정확히 하나만 허용됩니다.

테스트

컴파일러 없이 어디서나 실행되는 507개의 단위 테스트가 있습니다. 통합 테스트는 심어진 버그가 있는 픽스처를 컴파일하고 실행하며, Linux, macOS, Windows에서 캡처된 골든 출력이 모든 파서의 정확성을 유지합니다.

make test

라이선스

MIT

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that exposes LLDB debugging capabilities, enabling AI-assisted interactive debugging of C/C++ applications through 40 specialized tools.
    2
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    Builds a semantic knowledge graph of C++ code and exposes 9 MCP tools for AI assistants to search classes, functions, inheritance, callers, callees, overrides, and more.
    3

View all related MCP servers

Related MCP Connectors

  • Voice-powered bug reporting with 13 MCP tools. Record bugs by talking; let AI find and fix them.

  • Package intelligence MCP for AI agents — 22 tools, 19 ecosystems, AGPL SDK, free.

  • Persistent memory and cross-session learning for AI coding assistants (hosted remote MCP).

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/GusDawn123/cpp-analysis-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server