Skip to main content
Glama
GusDawn123

cpp-analysis-mcp

by GusDawn123

cpp-analysis-mcp

C++コードを読むだけでなく、実際にテストできるようにするAIコーディングエージェント向けのMCPサーバーです。

問題

C++のバグの中には、ソースコード上では見えないものがあります。これは問題なさそうに見えます:

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

100スレッドから実行すると、更新が失われます。このバグはテキストではなくタイミングに存在するため、ファイルを読むだけのAIはこれを問題なしと判断します。

これらのバグを検出するツールはすでに存在し、優れています。ただ、それらはAIアシスタントに接続されていないコマンドラインプログラムにすぎません。このプロジェクトは、その接続を実現するものです。

Related MCP server: cpp-semantic-graph

機能

8つのツール、3つの問い:

問い

ツール

コスト

何かおかしいところはあるか?

static_check_file / _snippet

実際に間違っているか?

sanitize_file / _project / _snippet

どこが遅いか?

profile_file / _project

エージェントは低コストから始め、必要な場合にのみ段階を上げます。8番目のツールである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だけがサブプロセスを起動でき、パーサーはファイルに触れることがなく、このマシンが何であるかを問い合わせることができるモジュールは正確に1つだけです。

テスト

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