This MCP server enables you to run Snyk security scans directly from Claude, allowing you to analyze repositories and projects for security vulnerabilities without leaving your conversation.
To set up the Snyk MCP server with Claude desktop, you'll need to update your Claude configuration file (claude-config.json
):
{
"mcpServers": {
"snyk": {
"command": "npx",
"args": [
"-y",
"github:sammcj/mcp-snyk"
],
"env": {
"SNYK_API_KEY": "your_snyk_token",
"SNYK_ORG_ID": "your_default_org_id"
}
}
}
}
Replace your_snyk_token
with your actual Snyk API token. The SNYK_ORG_ID
field is optional but recommended for setting a default organization.
You can configure your Snyk organization ID through multiple methods:
SNYK_ORG_ID
(as shown above)snyk config set org=your-org-id
The server will check these locations in order until it finds a valid organization ID.
To verify your Snyk token is configured correctly, ask Claude:
Verify my Snyk token configuration
This will check if your token is valid and display your Snyk user information. If you have the Snyk CLI installed, it will also show your CLI-configured organization ID.
To scan a repository for security vulnerabilities, provide the complete repository URL:
Scan repository https://github.com/owner/repo for security vulnerabilities
Important: Always use the full repository URL (e.g., https://github.com/owner/repo). Local file paths are not supported.
To scan an existing Snyk project:
Scan Snyk project project-id-here
You can override your default organization ID by specifying it directly in your command:
Scan repository https://github.com/owner/repo in organisation org-id-here
If you have the Snyk CLI installed (npm install -g snyk
), the MCP server can use it to:
This integration provides a consistent experience between your CLI and MCP server usage.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.