Cursor 💻

  1. brew install semgrep or pip install semgrep.
    • Run semgrep --version to make sure it's installed correctly and the version is 1.146.0 or higher.
  2. semgrep login && semgrep install-semgrep-pro
  3. Add Semgrep MCP server to Cursor
  4. Create a hooks.json file in your project's .cursor directory and paste the following configuration:
    {
      "version": 1,
      "hooks": {
        "stop": [
          {
            "command": "semgrep mcp -k stop-cli-scan -a cursor"
          }
        ],
        "afterFileEdit": [
          {
            "command": "semgrep mcp -k record-file-edit -a cursor"
          }
        ]
      }
    }

Claude Code 🦀

  1. brew install semgrep or pip install semgrep.
    • Run semgrep --version to make sure it's installed correctly and the version is 1.146.0 or higher.
  2. semgrep login && semgrep install-semgrep-pro
  3. Start a Claude Code instance by running: claude. Make sure you are using Claude Code version 2.1.7 or higher.
  4. Add the Semgrep marketplace by running the following command in Claude: /plugin marketplace add semgrep/mcp-marketplace
  5. Install the plugin from the marketplace: /plugin install semgrep-plugin@semgrep
  6. If it is installed, see if you can run the /semgrep-plugin:setup_semgrep_plugin command. If you cannot run the command, try enabling the plugin: /plugin enable semgrep-plugin@semgrep
Additional Details
  • This is actively supported but should be considered beta software. It's still experimental and may break or change at any time.
  • We previously recommended a remote MCP server. If you are currently using it, please replace it with the local one described above. We are working to re-launch the remote MCP server with additional features including OAuth.
  • Please report any issues to the GitHub repository.
  • Please see the README for more details.