Semgrep — MCP server for Claude Code: scan code for vulnerabilities
An MCP server that lets the coding agent run Semgrep and brings vulnerability findings back into the conversation.
no license updated 2026-10-29
Open on GitHubWhat Semgrep does
Semgrep hunts for insecure patterns in source code. This server exposes it to the agent as a tool, so Claude, Cursor or Codex can start a scan on their own and report what turned up in the same chat where the fix happens.
It behaves like any MCP server: it runs next to the client and answers the agent's requests. Declared clients are Claude, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed and Gemini CLI. An editor without MCP support has nowhere to plug it in, and that list is the real limit here.
Ask for a pass over the project before you commit and you get a set of spots to inspect by hand. The agent sees the output itself, so acting on a finding takes one message.
What it helps with
- scan a codebase for vulnerabilities without leaving the agent chat
- get a list of risky spots before committing
- wire Semgrep into Cursor or Codex as a tool
- read analyzer findings in the same thread where the fix happens
Example prompts for the agent
- Run Semgrep over
srcand show me what it flags - Check this file for security issues with Semgrep
- Scan the project and sort the findings by severity
How to install Semgrep
Install
The MCP registry has no launch command for it: see the repository README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Semgrep
How do I install the Semgrep MCP server?
Add it to the MCP settings of your client and it runs alongside the agent. Any client from the supported list works: Claude, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI.
What does the Semgrep MCP server do?
It hands the agent a way to run Semgrep and returns vulnerability findings to the conversation.
How is this different from running Semgrep in a terminal?
The agent starts the scan and reads the output itself, so you can act on findings in the same thread.