---
title: "Semgrep CLI MCP: review, setup & limitations · Undominated.ai"
canonical: https://undominated.ai/mcp-servers/semgrep-cli/
description: "Run Semgrep scans and inspect rule or platform findings through the maintained MCP server inside the Semgrep CLI."
---

# Semgrep CLI MCP: review, setup & limitations · Undominated.ai

> Run Semgrep scans and inspect rule or platform findings through the maintained MCP server inside the Semgrep CLI.

[← Explore all mcp servers](/mcp-servers/)

CODE SECURITY / Semgrep

# Semgrep CLI MCP

Run Semgrep scans and inspect rule or platform findings through the maintained MCP server inside the Semgrep CLI.

 [See setup guidance ↓](#setup)[Original source ↗](https://raw.githubusercontent.com/semgrep/semgrep/38a67a7eaf724fc266bf96e5705742bff8589775/cli/src/semgrep/mcp/README.md)

SOURCE REVIEW

 Reviewed 2026-10-13
 Evidence 5 linked sources
 Publisher Semgrep
 Licence [LGPL-2.1 (CLI source; commercial services separate) ↗](https://raw.githubusercontent.com/semgrep/semgrep/38a67a7eaf724fc266bf96e5705742bff8589775/LICENSE)
 Revision 38a67a7eaf72
 [Read what was—and wasn’t—checked ↓](#review)

“Entry point for the MCP server”

 [Semgrep · upstream description ↗](https://raw.githubusercontent.com/semgrep/semgrep/38a67a7eaf724fc266bf96e5705742bff8589775/cli/src/semgrep/mcp/README.md) Our analysis follows below.

01 / THE REASONING

## Why this made the selection.

 - Uses Semgrep’s current CLI implementation rather than the retired standalone MCP package.
- Local scan, custom-rule and rule-schema tools connect code generation with deterministic scanner output.

### A good fit for

 - Scan an approved working tree for code findings.
- Explore a Semgrep rule or inspect authenticated platform findings.

### Weigh up before choosing

 - Scan output is evidence from a scanner, not a guarantee that generated code is secure.
- Platform findings, Pro capabilities and some scan modes require account access or entitlements; local invocation is not proof of fully offline operation.
- The README contains older commented marketplace examples and a Docker HTTP example missing its transport flag; use the straightforward local stdio setup here.

02 / THE REVIEW RECORD

## What we actually inspected.

Source review has boundaries. A clear record is more useful than a “safe” badge.

### Material inspected

 - Pinned in-tree MCP README (cli/src/semgrep/mcp/README.md), cli/pyproject.toml and root LGPL licence at 38a67a7eaf724fc266bf96e5705742bff8589775.
- Python MCP server registration, scan handlers and CLI wrapper (cli/src/semgrep/mcp/server.py, semgrep.py) at 38a67a7eaf724fc266bf96e5705742bff8589775.

### Our findings

 - The supported local entrypoint is semgrep mcp, defaulting to stdio; streamable HTTP is also documented (-t streamable-http).
- The implementation includes platform API calls and tracing as well as local scanning. Old semgrep-mcp package or hosted SSE examples are not used here.
- server.py registers nine tools: semgrep_rule_schema, get_supported_languages, semgrep_findings, semgrep_scan_with_custom_rule, semgrep_scan, semgrep_scan_remote, get_abstract_syntax_tree, semgrep_scan_supply_chain and semgrep_whoami. A local server drops semgrep_scan_remote, stdio drops semgrep_whoami, and an environment variable per tool (for example SEMGREP_SCAN_DISABLED=true) removes it.
- cli/pyproject.toml at the pin declares package semgrep, license LGPL-2.1-or-later, requires-python >=3.10; the README now presents this server as part of Semgrep Guardian (MCP server, hooks and skills).
- configExample is the README's Kiro block at 38a67a7e; SEMGREP_APP_TOKEN refers to a ${SEMGREP_TOKEN} variable rather than a literal token.
- Re-pinned from 0516c0f23a3dceac5c8f5ff3fecd402af4450182 to 38a67a7eaf724fc266bf96e5705742bff8589775; the MCP README, server.py, semgrep.py and LICENSE are byte-identical between them, and cli/pyproject.toml changed only its version (1.176.0 to 1.180.0) and the pyjwt range.

### Not established by this review

 - Server launch, authenticated tool calls, and release-to-source parity were not tested.

The review applies to the material and revision named here. A newer upstream release can change its behavior.

03 / PUT IT TO WORK

## Connect a server deliberately.

[Upstream setup instructions ↗](https://raw.githubusercontent.com/semgrep/semgrep/38a67a7eaf724fc266bf96e5705742bff8589775/cli/src/semgrep/mcp/README.md)

DOCUMENTED COMMAND

 semgrep mcp Copy command ↗

Copying does not execute this command. It may retrieve a newer version than the reviewed source.

 - Install the Semgrep CLI; the README's line is brew install semgrep.
- Configure command semgrep with args [mcp] as a stdio server in your client; the displayed command starts that server.
- Set up optional platform credentials (SEMGREP_APP_TOKEN) separately and review which scan modes and data flows you enable.

### Before you start

 - A current Semgrep CLI installation and supported project files.
- Optional Semgrep account/token and product entitlement for platform or commercial capabilities.

### Documented configuration example

Use the client and authentication context described in the setup guidance. Configuration formats vary between hosts.

 {
 "mcpServers": {
 "semgrep": {
 "command": "semgrep",
 "args": [
 "mcp"
 ],
 "env": {
 "SEMGREP_APP_TOKEN": "${SEMGREP_TOKEN}"
 }
 }
 }
} Copy configuration ↗

### Compatibility

VS Code · Kiro · stdio clients

### Implementation

Python

### Transports

stdio · Streamable HTTP

### Local scanner; optional platform credentials

 - Reads source files and invokes scanner tooling; source text/results are returned to the client.
- Depending on mode, calls Semgrep services and authenticated findings APIs with SEMGREP_APP_TOKEN.
- semgrep_whoami needs a JWT that the code says is only available over streamable-http or SSE with OAuth, so it is removed on stdio.

### Cost model

Open-source CLI and commercial Semgrep services have different terms; account features and the AI client may add costs.

04 / FOLLOW THE EVIDENCE

## The source trail.

Our notes are separate from the original resource. Check upstream before adopting a new version.

 - [Semgrep CLI MCP setup and scope ↗](https://raw.githubusercontent.com/semgrep/semgrep/38a67a7eaf724fc266bf96e5705742bff8589775/cli/src/semgrep/mcp/README.md) Checked 2026-10-13 https://raw.githubusercontent.com/semgrep/semgrep/38a67a7eaf724fc266bf96e5705742bff8589775/cli/src/semgrep/mcp/README.md Supports: summary, upstreamDescription, whySelected, bestFor, limitations, install, access, compatibility, transports, review, configExample
- [Semgrep Python CLI manifest ↗](https://raw.githubusercontent.com/semgrep/semgrep/38a67a7eaf724fc266bf96e5705742bff8589775/cli/pyproject.toml) Checked 2026-10-13 https://raw.githubusercontent.com/semgrep/semgrep/38a67a7eaf724fc266bf96e5705742bff8589775/cli/pyproject.toml Supports: language, install
- [Maintained Semgrep MCP registration and handlers ↗](https://raw.githubusercontent.com/semgrep/semgrep/38a67a7eaf724fc266bf96e5705742bff8589775/cli/src/semgrep/mcp/server.py) Checked 2026-10-13 https://raw.githubusercontent.com/semgrep/semgrep/38a67a7eaf724fc266bf96e5705742bff8589775/cli/src/semgrep/mcp/server.py Supports: summary, access, review, transports
- [Semgrep scan wrapper ↗](https://raw.githubusercontent.com/semgrep/semgrep/38a67a7eaf724fc266bf96e5705742bff8589775/cli/src/semgrep/mcp/semgrep.py) Checked 2026-10-13 https://raw.githubusercontent.com/semgrep/semgrep/38a67a7eaf724fc266bf96e5705742bff8589775/cli/src/semgrep/mcp/semgrep.py Supports: review, access
- [Semgrep CLI LGPL terms ↗](https://raw.githubusercontent.com/semgrep/semgrep/38a67a7eaf724fc266bf96e5705742bff8589775/LICENSE) Checked 2026-10-13 https://raw.githubusercontent.com/semgrep/semgrep/38a67a7eaf724fc266bf96e5705742bff8589775/LICENSE Supports: license

KEEP COMPARING

## Other approaches to consider.

Related by category or shared topics. These are alternatives to inspect, not a measured quality order.

 [### Snyk Studio MCP ↗ Invoke Snyk source, dependency, configuration and package-health checks through its CLI-integrated MCP server.](/mcp-servers/snyk/)[### SonarQube MCP Server ↗ Inspect SonarQube issues and quality gates, with optional analysis and write tools controlled by toolsets and read-only mode.](/mcp-servers/sonarqube/)[### Trivy MCP ↗ Aqua Security plugin that exposes Trivy scans to MCP clients for a local filesystem, a container image, or a remote repository.](/mcp-servers/aquasecurity-trivy-mcp/)

 [AI Tools ↗](/tools/)[Skills ↗](/skills/)[Agents ↗](/agents/)[MCP Servers ↗](/mcp-servers/)[Workflows ↗](/workflows/)

## Continue your investigation

 - [Inspect resource evidence](/tools/)
- [Choose a host](/agents/)
- [Inspect reusable workflows](/skills/)
- [Use Undominated data](/api/)
