Labsco
SongJiangzhou logo

C++ Core Guidelines

from SongJiangzhou

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.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeQuick setup

δΈ­ζ–‡ | 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

ToolDescription
check_namingValidate C++ identifiers (variables, classes, functions, etc.) against naming conventions
check_include_guardVerify header file include guards or #pragma once usage
analyze_memory_safetyDetect memory leaks, dangling pointers, and unsafe memory patterns
suggest_modern_cppGet modernization suggestions targeting C++11 through C++23
check_const_correctnessFind missing const qualifiers on member functions, parameters, and variables

Resources

URIDescription
cpp-style://naming/{category}Naming convention reference (variable, class, function, namespace, …)
cpp-style://best-practices/{topic}Best practice guides (memory, exceptions, templates, concurrency, …)
cpp-style://standard/{version}C++ standard feature docs (cpp11 – cpp23)
cpp-style://examples/{pattern}Design pattern examples (RAII, Pimpl, Factory, Observer, …)

Prompts

PromptDescription
code_reviewCode review template (general / performance / safety / readability / modern)
refactor_suggestionRefactoring guide targeting a specific C++ standard

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/memory

Project 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