cpp-analysis-mcp
Allows AI agents to analyze and test C++ code, including static checks, sanitizers (ThreadSanitizer, AddressSanitizer, LeakSanitizer, UBSan), and profiling using perf.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cpp-analysis-mcpcheck for data races in src/account.cpp"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cpp-analysis-mcp
An MCP server that lets AI coding agents actually test C++ code instead of just reading it.
The problem
Some C++ bugs are invisible in source code. This looks fine:
void deposit(int amt) {
balance += amt; // no lock
}Run it from 100 threads and it loses updates. The bug lives in timing, not in the text, so an AI that only reads the file will call it clean.
The tools that catch these bugs already exist and are excellent. They are just command line programs that no AI assistant is wired up to. This project is that wiring.
Related MCP server: cpp-semantic-graph
What it does
Eight tools, three questions:
Question | Tools | Cost |
Does anything look wrong? | static_check_file / _snippet | seconds |
Is it actually wrong? | sanitize_file / _project / _snippet | minutes |
Where is it slow? | profile_file / _project | minutes |
The agent starts cheap and escalates only when it has to. The eighth tool, capabilities, reports what this machine can really run.
Under the hood: ThreadSanitizer for data races, AddressSanitizer for memory corruption, LeakSanitizer for leaks, UBSan for undefined behavior, clang-tidy and -Wthread-safety at compile time, and perf for profiling.
Platform support
Linux | macOS | Windows | |
ASan, UBSan, static checks | yes | yes | yes |
TSan, LSan | yes | yes | yes, via WSL |
Profiler (perf) | yes | not yet | yes, via WSL |
On Windows the server finds a WSL distro on its own and routes the Linux-only tools through it. You keep passing normal C:\ paths. When something cannot run, the server says so plainly and names the command that would fix it.
Setup
You need Python 3.11+, uv, and a C++ compiler (clang or gcc).
git clone https://github.com/GusDawn123/cpp-analysis-mcp
cd cpp-analysis-mcp
uv syncThen register it with your agent. For Claude Code:
claude mcp add cpp-analysis -- uv run --directory <path-to-repo> cpp-analysis-mcpFor any other MCP client, add the same command to its config file:
{ "mcpServers": { "cpp-analysis": {
"command": "uv",
"args": ["run", "--directory", "<path-to-repo>", "cpp-analysis-mcp"]
}}}The first start takes a minute. The server compiles and runs a tiny buggy program for each analysis to prove the tool really works on your machine, then caches the results.
Why you can trust an empty result
The server never takes a tool's word for it. At startup it plants a real bug (a data race, a leak, an overflow) and requires each detector to catch it. A detector that stays quiet on a known bug is reported as unavailable, with the reason and the install command that fixes it.
So an empty report means a detector that provably works here saw nothing. That difference matters, because a silently broken tool looks exactly like clean code.
Architecture
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 lacksThe layer rules are enforced by tests that parse the source tree, so they cannot rot: server.py holds no control flow, only process.py may spawn a subprocess, parsers never touch a file, and exactly one module is allowed to ask what machine this is.
Tests
507 unit tests run anywhere, no compiler needed. Integration tests compile and run fixtures with planted bugs, and golden outputs captured on Linux, macOS, and Windows keep every parser honest.
make testLicense
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