MCPdir β€” MCP Server Directory
πŸ‡¬πŸ‡§ πŸ‡ͺπŸ‡Έ

Semgrep MCP

by Semgrep

Enable AI agents to secure code with Semgrep SAST scanning and pattern matching

security Python Intermediate Self-hostable Verified
⭐ 200 stars πŸ“… Updated: 1mo ago

Description

Official Semgrep MCP server that lets AI agents run static analysis security testing directly on your code. Powered by Semgrep's pattern-matching engine, it enables code scanning for vulnerabilities, bug patterns, and style enforcement using Semgrep's extensive rule library with 3,000+ community and pro rules. AI assistants can scan code, retrieve findings with contextual explanations, search for specific patterns, and help fix issues β€” all without leaving the conversation. Supports custom rules alongside the Semgrep Registry, making it adaptable to team-specific coding standards and security policies.

βœ… Best for

Development teams wanting AI-assisted security scanning integrated into their coding workflow

⏭️ Skip if

You need deep data-flow analysis or already use a different SAST tool you prefer

πŸ’‘ Use cases

  • Scanning code for security vulnerabilities and bug patterns during AI-assisted development
  • Finding specific code patterns using Semgrep's pattern syntax via natural language
  • Getting AI-generated explanations and fix suggestions for security findings
  • Enforcing coding standards and security policies through automated scanning

πŸ‘ Pros

  • βœ“ Official Semgrep project with access to 3,000+ security and code quality rules
  • βœ“ Fast pattern-matching engine that works across 30+ programming languages
  • βœ“ Supports custom rules for team-specific standards alongside the Semgrep Registry
  • βœ“ AI provides contextual explanations and fix suggestions for each finding

πŸ‘Ž Cons

  • βœ— Requires a Semgrep token for full rule access (free tier available)
  • βœ— Pattern-based analysis may miss complex vulnerabilities requiring data flow tracking
  • βœ— Scanning large codebases may take significant time depending on rule set

πŸ”§ Exposed tools (4 tools)

ToolCategoryDescription
scan_codeanalysisRun Semgrep scan on code files or directories
list_rulesconfigurationList available Semgrep rules and rulesets
get_findingsresultsRetrieve scan findings with code context and severity
search_patternssearchSearch for specific code patterns using Semgrep pattern syntax

⚑ Installation

Prerequisites:

  • β€’ python v3.10+
  • β€’ Semgrep token (from semgrep.dev)
  • β€’ API key required

Check Claude Code documentation to configure this MCP server.

πŸ’‘ Tips & tricks

Start with Semgrep's default ruleset (p/default) for broad coverage. Ask the AI to scan specific files or directories rather than the entire repo for faster results.

πŸ”„ Alternatives

Quick info

Author
Semgrep
License
MIT
Runtime
Python 3.10+
Transport
stdio
Category
security
Difficulty
Intermediate
Self-hostable
βœ…
Auth
β€”
Docker
β€”
Version
latest
Updated
Feb 12, 2026

Client compatibility

  • βœ… Claude Code
  • βœ… Cursor
  • βœ… VS Code Copilot
  • ❓ Gemini CLI
  • ❓ Windsurf
  • ❓ Cline
  • ❓ JetBrains AI
  • ❓ Warp

Platforms

🍎 macOS 🐧 Linux πŸͺŸ Windows