Semgrep logo

Semgrep

by semgrep

Scans agent-generated code for security, supply-chain, and secret findings through Semgrep over MCP.

Install Semgrep

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": {
    "semgrep-semgrep": {
      "command": "uvx",
      "args": [
        "semgrep"
      ]
    }
  }
}

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

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

semgrep/semgrep connects AI coding agents and IDEs to Semgrep through the Semgrep CLI. It exposes code-analysis capabilities over stdio or streamable HTTP and can scan files with Semgrep Code, Supply Chain, and Secrets checks. Use it when an agent needs security feedback during code generation or development. The Guardian setup can also prompt an agent to regenerate code when findings are detected.

Use cases

  • Scan agent-generated code for security vulnerabilities
  • Check dependencies for supply-chain issues
  • Detect exposed secrets during development
  • Return Semgrep findings to an IDE coding agent

Key features

  • Semgrep Code analysis
  • Supply-chain checks
  • Secret detection
  • Stdio transport
  • Streamable HTTP transport
  • Claude Code and Cursor integrations

Security & health

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

ActiveLast checked Today

Recent health check succeeded.

32/32 checks healthy over the last 22d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 4d ago via OSV.dev · semgrep (PyPI)

Adoption & maintenance

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

GitHub stars17kStargazers on the source repository.
Last commit1d agoMost recent push to the default branch.
Directory activity5 viewsConfig copies, upvotes, and views on AllMCPs.

How Semgrep works

What semgrep/semgrep does

semgrep/semgrep brings Semgrep analysis into MCP-compatible agents and development environments. It is designed for security checks during agent-assisted coding, including analysis from Semgrep Code, Supply Chain, and Secrets. Semgrep is a deterministic static-analysis tool with semantic support for many programming languages and a registry containing more than 10,000 rules.

The Guardian experience combines the MCP server with hooks and skills. In that setup, files generated by an agent are scanned, and detected findings can cause the agent to regenerate the code until the scan is clean or the finding is dismissed.

How it works

The server runs through the Semgrep CLI's mcp subcommand. MCP clients communicate with it using either standard input and output or streamable HTTP. Stdio reads protocol messages from stdin and writes responses to stdout, making it suitable for local tools and editor integrations. Streamable HTTP sends JSON-RPC requests over HTTP and starts a server for clients to connect to.

With HTTP transport, the default endpoint is 127.0.0.1:8000/mcp. The server must remain running while clients connect. The listening behavior can be adjusted with FASTMCP_* environment variables.

Setup and configuration

Install the Semgrep CLI before starting the MCP server. One documented installation path is:

bash
brew install semgrep

Run the default local stdio server with:

bash
semgrep mcp

Start streamable HTTP instead with:

bash
semgrep mcp -t streamable-http

The command accepts a transport selection and a port option. Docker can run the stdio form interactively:

Terminal
docker run -i --rm semgrep/semgrep semgrep mcp -t stdio

Claude Code users can install Semgrep from its plugin marketplace and run /setup-semgrep-plugin; Cursor users can add it from the Cursor Plugin Marketplace, run the same setup skill, and restart Cursor. These plugin workflows also install the Semgrep CLI.

Tools and capabilities

  • Scan code with Semgrep Code checks.
  • Check dependencies and related supply-chain risks.
  • Detect secrets in files.
  • Return security findings to MCP-compatible agents.
  • Serve local clients through stdio.
  • Serve remote or separately managed clients through streamable HTTP.
  • Support integrations including Claude Code, Cursor, VS Code, and Windsurf.

Limitations and notes

The Semgrep CLI is a prerequisite for running the server directly. Stdio mode intentionally produces no visible terminal output while it waits for MCP messages, which can look like a stalled process. Streamable HTTP clients cannot connect unless the server is already running. The project is under active development.

Reviews

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

Frequently Asked Questions about Semgrep

semgrep/semgrep is an MCP server that connects AI agents and IDEs to Semgrep through the Semgrep CLI. Its code-analysis tools scan generated or selected files with Semgrep Code, Supply Chain, and Secrets checks, returning findings that agents can use while developing. It supports stdio and streamable HTTP transports.

Install the Semgrep CLI first, then run `semgrep mcp`. Homebrew users can install it with `brew install semgrep`. Docker is also supported for stdio mode with the published Semgrep image.

Yes, semgrep/semgrep works with Cursor through the Cursor Plugin Marketplace. Add the Semgrep plugin, run `/setup-semgrep-plugin` to configure it and install the CLI, then restart Cursor.

Run `semgrep mcp -t streamable-http` to start the streamable HTTP transport. It listens by default at `127.0.0.1:8000/mcp`; the server must stay running while clients connect.

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 PreviewSemgrep AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/semgrep-semgrep?style=directory)](https://allmcps.com/mcp/semgrep-semgrep)
HTML Embed
<a href="https://allmcps.com/mcp/semgrep-semgrep"><img src="https://allmcps.com/api/badge/semgrep-semgrep?style=directory" alt="Semgrep on AllMCPs" /></a>