Semgrep
MCP ServerFree** - Enable AI agents to secure code with [Semgrep](https://semgrep.dev/).
Capabilities13 decomposed
mcp-standardized static code security scanning
Medium confidenceExposes Semgrep's static analysis engine through the Model Context Protocol (MCP), allowing AI agents and IDEs to invoke security vulnerability detection via a standardized tool interface. The SemgrepMCPServer class orchestrates FastMCP framework bindings to translate MCP tool calls into Semgrep CLI invocations, returning structured vulnerability findings with file paths, line numbers, and severity metadata. This bridges Semgrep's native CLI with AI-native tool-calling conventions.
Built on FastMCP framework with SemgrepMCPServer as central orchestrator, providing native MCP tool bindings for Semgrep rather than wrapping CLI calls in generic function-calling; supports three transport protocols (stdio, streamable-http, SSE) for diverse client integration patterns
Standardizes Semgrep access through MCP protocol, enabling AI agents to invoke security scanning with native tool-calling semantics rather than shell execution or custom API wrappers
custom semgrep rule creation with ai-assisted prompting
Medium confidenceProvides an MCP Prompt resource that guides AI models through the process of writing custom Semgrep rules in YAML format. The server exposes a structured prompt template (write_custom_semgrep_rule) that contextualizes rule authoring with schema documentation and examples, allowing AI agents to generate domain-specific security rules without manual YAML syntax learning. The prompt integrates with the semgrep://rule/schema resource to provide real-time schema validation context.
Integrates MCP Prompt resources with schema documentation (semgrep://rule/schema) to provide contextual guidance for rule authoring, enabling AI models to generate syntactically valid YAML rules without external documentation lookup
Combines AI-assisted prompting with schema context in a single MCP interface, reducing friction for non-experts to create custom rules compared to manual YAML editing or external documentation consultation
pypi package distribution with pip, pipx, and uv support
Medium confidenceThe Semgrep MCP Server is distributed via PyPI as the semgrep-mcp package, supporting installation via pip, pipx (isolated environments), and uv (fast Python package manager). This enables lightweight local installation without containerization, suitable for CLI tools, IDE plugins, and development environments. The package includes all necessary dependencies and Semgrep CLI bindings.
Distributed via PyPI with support for multiple Python package managers (pip, pipx, uv), enabling flexible installation patterns from isolated environments to fast package managers
Supports multiple installation methods (pip, pipx, uv) via PyPI, providing flexibility for different development workflows compared to Docker-only or source-only distributions
hosted mcp service for zero-configuration web-based ai platform integration
Medium confidenceSemgrep provides a hosted MCP service at mcp.semgrep.ai that eliminates the need for users to self-host the MCP server. Web-based AI platforms (e.g., Claude web interface) can directly connect to this hosted service without configuration, enabling seamless Semgrep integration for non-technical users. The hosted service handles authentication, scaling, and infrastructure management.
Provides a managed hosted MCP service (mcp.semgrep.ai) for zero-configuration integration with web-based AI platforms, eliminating self-hosting requirements and infrastructure management
Offers managed hosted service for web-based AI platforms, reducing friction compared to self-hosting or local installation for non-technical users
path traversal protection and filesystem access control
Medium confidenceThe Semgrep MCP Server implements security measures to prevent path traversal attacks, restricting file access to authorized directories and preventing directory traversal via relative paths (e.g., ../../../etc/passwd). The server validates all file paths before passing them to Semgrep CLI, ensuring that scans are confined to intended code directories. This protects against malicious or accidental access to sensitive files outside the scan scope.
Implements built-in path traversal protection at the MCP server level, validating all file paths before Semgrep execution to prevent unauthorized filesystem access
Provides server-side path validation to prevent traversal attacks, whereas alternatives relying on OS-level permissions or client-side validation are more vulnerable to misconfiguration
abstract syntax tree (ast) generation and inspection
Medium confidenceExposes Semgrep's AST parsing capabilities through the get_abstract_syntax_tree MCP tool, allowing clients to request parsed syntax trees for code snippets in supported languages. The server invokes Semgrep's language-specific parsers (tree-sitter based) to generate structured AST representations, enabling AI agents to reason about code structure for pattern matching, refactoring, or security analysis without implementing language-specific parsers.
Leverages Semgrep's tree-sitter-based parsers (supporting 40+ languages) to provide unified AST generation interface via MCP, avoiding the need for clients to implement language-specific parsing logic
Provides multi-language AST generation through a single MCP tool interface, whereas alternatives like Language Server Protocol (LSP) require per-language server implementations
semgrep rule schema and documentation resource access
Medium confidenceExposes two MCP Resources that provide rule schema documentation: semgrep://rule/schema (YAML syntax schema for rule authoring) and semgrep://rule/{rule_id}/yaml (specific rule YAML content). These resources allow clients to query rule structure, syntax requirements, and example rules without external documentation, enabling AI agents and developers to understand rule authoring constraints and inspect existing rule implementations for reference.
Exposes Semgrep rule schema and content as MCP Resources (not Tools), enabling efficient caching and reference-based access patterns; integrates with rule generation workflows by providing schema context without requiring external documentation
Provides in-process access to rule schema and examples via MCP Resources, reducing latency and external dependencies compared to fetching documentation from web or external APIs
language support discovery and capability querying
Medium confidenceThe supported_languages MCP tool returns a list of all programming languages that Semgrep can analyze, including language identifiers and parser capabilities. This enables clients to dynamically discover which languages are supported before attempting analysis, allowing AI agents to gracefully handle unsupported languages or inform users of available analysis targets.
Provides dynamic language capability discovery through MCP, allowing clients to query supported languages at runtime rather than hardcoding language lists
Enables runtime language capability discovery via MCP, whereas static documentation or hardcoded lists require manual updates when Semgrep adds language support
configurable code scanning with custom rule sets
Medium confidenceThe semgrep_scan MCP tool accepts a file path and optional configuration parameter, allowing clients to scan code with specific Semgrep configurations (e.g., custom rule files, severity filters, or predefined rulesets). The server translates MCP parameters into Semgrep CLI arguments, enabling flexible scanning workflows without requiring clients to understand Semgrep CLI syntax. Configuration can reference local rule files, registry rules, or inline rule definitions.
Accepts configuration parameters as MCP tool arguments, translating them into Semgrep CLI flags; supports both file-based and inline configuration without requiring clients to understand Semgrep CLI syntax
Provides configuration-driven scanning through MCP tool parameters, enabling flexible ruleset selection without hardcoding rules or requiring CLI knowledge
custom inline semgrep rule scanning
Medium confidenceThe semgrep_scan_with_custom_rule MCP tool accepts code and an inline Semgrep rule definition (YAML), allowing clients to scan code against a custom rule without requiring a separate rule file. The server parses the inline rule, validates it against the Semgrep rule schema, and executes a scan, returning findings that match the custom rule. This enables dynamic rule creation and testing workflows where rules are generated or modified at runtime.
Accepts inline YAML rule definitions as MCP tool parameters, enabling rule testing and validation without filesystem dependencies; integrates with AI-assisted rule generation workflows
Supports inline rule definitions via MCP tool parameters, enabling dynamic rule testing without file I/O, whereas traditional Semgrep usage requires rule files on disk
semgrep rule json schema exposure
Medium confidenceThe semgrep_rule_schema MCP tool returns the JSON schema definition for Semgrep rules, allowing clients to programmatically validate rule definitions, generate rule templates, or provide schema-aware IDE autocomplete. The schema describes all valid rule fields, their types, constraints, and required properties, enabling clients to build rule authoring tools with schema validation.
Exposes Semgrep's rule JSON schema as an MCP tool, enabling programmatic schema-based validation and IDE integration without requiring external schema files or documentation
Provides runtime access to rule schema via MCP, enabling dynamic schema-based validation and IDE tooling, whereas static schema files require manual updates and external distribution
multi-protocol mcp server transport with stdio, http, and sse support
Medium confidenceThe Semgrep MCP Server supports three transport protocols (stdio, streamable-http, SSE) through FastMCP framework integration, allowing clients to connect via different communication channels based on their architecture. Stdio is default for local CLI and IDE integrations, streamable-http for web-based clients, and SSE for backwards compatibility. The server automatically handles protocol negotiation and message serialization, abstracting transport complexity from tool implementations.
Built on FastMCP framework with native support for three transport protocols (stdio, streamable-http, SSE), providing unified MCP interface across diverse client architectures without requiring protocol-specific implementations
Supports multiple transport protocols through a single server implementation, whereas custom integrations typically require separate server implementations per protocol
multi-architecture docker deployment with security attestations
Medium confidenceThe Semgrep MCP Server is distributed as Docker images supporting multi-architecture builds (linux/amd64, linux/arm64) via ghcr.io/semgrep/mcp, with built-in security attestations (SBOM and provenance). The Docker images include all dependencies and Semgrep CLI, enabling zero-configuration containerized deployment. Images are signed and include software bill of materials (SBOM) for supply chain security verification.
Provides multi-architecture Docker images (amd64, arm64) with built-in security attestations (SBOM, provenance signatures), enabling secure and portable containerized deployment without manual dependency installation
Offers pre-built multi-architecture images with security attestations, reducing deployment friction compared to building from source or managing dependencies manually
Capabilities are decomposed by AI analysis. Each maps to specific user intents and improves with match feedback.
Related Artifactssharing capabilities
Artifacts that share capabilities with Semgrep, ranked by overlap. Discovered automatically through the match graph.
Semgrep
Static analysis — custom rules for bugs and security, 30+ languages, AI-powered triage.
MCP Hunt
** - Realtime platform for discovering trending MCP servers with momentum tracking, upvoting, and community discussions - like Product Hunt meets Reddit for MCP
Semgrep CLI
AI-powered static analysis for security.
agentshield
AI agent security scanner. Detect vulnerabilities in agent configurations, MCP servers, and tool permissions. Available as CLI, GitHub Action, ECC plugin, and GitHub App integration. 🛡️
@aikidosec/mcp
Aikido MCP server
Sourcery
AI code review agent for pull requests.
Best For
- ✓AI agent developers building security-focused workflows
- ✓IDE plugin developers integrating static analysis
- ✓Teams standardizing on MCP for tool integration
- ✓Security teams without Semgrep expertise
- ✓AI agent developers building rule-generation workflows
- ✓Organizations with custom security policies requiring custom rules
- ✓Individual developers and small teams
- ✓Development and testing environments
Known Limitations
- ⚠Scanning performance depends on Semgrep CLI execution time; no built-in caching across requests
- ⚠MCP protocol adds serialization overhead for large result sets (100+ findings)
- ⚠Requires Semgrep binary installed locally or in container; no remote execution by default
- ⚠AI-generated rules may require manual validation; no automatic testing against known patterns
- ⚠Prompt quality depends on AI model's understanding of security patterns and YAML syntax
- ⚠No built-in rule versioning or deployment pipeline; generated rules must be manually integrated
Requirements
Input / Output
UnfragileRank
UnfragileRank is computed from adoption signals, documentation quality, ecosystem connectivity, match graph feedback, and freshness. No artifact can pay for a higher rank.
About
** - Enable AI agents to secure code with [Semgrep](https://semgrep.dev/).
Categories
Alternatives to Semgrep
Are you the builder of Semgrep?
Claim this artifact to get a verified badge, access match analytics, see which intents users search for, and manage your listing.
Get the weekly brief
New tools, rising stars, and what's actually worth your time. No spam.
Data Sources
Looking for something else?
Search →