C++ Style Guide MCP Server
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 "Deploy 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 Server check 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 |
Related MCP server: mcp-zen-of-languages
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
Available Tools
5 toolsanalyze_memory_safetyC
分析 C++ 代码中的内存安全问题
参数:
code: 要分析的 C++ 代码
返回:
内存安全分析报告,包括潜在的内存泄漏、悬空指针、不安全操作等
Inputs: code (required). Returns: result
check_const_correctnessB
检查 C++ 代码中的 const 正确性
参数:
code: 要检查的 C++ 代码
返回:
const 正确性检查报告,包括缺少 const 的地方和改进建议
Inputs: code (required). Returns: result
check_include_guardA
检查 C++ 头文件的包含保护是否正确
参数:
code: 头文件的完整代码
file_path: 可选的文件路径,用于生成建议的保护宏名
返回:
检查结果,包含是否符合规范、详细说明和建议
Inputs: code (required), file_path. Returns: result
check_namingA
检查 C++ 标识符命名是否符合规范
参数:
identifier: 要检查的标识符名称
category: 标识符类别,可选值:
- variable: 变量
- constant: 常量
- function: 函数
- class: 类
- namespace: 命名空间
- member_variable: 成员变量
- template_parameter: 模板参数
- file_naming: 文件命名
返回:
检查结果,包含是否符合规范、详细说明和建议
Inputs: identifier (required), category (required). Returns: result
suggest_modern_cppB
建议将代码升级为现代 C++ 写法
参数:
code: 要分析的 C++ 代码
target_standard: 目标 C++ 标准,可选值:
- cpp11: C++11
- cpp14: C++14
- cpp17: C++17 (默认)
- cpp20: C++20
- cpp23: C++23
返回:
现代化建议报告,包括可以使用的新特性和重写示例
Inputs: code (required), target_standard. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose within C++ code analysis: memory safety, const correctness, include guards, naming conventions, and modern C++ suggestions. There is no overlap in functionality, and an agent can easily distinguish which tool to use for each specific code quality concern.
All tool names follow a consistent verb_noun pattern with snake_case (e.g., analyze_memory_safety, check_const_correctness, suggest_modern_cpp). The naming is predictable and readable throughout the set, with no deviations in style or convention.
With 5 tools, this server is well-scoped for a C++ style guide purpose. Each tool addresses a distinct aspect of code quality (memory, constness, includes, naming, modernization), making the count appropriate and manageable without being too sparse or overwhelming.
The tool set covers key areas of C++ style and safety analysis effectively, including memory, const correctness, includes, naming, and modernization. A minor gap is the lack of tools for other common style aspects like formatting, error handling patterns, or performance optimization suggestions, but core workflows are well-covered.
Maintenance
Related MCP Connectors
C++ engineering review, delivered per API call as an atom service on Conduit Atoms.
AI-powered codebase analysis — call graphs, security, dead code, complexity. 150+ tools.
AI code governance and code review for Claude Code, Copilot and Cursor. Checks rules and security.
Coding guidelines and best-practice guides for 130+ languages, frameworks, and tools.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides comprehensive codebase analysis including project structure evaluation, cross-language duplicate detection, microservices validation, and configuration optimization with AI-powered pattern learning that generates actionable improvement reports.MIT
- AlicenseAqualityBmaintenanceEnables AI assistants and developers to analyze code for language-specific best practices and idiomatic patterns across programming languages, CI automation, and configuration formats.1628 PyPI2MIT
- FlicenseNot gradedqualityCmaintenanceProvides precise C++ code semantic analysis for AI coding tools like Claude Code and Cursor by integrating clangd static analysis, enabling symbol definition lookup, reference tracking, and hover information.1-
- FlicenseNot gradedqualityCmaintenanceBuilds 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-