Skip to main content
Glama

cert-review-mcp

cert-review MCP server – quality and maintenance score on Glama

SEI CERT C and C++ code review as an MCP server, a CLI and two review skills, tuned for Ceph.

It does three things:

  1. Knows the standards. data/rules.json holds every rule and recommendation of the SEI CERT C standard (122 rules, 183 recommendations) and every rule of the SEI CERT C++ standard (83 rules), with paired noncompliant/compliant examples, the risk row (severity, likelihood, detectable, repairable, priority, level), CWE tags and the automated-detection tables. It is built reproducibly from a pinned upstream commit and checked against the standards' own index pages.

  2. Runs real analyzers and maps them to rule IDs. clang-tidy (cert-* and mapped checks), the Clang Static Analyzer and cppcheck, normalised to one finding schema, de-duplicated, filtered by a profile, and optionally limited to changed lines.

  3. Prepares the rest for a manual review layer without letting it make things up. For rules no checker covers, build_review_packet selects code hunks and the few rule texts worth reading; validate_findings rejects any finding that does not cite an existing rule ID and quote that rule's text.

Comments are only drafted and formatted. Nothing is ever posted to GitHub or GitLab by this project.

Not an official CERT or CMU product. See NOTICE for attribution (CC BY 4.0 text, MIT examples) and the pinned source commit.

Architecture

Architecture: data built by tools/, the engine in src/cert_review, and the MCP and CLI front ends

The diagram source is in docs/architecture.md.

Related MCP server: C++ Style Guide MCP Server

Coverage

Each rule is deterministic (a rule-specific checker exists, i.e. a clang-tidy cert-* check), partial (only general checkers are mapped) or llm-only (no checker). "Runnable" counts only checkers present in the supported toolchain (clang-tidy/clang 19.1.7, cppcheck 2.17.1).

Set

Total

Deterministic

Partial

LLM-only

Runnable: det / partial / llm-only

C rules

122

18

53

51

16 / 34 / 72

C recommendations

183

4

3

176

4 / 2 / 177

C++ rules

83

18

37

28

18 / 29 / 36

Measured precision and recall on the CERT examples: docs/accuracy.md. Rule counts versus the official index pages: docs/rule-counts.md. Results on a real Ceph subtree: docs/ceph-trial.md.

Install

git clone <this repository> cert-review-mcp && cd cert-review-mcp
python3 -m venv .venv && . .venv/bin/activate
pip install -e '.[dev]'
sudo apt-get install clang clang-tidy cppcheck       # static layer (optional but recommended)
pytest                                              # 105 tests

The package reads data/ and profiles/ from the checkout (set CERT_REVIEW_HOME to point elsewhere). Python 3.11+; works with the official mcp SDK 1.x (FastMCP, 1.15 or later) and 2.x (MCPServer).

Cursor

.cursor/mcp.json in your project (or ~/.cursor/mcp.json):

{
  "mcpServers": {
    "cert-review": {
      "command": "/path/to/cert-review-mcp/.venv/bin/cert-review-mcp",
      "env": { "CERT_REVIEW_HOME": "/path/to/cert-review-mcp" }
    }
  }
}

Then ask: "Use the cert-review ceph_review prompt on my current diff." Copy skills/ into your skills folder to make the review procedure available.

Docker

Dockerfile.mcp builds the MCP server with the analyzers included (no local clang or cppcheck needed). Mount your project at the same absolute path it has on the host:

docker build -f Dockerfile.mcp -t cert-review-mcp .
{
  "mcpServers": {
    "cert-review": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-v", "/home/me/proj:/home/me/proj:ro", "cert-review-mcp"]
    }
  }
}

The same mcpServers block works in Claude Desktop and Cursor. Release tags also publish multi-arch images (amd64, arm64) to Docker Hub as raminnietzsche/cert-review-mcp; use raminnietzsche/cert-review-mcp:latest instead of cert-review-mcp to skip the build. Details, the CLI from the image, and a tools/list check: docs/docker.md.

MCP Registry

The server is listed in the official MCP Registry as io.github.RaminNietzsche/cert-review-mcp (server.json), so clients that read the registry can install the Docker image from there.

Claude Code

claude mcp add cert-review -- /path/to/cert-review-mcp/.venv/bin/cert-review-mcp
mkdir -p ~/.claude/skills && cp -r skills/cert-review skills/ceph-cert-review ~/.claude/skills/

Use as a GitHub Action

- uses: actions/checkout@v4
  with: { fetch-depth: 0 }
