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
Run MCP: Open User Configuration from the Command Palette to add the server for every workspace, or create
.vscode/mcp.json in a single workspace. Add the following:2
Run MCP: List Servers from the Command Palette and select
semgrep.3
Start the
semgrep server.4
When VS Code prompts you to authenticate, sign in and select an organization in your browser.
5
Run MCP: List Servers again and confirm that
semgrep is running. Semgrep tools are available in Copilot Chat Agent mode.Connect with an API token
1
Add the server to your user configuration or
.vscode/mcp.json with an input that prompts for the token:2
Start the
semgrep server.3
Enter a Web API or Read-only API token when VS Code prompts for it. VS Code stores the value securely for later sessions.
4
Run MCP: List Servers from the Command Palette and confirm that
semgrep is running.