- Claude Code: hooks and plugins
- Codex: MCP
- Cursor: hooks and MCP
- GitHub Copilot (Visual Studio, JetBrains, Xcode, Eclipse): MCP
- Kiro: MCP
- VS Code: MCP
- Devin (Windsurf): Cascade hooks
Prerequisites
- A Semgrep account
Connect to your IDE
- Claude Code
- Codex
- Cursor
- GitHub Copilot
- VS Code
- Devin (Windsurf)
- Kiro
- Other IDEs
Claude Code uses Semgrep’s hosted remote server by default, so you do not need to install the Semgrep CLI locally.The plugin registers a post-tool hook so Claude Code scans every file it writes. Learn more about Claude Code plugins and hooks.
The MCP server bundled with this plugin works on all platforms. On Windows, however, it requires Windows Subsystem for Linux (WSL) for the MCP server to work out of the box.
1
Start a Claude Code instance:
2
Open the plugin manager:
3
Go to Discover, search for Semgrep, and click Install.
4
Tell Claude to load the plugin:
5
Start a new session in Claude to begin the Semgrep login flow:
Run Semgrep Guardian locally
Run Semgrep Guardian locally
The remote server is the recommended default. If you need to run Semgrep locally instead, you can install the local plugin from the
semgrep/guardian-local repo.2
Start a Claude Code instance:
3
Open the plugin manager:
4
Go to Discover. Search for Semgrep, and then click Install.
5
Load the plugin:
What hooks does Semgrep Guardian use?
Guardian uses different hooks depending on the IDE you use it in.Claude Code
In Claude Code, the Guardian plugin registers three hooks:Other IDEs
Other IDEs connect to Guardian through the Semgrep MCP Server. In these IDEs, Guardian is called on a best-effort basis, since it depends on the agent remembering to call it. Deploy Guardian alongside a skill to ensure that the agent calls Semgrep reliably.What rules does Semgrep Guardian scan with?
Guardian uses different rules depending on the environment in which you use it:- Claude Code remote server (default): scans with the default Guardian ruleset. This is not currently configurable. If you require custom rules, see Semgrep’s
#mcpSlack community for assistance. - Claude Code local and all other IDE integrations: scans with the rules enabled for your Semgrep organization through your Policies.
Install the Semgrep CLI
Every IDE except Claude Code runs Semgrep from a locally installed CLI. Claude Code uses Semgrep’s hosted remote server by default and does not need a local CLI.1
Install the Semgrep CLI using pipx, uv, or Homebrew. This requires Python 3.10 or later — the Semgrep CLI needs Python at runtime regardless of how you installed the CLI:
NOTE
pipx and uv are the preferred installation methods. The Homebrew formula is maintained on a best-effort basis and often lags behind the latest release.Homebrew users: ensure that you’ve added Homebrew to your PATH.2
Verify that you’ve installed the latest version of Semgrep:
3
Sign in to your Semgrep account and install the Semgrep Pro engine:
semgrep login launches a browser window. You can also use the activation link printed in the terminal.Additional resources
- Semgrep’s
#mcpSlack community - The Semgrep MCP server repo on GitHub