- uses: RaminNietzsche/cert-review-mcp@v1
  with:
    profile: default            # or ceph
    fail-on: error
    upload-sarif: "true"        # SARIF to code scanning

Diff mode on pull requests, SARIF, a job summary, and optional inline review comments (review-comments: "true", off by default). A GitLab include template publishes Code Quality and SAST reports. Inputs, outputs and examples: docs/action.md, examples/github-workflow.yml.

MCP tools

Every tool is read-only: it reads local files and bundled data and runs local analyzers. Nothing is written, uploaded or posted. All tools declare MCP annotations, a title and, except format_findings, an output schema.

For check_diff and build_review_packet with pasted diff_text, files that are missing on the MCP host are reconstructed from the patch under repo (the directory is created when needed). On remote servers that cannot see your checkout, pass the unified diff and a logical root path (for example /workspace/ceph); omit repo to use a disposable tree under the system temp directory.

Tool

Purpose

list_rules(lang, category, kind, level, detectable, coverage, limit)

Filter the rule database; summaries with coverage tier

search_rules(query, limit, lang)

Rank rules by keyword relevance (API names, concepts, IDs)

get_rule(rule_id, profile, include_examples)

One rule: text, examples, risk row, CWE, checkers, profile notes

get_rule_coverage(lang, kind, include_ids)

Rule counts per tier: deterministic / partial / llm-only

check_files(path, profile, compdb, root, lang, tools, ...)

Analyzer findings for a file or a directory tree

check_diff(repo, base, head | diff_text, profile, compdb, ...)

Analyzer findings on changed lines only

build_review_packet(path | repo + base | diff_text, ...)

Code hunks plus candidate rule texts for manual review

validate_findings(findings, packet, profile)

Accept only grounded findings (rule ID + verbatim quote)

format_findings(findings, style, root, warnings)

markdown, github, gitlab, sarif, codequality or gitlab-sast; formatting only

MCP tool and parameter names changed after the v1 release; see CHANGELOG.md.

Resources: rule://EXP34-C, profile://ceph. Prompts: cert_review, ceph_review.

CLI

cert-review check src/common/Throttle.cc --profile ceph --compdb build --format markdown
cert-review diff --repo ~/ceph --base origin/main --profile ceph --format sarif -o out.sarif
cert-review diff --diff-file change.patch --format github > review.json   # payload only
cert-review explain EXP34-C
cert-review coverage --lang cpp
cert-review rules --lang cpp --coverage llm-only
cert-review packet --repo ~/ceph --base origin/main --profile ceph -o packet.json
cert-review validate findings.json --packet packet.json

--fail-on error|warning|note sets the exit code for CI. Silence one rule on a line with // cert-review: ignore EXP34-C reason.

Profiles

profiles/default.yaml is plain CERT. profiles/ceph.yaml encodes Ceph: C++23/C11, priority and severity per rule, suppressions with reasons (ceph_assert, dout, crimson, tests, vendored trees), and idioms (bufferlist, ceph::mutex, RefCountedObject, errno returns, asio/seastar callbacks) that tell the reviewer how each project construct changes a rule. Evidence for each idiom is cited inside the file.

Rebuilding the data

git clone https://github.com/cmu-sei/secure-coding-standards cert-src
python3 tools/build_rules.py --src cert-src            # fails if counts differ from the index pages
python3 tools/build_checker_map.py --codechecker <codechecker clone> --llvm <llvm-project clone>
python3 tools/build_corpus.py && python3 tools/eval_accuracy.py
python3 tools/ceph_compdb.py --ceph ~/ceph --out /tmp/ceph-compdb src/common   # cheap compile db

Limitations

  • Static coverage is thin by nature: most CERT rules are not decidable by tools; the llm-only and partial rules depend on the review layer and on a human.

  • Tools need compilable code. Without compile_commands.json many files do not parse and checks are skipped. The engine reports this instead of "no findings": the tool status becomes partial, the markdown, SARIF (executionSuccessful: false plus a toolExecutionNotifications warning), GitHub review, Action summary and CLI output carry a warning, and --fail-on-parse-error (alias --fail-on-partial; Action input fail-on-parse-error) turns it into a failing exit code. A file on which an analyzer hits its 300 s timeout is treated the same way.

  • Ceph needs Linux. Its sources include Linux-only headers (linux/version.h, ...) and Linux-only Boost.Asio features, so e.g. src/rgw/radosgw-admin/radosgw-admin.cc cannot be parsed on macOS even with the SDK sysroot and Homebrew Boost. Analyse Ceph on Linux, with the Docker image, or with the GitHub Action. tools/ceph_compdb.py adds -isysroot on macOS, which is enough for some directories (src/common) but not for all of them.

  • Mappings come from CodeChecker labels and clang-tidy aliases plus a small curated overlay; general analyzers can map to several rules, so the engine keeps the best few per line.

  • Ceph's profile is based on reading the code and on a limited trial, not on a full build.

