惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
B
Blog RSS Feed
美团技术团队
博客园 - 【当耐特】
C
Check Point Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
M
MIT News - Artificial intelligence
aimingoo的专栏
aimingoo的专栏
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 司徒正美
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
Google DeepMind News
Google DeepMind News
D
DataBreaches.Net
人人都是产品经理
人人都是产品经理
N
Netflix TechBlog - Medium
Vercel News
Vercel News
P
Proofpoint News Feed
IT之家
IT之家
I
InfoQ
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I built an MCP server that reviews your code with Groq — ...
Sandy · 2026-05-05 · via DEV Community

Sandy

The problem

AI-generated code is everywhere. GitHub Copilot, Claude, ChatGPT — they all write code fast. But they also introduce subtle bugs, SQL injections, and insecure patterns that look totally fine at first glance.

I wanted a tool that sits inside my AI agent and reviews code before I ship it. Not a linter. Not a static analyzer. A strict senior engineer who actually explains why something is wrong and shows the fix.

What I built

mcp-code-sanitizer — an MCP server that plugs into Claude Desktop or Cursor and gives you a strict AI code review powered by Groq's free API (llama-3.3-70b).

Claude Desktop ──MCP──► code-sanitizer ──REST──► Groq API

Enter fullscreen mode Exit fullscreen mode

Tools available

Tool What it does
analyze_code Finds bugs, vulnerabilities, rates 0–100
compare_code Compares versions, detects regressions
explain_code Step-by-step explanation for any level
generate_tests Writes pytest/jest tests automatically
analyze_file Analyzes whole files with parallel chunking
generate_report Builds an HTML report

Real example

I gave it this code:

def get_user(user_id):
    query = f"SELECT * FROM users WHERE id = {user_id}"
    return db.execute(query)

Enter fullscreen mode Exit fullscreen mode

It returned in 2 seconds:

{
  "summary": "Critical SQL injection vulnerability",
  "score": 23,
  "issues": [{
    "severity": "critical",
    "line": 2,
    "title": "SQL Injection",
    "description": "f-string directly interpolates user_id into SQL query",
    "fix": "cursor.execute('SELECT * FROM users WHERE id = %s', (user_id,))"
  }]
}

Enter fullscreen mode Exit fullscreen mode

Score 23/100. Ouch. But accurate.

Why Groq?

  • Free tier — generous limits, no credit card needed
  • Fast — llama-3.3-70b responds in ~1-2 seconds
  • JSON mode — structured output without parsing hacks

Architecture

The codebase is split into focused modules:

server.py       # FastMCP entry (39 lines)
config.py       # Constants
groq_client.py  # API client with auto-retry on rate limits
cache.py        # In-memory cache with TTL
prompts.py      # System prompts
tools/          # One file per tool

Enter fullscreen mode Exit fullscreen mode

The cache layer means identical code isn't sent to Groq twice — useful when reviewing the same function repeatedly during debugging.

GitHub Action included

The repo includes a GitHub Action that automatically reviews every PR and posts a structured comment:

- uses: actions/checkout@v4
# ... runs review_pr.py on changed files
# posts comment with issues, warnings, suggestions
# fails check if critical issues found

Enter fullscreen mode Exit fullscreen mode

Get started in 3 commands

git clone https://github.com/notasandy/mcp-code-sanitizer
pip install -r requirements.txt
fastmcp dev inspector server.py

Enter fullscreen mode Exit fullscreen mode

Get a free Groq key at console.groq.com and you're done.

Published everywhere

Would love to hear what you think — especially if you find bugs the sanitizer missed 😄