Semgrep
Runs Semgrep static analysis from MCP for secure-code review, custom rule writing, and policy workflows.
Installation path
Choose Add Server, select Local MCP, use uvx as the command, and pass semgrep-mcp as the argument. Semgrep does not publish a hosted remote MCP URL.
Setup steps
- 01
Install uv
uv ships uvx: install with brew install uv or pipx install uv.
- 02
Open Add Server
Configuration → MCP Registry → Add Server in Cosmos.
- 03
Pick the Local MCP tab
- 04
Set the command
Command
uvx - 05
Add the arguments
Args
semgrep-mcp - 06
Set environment variables
Optional: add SEMGREP_APP_TOKEN to use the Semgrep AppSec Platform.
SEMGREP_APP_TOKEN
SEMGREP_APP_TOKEN=<semgrep_app_token> - 07
Click Add, then enable
Toggle on Cosmos Agent or CLI.
Local command
Suggested name: semgrep
uvx semgrep-mcpRequires uv on PATH. The pip install path (pip install semgrep-mcp && semgrep-mcp) is also supported per the Semgrep MCP docs.
Authentication
None for local scans. Optional SEMGREP_APP_TOKEN to use the Semgrep AppSec Platform.
| Variable | Example | Required |
|---|---|---|
| SEMGREP_APP_TOKEN | <semgrep_app_token> | Yes |