License

Code: Apache-2.0 (LICENSE). Bundled CERT content: CC BY 4.0 (text) and MIT (examples); see NOTICE.

Available Tools

9 tools
build_review_packetBuild a SEI CERT review packetA
Read-onlyIdempotent

Build a packet for reviewing code against SEI CERT rules that analyzers cannot decide: code hunks, each with up to max_rules_per_hunk candidate rules (picked by token/API heuristics and profile idioms, rules fully covered by a specific checker left out) and their text excerpts. Diff mode (repo plus base or diff_text): changed lines with 3 lines of context. Path mode (path): whole files. Hunks are cut into 60-line windows. Use after check_diff or check_files; judge each hunk, then send your findings to validate_findings. Read-only; run_static=true also runs the analyzers (same cost as check_diff/check_files) to mark lines already reported. Output is large, roughly 5-25 KB per hunk.

Inputs: base, head, path, repo, +5 more. Returns: hunks, profile, instructions, rule_database, +3 more

check_diffCheck changed C/C++ lines for SEI CERT violationsA
Read-onlyIdempotent

Run the check_files analyzers on the C/C++ files of a change and keep only findings on added or modified lines. The change is base..head in the git repo at repo, base against the working tree when head is omitted, or a pasted unified diff (diff_text, paths relative to repo). Use for pull-request or pre-commit review; for whole files use check_files. Runs git diff and the analyzers locally; writes nothing. For git refs, files must exist at head or line numbers will not match. With diff_text, missing files are reconstructed under repo (or a temp tree when repo is omitted) so remote MCP hosts can review without your checkout. Check tools[].status and warnings before trusting an empty result.

Inputs: repo (required), base, head, tools, +5 more. Returns: root, files, notes, tools, +6 more

check_filesCheck C/C++ files for SEI CERT violationsA
Read-onlyIdempotent

Run clang-tidy, the Clang Static Analyzer and cppcheck on a C/C++ file or a directory (recursive) and return every finding mapped to SEI CERT rule IDs. Use for whole-file or whole-tree audits; for a change set use check_diff, which keeps only changed lines. Runs the analyzers as local subprocesses (4 in parallel, 300 s timeout per file and tool) and writes no files. Takes under a second per small file but minutes for large trees. Pass compdb when the project has a compilation database; without it flags are guessed and project headers are often missing. A tools[].status of 'partial' or non-empty warnings means some files did not compile or timed out, so an empty result is not proof.

Inputs: path (required), lang, root, tools, +4 more. Returns: files, notes, tools, profile, +4 more

format_findingsFormat SEI CERT findings as a reportA
Read-onlyIdempotent

Render findings as a report or review payload without sending it. style: markdown (string); github (object for POST /repos/{owner}/{repo}/pulls/{n}/reviews, event COMMENT, one comment per finding); gitlab (array of merge-request discussion bodies; position SHAs are placeholders to fill from diff_refs); sarif (SARIF 2.1.0 object); codequality (GitLab Code Quality array); gitlab-sast (GitLab SAST report object). Use as the last step, then show drafted comments to the user before anyone posts them. Pass findings unchanged from check_files/check_diff findings or validate_findings accepted. Pure formatting: no files, network or posting.

Inputs: findings (required), root, style, warnings.

get_ruleGet one SEI CERT ruleA
Read-onlyIdempotent

Return the full record of one SEI CERT rule: text, noncompliant and compliant code examples, exceptions, CERT risk assessment, CWE IDs, the checkers that detect it, and how the chosen profile adjusts or disables it. Use before judging or explaining a finding, or to copy the verbatim quote that validate_findings requires. Do not use to discover rules (use search_rules or list_rules). Reads bundled data only. Records are large (median ~10 KB, up to ~80 KB); set include_examples=false for text and risk only. An unknown ID returns an error listing close matches.

Inputs: rule_id (required), profile, include_examples. Returns: id, cwe, url, kind, +8 more

get_rule_coverageSummarize SEI CERT checker coverageA
Read-onlyIdempotent

