Skip to main content
Add the hosted MCP server to Claude Code. For help choosing an authentication method, see Authentication and access.

Prerequisites

Single-tenant URLThe steps on this page use https://semgrep.dev/api/mcp. On a single-tenant deployment, replace that URL with https://YOUR_TENANT.semgrep.dev/api/mcp. Use your subdomain for YOUR_TENANT. To connect to the read-only URL instead, see Read-only URL.

Connect with OAuth

1
Add the server at user scope so that it’s available in every project:
If semgrep is already configured, update its existing entry instead of adding it again.
2
Start Claude Code and run /mcp.
3
Select semgrep.
4
Sign in and select an organization in your browser.
5
Run /mcp again and confirm that semgrep is connected.

Connect with an API token

1
Add the server with an Authorization header:
Replace YOUR_SEMGREP_APP_TOKEN with a Web API or Read-only API token. If semgrep is already configured, update the Authorization header in its existing entry instead of adding it again.
2
Start a new Claude Code session. Run /mcp and confirm that semgrep is connected.
For more information, see Claude Code MCP documentation.