MCP Code Sanitizer logo

MCP Code Sanitizer

by notasandy

Reviews code for bugs and security issues, compares revisions, explains logic, generates tests, and creates HTML reports.

Install MCP Code Sanitizer

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "notasandy-mcp-code-sanitizer": {
      "command": "uvx",
      "args": [
        "mcp-code-sanitizer"
      ],
      "env": {
        "GROQ_API_KEY": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Install not yet sandbox-tested— the server itself is confirmed live (we called its tools/list endpoint). The stdio install command is a separate, ongoing check.

Overview

notasandy/mcp-code-sanitizer MCP server exposes code review and analysis tools through MCP, using Groq for LLM-based results. It accepts code fragments, code files, and pairs of revisions, then returns structured findings, explanations, test cases, comparisons, or HTML reports. Reach for it when an MCP-compatible coding client needs automated security review, refactoring checks, test generation, or file-level analysis.

Use cases

  • Review code for bugs, vulnerabilities, and SQL injection risks
  • Compare refactored code with its previous version
  • Generate tests for functions using a selected framework
  • Explain unfamiliar code for a specified audience level
  • Create HTML reports from code analysis results

Key features

  • Groq-backed code analysis
  • Structured revision comparison with merge recommendations
  • Step-by-step code explanations
  • Test generation with optional frameworks
  • Whole-file analysis with chunking
  • HTML report generation and cache management

Tools7

What MCP Code Sanitizer lets your agent do. Expand a tool for its parameters.

Verified live~1.0k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

21/25 checks healthy over the last 91d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 7d ago via OSV.dev · mcp-code-sanitizer (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars3Stargazers on the source repository.
Last commit5mo agoMost recent push to the default branch.
Tools exposed7Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP Code Sanitizer works

What notasandy/mcp-code-sanitizer MCP server does

notasandy/mcp-code-sanitizer MCP server provides an MCP interface for reviewing and understanding source code. Its primary review operation looks for bugs, vulnerabilities, security issues, and SQL injection risks, and returns a structured result that can include a summary, score, issue severity, affected line, explanation, suggested fix, warnings, and recommendations.

The server also supports tasks beyond defect detection. It can explain a code fragment for a junior, middle, or senior audience; generate tests for a supplied function or code section; compare an earlier and later version; inspect an entire file; and turn analysis results into an HTML report. These capabilities fit code review, refactoring validation, AI-generated code checks, and developer education workflows.

How it works

The server runs as a FastMCP application and sends analysis requests to the Groq API. The default model is llama-3.3-70b-versatile, although the model can be changed through configuration. The client communicates with the server over MCP, while the server handles the Groq request and formats the result for the calling agent.

compare_code performs a structured evaluation of two versions. Its result distinguishes improvements, regressions, and neutral changes, then provides a recommendation to merge or request changes. analyze_file determines the language from the file extension. Larger files are divided into chunks and analyzed in parallel. Results may be cached in memory with a time-to-live and entry limit.

Setup and configuration

notasandy/mcp-code-sanitizer MCP server requires a Groq API key. The key can be supplied in the MCP client configuration as GROQ_API_KEY, or through a .env file when running the project manually. The documented package-based setup uses uvx mcp-code-sanitizer; manual installation uses the repository requirements and starts server.py with Python.

The README provides configurations for Claude Desktop, Cursor, VS Code, and Claude Code CLI. VS Code requires version 1.99 or newer with GitHub Copilot. If uvx is unavailable, the documented prerequisite is installing the uv package with pip.

Optional settings include GROQ_MODEL, CACHE_TTL, and CACHE_MAX. They select the Groq model, define cache lifetime in seconds, and limit the number of cached entries. The default values are llama-3.3-70b-versatile, 3600, and 200 respectively.

Tools and capabilities

  • analyze_code: Reviews a code fragment for defects and security problems and returns a scored analysis.
  • compare_code: Evaluates whether a change improves the code and identifies regressions or neutral differences.
  • explain_code: Produces a step-by-step explanation with concepts and potential gotchas.
  • generate_tests: Creates test cases and runnable test code; an optional framework can include pytest, Jest, or unittest.
  • analyze_file: Reads and analyzes a file from disk, detecting its language from the extension.
  • generate_report: Converts analysis JSON into an HTML report and can save it to a specified path.
  • cache_info: Reports cache statistics or clears the in-memory cache.

The repository also documents a GitHub Action that reviews changed pull-request files, posts a structured comment, and fails the check when critical issues are found. That workflow uses the same Groq API key through a repository secret.

Limitations and notes

notasandy/mcp-code-sanitizer MCP server depends on Groq availability and a valid API key, so its findings are LLM-generated review results rather than a replacement for execution, deterministic static analysis, or human review. The documented GitHub Action reviews up to 10 changed files per pull request. Support for other LLM providers is listed as a future contribution rather than an existing configuration option.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Code Sanitizer

notasandy/mcp-code-sanitizer is an MCP server that connects MCP-compatible coding clients to Groq for AI code review. Its main tools analyze code, compare revisions, explain code, generate tests, analyze files, create HTML reports, and inspect or clear the analysis cache.

Install it with `uvx mcp-code-sanitizer` after setting `GROQ_API_KEY` in the client configuration.

Yes, it works with Cursor through a project-level `.cursor/mcp.json` file or a global `~/.cursor/mcp.json` file. Configure the server command as `uvx`, pass `mcp-code-sanitizer` as its argument, and provide `GROQ_API_KEY` in the environment.

It requires `GROQ_API_KEY` to call the Groq API. You can also set `GROQ_MODEL`, `CACHE_TTL`, and `CACHE_MAX` to select the model and configure cache behavior, but the README marks only the API key as required.

Yes, `analyze_file` reviews a file from disk and detects its language from the extension, while `generate_report` creates an HTML report from `analyze_code` or `analyze_file` results. The report tool can optionally save the output to a path.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Code Sanitizer AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/notasandy-mcp-code-sanitizer?style=directory)](https://allmcps.com/mcp/notasandy-mcp-code-sanitizer)
HTML Embed
<a href="https://allmcps.com/mcp/notasandy-mcp-code-sanitizer"><img src="https://allmcps.com/api/badge/notasandy-mcp-code-sanitizer?style=directory" alt="MCP Code Sanitizer on AllMCPs" /></a>