Semgrep logo

Semgrep

by semgrep

Connects AI coding agents to Semgrep for deterministic code, dependency, and secret scanning 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.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

uvx semgrep

Process exited before answering initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

semgrep/semgrep MCP server exposes Semgrep analysis to AI coding agents through the Model Context Protocol. It runs through the Semgrep CLI and supports local stdio communication or a streamable HTTP endpoint. Scans can cover code security, supply-chain issues, and secrets across files generated or edited by an agent. Reach for it when an agent workflow needs automated Semgrep checks before code is accepted.

Use cases

  • Scan generated code for security vulnerabilities
  • Check dependencies for supply-chain risks
  • Detect secrets in agent-produced files
  • Run Semgrep analysis from an MCP-compatible IDE
  • Gate agent code revisions on clean scan results

Key features

  • Semgrep Code, Supply Chain, and Secrets scanning
  • stdio and streamable HTTP transports
  • Semgrep CLI entry point
  • Language-aware static analysis
  • Docker-compatible execution
  • Configurable HTTP port

Security & health

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

ActiveLast checked

Recent health check succeeded.

65/65 checks healthy over the last 45d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

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

Adoption & maintenance

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

GitHub stars18kStargazers on the source repository.
Last commitTodayMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Directory activity10 viewsConfig copies, upvotes, and views on AllMCPs.

How Semgrep works

What semgrep/semgrep MCP server does

semgrep/semgrep MCP server connects MCP-compatible agents and IDEs to Semgrep's static analysis engine. Semgrep is a deterministic scanner that understands multiple programming languages and provides a large rule registry for identifying security and code-quality issues.

The Guardian setup combines the MCP server with Semgrep Hooks and Skills for supported coding agents. In that workflow, files produced by an agent are scanned with Semgrep Code, Supply Chain, and Secrets checks. When a scan reports findings, the agent can be prompted to revise the generated code, or the user can dismiss the findings.

How it works

The server is started through the Semgrep CLI's mcp subcommand. It accepts MCP messages using one of two transports:

  • stdio: reads requests from standard input and writes responses to standard output, making it suitable for local client integrations and command-line usage.
  • Streamable HTTP: serves JSON-RPC responses over HTTP POST requests.

The default HTTP listener uses 127.0.0.1:8000/mcp. The server must be running before an HTTP client can connect. Its transport and port can be selected with command-line options, including --transport stdio, --transport streamable-http, and --port.

Setup and configuration

Install the Semgrep CLI before starting the MCP server. Homebrew installation is supported:

bash
brew install semgrep

The default local invocation is:

bash
semgrep mcp

A streamable HTTP instance can be started with:

bash
semgrep mcp -t streamable-http

Docker can run the stdio variant using the published Semgrep image:

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

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

HTTP server settings can also be adjusted through FASTMCP_* environment variables. The command-line interface provides --help and --version options.

Tools and capabilities

  • Scan source files with Semgrep's deterministic static analysis.
  • Check generated code for security vulnerabilities.
  • Run Semgrep Code, Supply Chain, and Secrets analysis in Guardian workflows.
  • Communicate with MCP clients over stdio.
  • Serve MCP requests over streamable HTTP.
  • Use Semgrep's language-aware rules and registry of more than 10,000 rules.

Limitations and notes

The Semgrep CLI is a prerequisite for local use. Stdio is intentionally quiet because it communicates through process streams rather than displaying an interactive prompt. Streamable HTTP uses a local address and requires the server process to remain active while clients connect. The project is under active development, so behavior and integrations may change.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

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 coding agents and IDEs to the Semgrep CLI. Its main tools support Semgrep Code, Supply Chain, and Secrets scanning, allowing agents to check generated or edited files for security vulnerabilities, dependency risks, and exposed secrets over stdio or streamable HTTP.

Install the Semgrep CLI first, for example with `brew install semgrep`, then start the server with `semgrep mcp`. Claude Code and Cursor users can install the Semgrep plugin through their respective marketplaces and run `/setup-semgrep-plugin`, which also installs the CLI.

Yes, semgrep/semgrep works with Cursor. Add Semgrep from the Cursor Plugin Marketplace, run `/setup-semgrep-plugin`, and restart Cursor to apply the configuration.

Start it with `semgrep mcp -t streamable-http`. The server listens by default at `127.0.0.1:8000/mcp`; use the `--port` option or supported `FASTMCP_*` environment variables to adjust the HTTP configuration.

Yes, Docker can run the stdio transport with `docker run -i --rm semgrep/semgrep semgrep mcp -t stdio`. This keeps the MCP process attached to standard input and output for a local client.

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>