mcp-code-sanitizer

by notasandy

Not rated
GitHub

About

Strict AI code reviewer powered by Groq. Finds bugs, SQL injections, hardcoded secrets and vulnerabilities. Scores code 0–100 with concrete fixes.

Details

Author
notasandy
Categories
Developer Tools, Security, AI

Setup

Install mcp-code-sanitizer in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/notasandy/mcp-code-sanitizer

Follow the installation instructions in the repository README, then restart your MCP client.

Strict AI code reviewer powered by Groq. Finds bugs, SQL injections, hardcoded secrets and vulnerabilities. Scores code 0–100 with concrete fixes.

Strict AI-powered code reviewer for Claude Desktop, Cursor, VS Code, and Claude Code CLI. Finds bugs, vulnerabilities, and security issues — powered by Groq (free API).

Claude / Cursor / VS Code ──MCP──► code-sanitizer ──REST──► Groq API (server.py) (llama-3.3-70b)
{ "summary": "Critical SQL injection and secret exposed in logs", "score": 23, "issues": [ { "severity": "critical", "line": 2, "title": "SQL Injection", "description": "f-string directly interpolates user_id into query", "fix": "cursor.execute('SELECT  FROM users WHERE id = %s', (user_id,))" } ], "warnings": [{"title": "No exception handling", "description": "..."}], "suggestions": ["Consider using an ORM instead of raw SQL"] }

Prerequisite:Get a free Groq API key atconsole.groq.com/keys— no credit card required.

claude mcp add code-sanitizer -e GROQ_API_KEY=gsk_your_key -- uvx mcp-code-sanitizer
{ "mcpServers": { "code-sanitizer": { "command": "uvx", "args": ["mcp-code-sanitizer"], "env": { "GROQ_API_KEY": "gsk_your_key_here" } } } }

Create.cursor/mcp.jsonin your project (or~/.cursor/mcp.jsonglobally):

{ "mcpServers": { "code-sanitizer": { "command": "uvx", "args": ["mcp-code-sanitizer"], "env": { "GROQ_API_KEY": "gsk_your_key_here" } } } }

Requires VS Code 1.99+ with GitHub Copilot. Create.vscode/mcp.jsonin your project:

{ "servers": { "code-sanitizer": { "command": "uvx", "args": ["mcp-code-sanitizer"], "env": { "GROQ_API_KEY": "gsk_your_key_here" } } } }

Or add globally viaCtrl+Shift+P → "MCP: Add Server".

Don't haveuvx?Install it withpip install uv, then use the commands above.

git clone https://github.com/notasandy/mcp-code-sanitizer cd mcp-code-sanitizer pip install -r requirements.txt cp .env.example .env # add your GROQ_API_KEY python server.py
{ "command": "python", "args": ["/full/path/to/server.py"], "env": { "GROQ_API_KEY": "gsk_your_key_here" } }

Add AI code review to any repository in 5 lines. The action posts a structured comment on every PR with score, issues, and fix suggestions.

# .github/workflows/ai-review.yml name: AI Code Review on: pull_request: types: [opened, synchronize] permissions: contents: read pull-requests: write jobs: review: runs-on: ubuntu-latest steps: - uses: notasandy/mcp-code-sanitizer@v1 with: groq_api_key: ${{ secrets.GROQ_API_KEY }}

AddGROQ_API_KEYto your repository secrets →Settings → Secrets → Actions.

- Reviews only changed files (up to 10 per PR)
- Posts a score and structured issue list as a PR comment
- Fails the check if critical issues are found

Review this code for vulnerabilities: def get_user(user_id): query = f"SELECT  FROM users WHERE id = {user_id}" return db.execute(query)
analyze_file /path/to/my_script.py generate_tests for this function: ... compare_code — before vs after refactor, did it get better? generate_report and save to /tmp/report.html
mcp-code-sanitizer/ ├── server.py # FastMCP entry point ├── config.py # Constants — keys, limits, extension map ├── groq_client.py # Async Groq client with auto-retry on 429 ├── cache.py # In-memory LRU cache with TTL ├── prompts.py # System prompts for all tools └── tools/ ├── analyze.py # analyze_code ├── compare.py # compare_code ├── explain.py # explain_code ├── tests.py # generate_tests ├── file_tool.py # analyze_file — chunking + parallel analysis ├── cache_tool.py # cache_info └── report.py # generate_report — HTML output

All settings via.envor environment variables:

PRs and Issues are welcome. Most wanted:

- Support for other LLM providers (OpenAI, Anthropic)
- New tools: dependency audit, complexity score, docstring generator
- Prompt improvements and new language support

MIT — do whatever you want. A star would be appreciated.

- PyPI
-
Groq Console — free API key
-
FastMCP docs
-
MCP specification
-
Smithery
-
MCP Registry

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

AI-powered code quality analysis to detect best practice violations, security issues, and architectural problems in real-time.

Boost security in your dev lifecycle via SAST, SCA, Secrets & IaC scanning with Cycode.

Enable AI agents to secure code with Semgrep.

AI-powered security scanning. Scans code, files, and git diffs for vulnerabilities in real-time using the Armis scanning API.

MCP server providing x402 micropayment-powered developer tools including screenshot capture, AI analysis, PDF generation, code security scanning, and dependency auditing via USDC payments on Base.

Access the Codacy API to analyze code quality, coverage, and security for your repositories.

Your AI Code Review Council - Get diverse perspectives from multiple AI models in parallel.

MCP Server for local code security scanning - detects secrets, vulnerable dependencies, and insecure code patterns

Performs complementary code analysis by combining Claude Code and Google's Gemini AI.

An MCP server for the DeepSeek API, providing code review, file management, and account management.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.