Snyk Security Scanner
STDIOAn open protocol standardizing how applications share context with large language models.
An open protocol standardizing how applications share context with large language models.
MCP (Model Context Protocol) is an open protocol that standardizes how applications share context with large language models.
MCP can support AI systems with the context needed to generate accurate and relevant responses for use cases where the AI systems do not have the context, by integrating the AI systems with tools and platforms that have specific capabilities. You can integrate Snyk MCP into certain AI-enabled security tools to provide Snyk security context.
Snyk is introducing an MCP server as part of the Snyk CLI. This will allow MCP-enabled security tools to integrate Snyk security scanning capabilities directly, thus bridging the gap between security scanning and emerging AI-assisted workflows.
In environments or applications that use MCP, you can use the snyk mcp
CLI command to:
To use the Snyk MCP server, download and install the Snyk CLI v1.1296.2 or later following the steps on the installation page. No other dependencies are needed. Snyk recommends always using the latest version of the CLI.
The snyk mcp
command is available in Early Access, under the --experimental
flag for the following reasons:
snyk mcp
command is an early implementation of integrating Snyk security scanning into the MCP-enabled environment.Because the snyk mcp
command is an experimental feature, the specific usage, parameters, and output related to this command may evolve as both MCP and this Snyk integration mature. Changes are possible before a general release.
To start the Snyk MCP server, use the snyk mcp
command for a supported transport type, stdio
or sse
as follows:
snyk mcp -t sse --experimental
- Start the Snyk MCP server using sse
, HTTP Server-Sent Events) Transport. The available endpoint is /sse
.
snyk mcp -t stdio --experimental
- Start the Snyk MCP server using stdio
, Stdio (Standard IO) Transport.
The Snyk MCP server supports integrating the following Snyk security tools into an AI system:
snyk_sca_test
(Open Source scans)snyk_code_test
(Code scans)snyk_auth
(authentication)snyk_logout
(logout)snyk_auth_status
(authentication status check)snyk_version
(version information)You can set CLI environment variables for the MCP server in the following ways:
For a full list of supported CLI environment variables, see Environment variables for Snyk CLI.
To add an MCP server to an Agentic IDE, consult the documentation for the AI system where you plan to integrate Snyk and review the specific MCP instructions. Examples of systems where you can integrate Snyk include Windsurf's MCP, Qodo's MCP support, and VS Code MCP support.
mcpconfig.json
fileThis method can be used for to set up Windsurf's MCP, as one example. These example example show how to add the Snyk MCP server in the mcpconfig.json
file for each transport type. This method requires that the Snyk CLI is in your system path and can be invoked with the command snyk
. If the CLI is not in your system path, you can provide the full path to the CLI.
stdio
transport in your mcpconfig.json
file{
"mcpServers": {
"Snyk Security Scanner": {
"command": "/absolute/path/to/snyk",
"args": [
"mcp",
"-t",
"stdio",
"--experimental"
],
"env":{
// optional CLI environment variables, e.g. SNYK_CFG_ORG, SNYK_TOKEN
}
}
}
}
sse
transport in your mcpconfig.json
fileIf your MCP Client expects a URL, then you will need to start the MCP server in your terminal first by running snyk mcp -t sse --experimental
This will output the base URL for your local SSE server. The sse
endpoint lives on http://baseUrl/sse.
{
"mcpServers": {
"Snyk Security Scanner": {
"url": "http://baseUrl/sse",
}
}
}
SSE transport supports running the MCP server locally only. SSe does not support remote or hosted configurations.
Select Agentic
Connect more tools
Plus button for Agentic Tools (MCP)
MCP server details
Tools available with Snyk MCP integraton
Request to scan your code
If you encounter issues with the Snyk MCP server or its integration, try the troubleshooting steps provided here.
snyk version
.snyk
executable in your mcpconfig.json
double-check that this path is correct./path/to/your/snykCli test
(for open-source vulnerabilities)/path/to/your/snykCli code test
(for code issues)sse
transport mode instead of stdio
: snyk mcp -t sse --experimental
and set the URL in your mcpconfig.json
file.SNYK_TOKEN
environment variable.If your Snyk account is part of multiple Organizations, or if scans are not appearing in the expected place, ensure the correct Snyk Organization is configured. You can set this using:
snyk config set org=<YOUR_ORG_ID>
SNYK_CFG_ORG=<YOUR_ORG_ID>
Verify that the necessary environment variables (for example, SNYK_TOKEN
, SNYK_CFG_ORG
, proxy settings) are correctly propagated to the Snyk MCP server process.
If you are behind a corporate proxy, ensure the http_proxy
and https_proxy
environment variables are correctly set and accessible to the Snyk CLI and MCP server process.
If you are using SSE (if using snyk mcp -t sse
):
Use these suggestions to improve and expand on your Snyk CLI debug output to troubleshoot MCP-related issues:
snyk mcp
server or performing direct test scans (see Basic repository scanning), you can add verbosity parameters to your Snyk commands.-d
or --debug
flag for debug level output, for example:
snyk mcp -t sse --experimental -d
snyk test -d
snyk code test -d
--log-level=trace
option or set the SNYK_LOG_LEVEL=trace
environment variable:
snyk mcp -t sse --experimental -d --log-level=trace
SNYK_LOG_LEVEL=trace snyk mcp -t sse --experimental -d