The C++ Style Guide MCP Server enforces consistent C++ coding standards and best practices through automated analysis tools.
Check Naming Conventions (
check_naming): Validate C++ identifiers (variables, constants, functions, classes, namespaces, member variables, template parameters, and file names) against established naming conventions.Verify Include Guards (
check_include_guard): Check header files for correct include guards (#ifndef/#define/#endif) or#pragma onceusage, with suggestions for proper guard macro names.Analyze Memory Safety (
analyze_memory_safety): Detect memory safety issues such as memory leaks, dangling pointers, use-after-free, and other unsafe memory patterns.Suggest Modern C++ Improvements (
suggest_modern_cpp): Get actionable recommendations to upgrade legacy code to modern C++ standards (C++11 through C++23), including new feature suggestions and rewrite examples.Check Const Correctness (
check_const_correctness): Identify missingconstqualifiers on member functions, parameters, and variables to improve code safety and clarity.
Provides C++ code analysis tools for checking naming conventions, include guards, memory safety, const correctness, and modern C++ upgrade suggestions, along with access to C++ style guide documentation and best practices
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., "@C++ Style Guide MCP Servercheck this code for memory safety issues"
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.
中文 | English
C++ Style Guide MCP Server
Enforce consistent C++ style and best practices across your codebase. Analyze naming conventions, memory safety, and const correctness, and get actionable modernization suggestions up to C++23. Accelerate reviews with ready-made prompts and quick access to curated guidelines.
Tools
Tool | Description |
| Validate C++ identifiers (variables, classes, functions, etc.) against naming conventions |
| Verify header file include guards or |
| Detect memory leaks, dangling pointers, and unsafe memory patterns |
| Get modernization suggestions targeting C++11 through C++23 |
| Find missing |
Resources
URI | Description |
| Naming convention reference (variable, class, function, namespace, …) |
| Best practice guides (memory, exceptions, templates, concurrency, …) |
| C++ standard feature docs (cpp11 – cpp23) |
| Design pattern examples (RAII, Pimpl, Factory, Observer, …) |
Prompts
Prompt | Description |
| Code review template (general / performance / safety / readability / modern) |
| Refactoring guide targeting a specific C++ standard |
Usage
Connect via Smithery (recommended)
npx -y @smithery/cli install @SongJiangzhou/cpp_guidelines --client claudeMCP endpoint (HTTP / streamable-http)
https://cpp-style-guide-mcp.fly.dev/mcpLocal installation
git clone https://github.com/SongJiangzhou/cpp_guidelines_mcp.git
cd cpp_guidelines_mcp
uv sync
uv run mcp run cpp_style_server.pyAdd to your MCP client config:
{
"mcpServers": {
"cpp-style": {
"command": "uv",
"args": ["run", "mcp", "run", "cpp_style_server.py"],
"cwd": "/path/to/cpp_guidelines_mcp"
}
}
}Examples
# Check a variable name
check_naming("myVariable", "variable")
# Analyze memory safety
analyze_memory_safety("void f(int* p) { delete p; p->run(); }")
# Modernize code to C++17
suggest_modern_cpp("for (int i=0; i<v.size(); i++) {...}", "cpp17")
# Check const correctness
check_const_correctness("class Foo { int getValue() { return x; } int x; };")
# Access naming convention docs
Resource: cpp-style://naming/all
# Access memory best practices
Resource: cpp-style://best-practices/memoryProject Structure
cpp_guidelines_mcp/
├── cpp_style_server.py # MCP server entry point
├── cpp_style/
│ ├── tools/ # 5 analysis tools
│ ├── resources/ # 4 reference resource categories
│ ├── prompts/ # 2 prompt templates
│ └── data/ # JSON knowledge base
├── fly.toml # Fly.io deployment config
├── Dockerfile # Container image
└── smithery.yaml # Smithery config (local stdio mode)Tech Stack
License
Links
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.