# semgrep/semgrep [Official] [Health: Active]

**Category:** 🔒 Security  
**Repository:** https://github.com/semgrep/semgrep/tree/develop/cli/src/semgrep/mcp  
**GitHub Stars:** 18083  
**Views:** 10  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/semgrep-semgrep

## Description
Scan code for security vulnerabilities using Semgrep.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "semgrep": {
    "command": "uvx",
    "args": ["semgrep"]
  }
}
```

## Documentation

## 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:

```bash
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.

_Full upstream README: https://allmcps.com/mcp/semgrep-semgrep/readme_

