cpp-analysis-mcp
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
This server cannot be installed
Maintenance
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
- AlicenseNot gradedqualityDmaintenanceAn MCP server that exposes LLDB debugging capabilities, enabling AI-assisted interactive debugging of C/C++ applications through 40 specialized tools.2MIT
- FlicenseNot gradedqualityBmaintenanceBuilds 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
- FlicenseNot gradedqualityCmaintenanceEnables AI coding assistants to manage persistent memory, search project context, generate tests, review architecture, and orchestrate workflows through 15 MCP tools, enhancing context-aware code generation.
- AlicenseNot gradedqualityAmaintenanceEnables coding agents to run project-specific checks, replays, simulations, and queries as MCP tools, providing ground-truth feedback on config edits instead of guessing.1MIT
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).
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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