Count SEI CERT rules per detection tier: deterministic (a rule-specific checker exists), partial (only general checkers map) and llm-only (no checker; manual review needed), both for all upstream checker mappings and for the pinned reference toolchain (clang-tidy and Clang Static Analyzer 19.1.7, cppcheck 2.17.1). Use to judge how much of a review static analysis can carry. Computed from bundled data; it does not probe the analyzers installed here (check_files reports those in tools[]). For one rule use get_rule; to list a tier's rules with titles use list_rules with coverage.

Inputs: kind, lang, include_ids. Returns: total, sources, toolchain, definitions, +2 more

list_rulesList SEI CERT rules by filterA
Read-onlyIdempotent

List SEI CERT C/C++ rules and recommendations from the bundled database (388 entries), filtered by language, category, kind, risk level, CERT detectability or checker coverage. Use to enumerate rules by structured criteria, e.g. all L1 C++ rules no checker detects. Do not use for free-text lookup (use search_rules) or for one rule's text and examples (use get_rule). Reads bundled data only; fast, no analyzers run. Returns summaries without rule text; count is the total before limit, so raise limit or narrow filters when truncated is true.

Inputs: kind, lang, level, limit, +3 more. Returns: count, rules, truncated

search_rulesSearch SEI CERT rules by keywordA
Read-onlyIdempotent

Rank SEI CERT C/C++ rules by keyword relevance to a free-text query: API names (strcpy, malloc, pthread_mutex_lock), concepts (integer overflow) or a rule ID. Use when you know what the code does but not which rule applies. Do not use for structured filters (use list_rules) or to read a rule (use get_rule). Matching is case-insensitive term counting over titles, rule text and examples, not semantic search; 1-character tokens are ignored and a query with no usable token returns an empty list. Reads bundled data only; fast.

Inputs: query (required), lang, limit. Returns: query, results

validate_findingsValidate manual SEI CERT findingsA
Read-onlyIdempotent

Accept or reject findings written from a build_review_packet review, with reasons. A finding passes only if its rule_id exists (C++ rules are rejected on .c files), its quote is a passage of 20+ characters found in that rule's text or examples (case, whitespace, curly quotes and markdown are normalised), it has a file, a line >= 1 and a message, and the profile does not disable the rule. With packet, the line must also fall inside a hunk whose candidate_rules include the rule. Use on every manual finding before format_findings; check_files and check_diff output needs no validation. Pure computation on the arguments; reads no files.

Inputs: findings (required), packet, profile. Returns: summary, accepted, rejected

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.6/5.0

    Scored across 9 tools

    Disambiguation4/5

    Each tool has a well-delimited job: check_files (whole tree) vs check_diff (changed lines) vs build_review_packet (LLM-judged hunks) are explicitly steered apart in their descriptions, and list_rules/search_rules/get_rule are differentiated by structured filters vs free text vs single record. The only soft overlap is get_rule_coverage counting tiers versus list_rules filtering by `coverage`, which descriptions partially resolve but could still cause a mispick.

    Naming Consistency5/5

    All nine tools are snake_case verb_noun or verb_noun_noun (check_diff, check_files, validate_findings, build_review_packet, format_findings, get_rule, get_rule_coverage, list_rules, search_rules). The get_/list_/search_/check_/build_/format_/validate_ prefixes map predictably to read, enumerate, query, analyze, construct, render and verify actions.

    Tool Count5/5

    Nine tools is well within the ideal 3-15 band and every one earns its place across the three phases of rule lookup, static analysis and manual review drafting. Nothing looks like a thin wrapper or an accidental duplicate.

    Completeness4/5

    The surface covers the full reviewed workflow: discover rules, run analyzers, build hunks, validate manual findings, and render to markdown/GitHub/GitLab/SARIF/Code Quality outputs. Minor gaps remain: profiles are referenced throughout (disabling rules, idioms) but no tool lists or inspects an available profile, and posting to a forge is deliberately left to the caller.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      F
      maintenance
      An MCP server that provides a comprehensive interface to Semgrep, enabling users to scan code for security vulnerabilities, create custom rules, and analyze scan results through the Model Context Protocol.
      6
      1,203 PyPI
      689
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      An MCP server for SonarQube that enables LLM agents to discover projects, analyze code quality metrics, check Quality Gate status, search issues with filters, and rank projects by worst-performing metrics. It provides read-only, safe access to SonarQube instances with structured outputs and error handling.
      5
      64 PyPI
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to scan code for security vulnerabilities using multiple static analysis tools, with support for filtering, deduplication, and CI/CD integration.
      27
      45 PyPI
      4
      MIT