Provides comprehensive security scanning and vulnerability management through both Snyk CLI tools (test, code analysis, container scanning, IaC scanning, SBOM generation) and REST API tools for querying projects, issues, and security findings across organizations.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Snyk MCP RESTtest my project for vulnerabilities"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
snyk-mcp-rest
TypeScript client for the Snyk REST API with built-in Model Context Protocol (MCP) server support. This package provides both a type-safe API client auto-generated from the official Snyk OpenAPI specification and a comprehensive MCP server that exposes both Snyk CLI tools and REST API tools for AI assistant integrations.
Architecture
This MCP server provides a unified interface to Snyk security scanning through two complementary tool sets:
๐ง Snyk CLI Tools (via Proxy)
The server automatically connects to the Snyk CLI and proxies all native CLI commands as MCP tools. These tools provide comprehensive security scanning capabilities:
snyk_test- Test projects for vulnerabilitiessnyk_code_test- Static code analysis for security issuessnyk_container_test- Container image scanningsnyk_iac_test- Infrastructure as Code scanningsnyk_monitor- Monitor projects in Snyk dashboardsnyk_sbom_test- SBOM generation and testingsnyk_send_feedback- Report security metricssnyk_trust,snyk_version, and more
๐ REST API Tools (Custom)
Additionally, the server provides custom-built tools using the Snyk REST API for management and querying operations:
snyk_rest_find_projects- Search for projects by namesnyk_rest_get_issues- Retrieve issues for a projectsnyk_rest_get_issue- Get detailed issue informationsnyk_rest_get_repo_issues- Aggregate issues across repository projects
This dual-tool architecture gives AI assistants the best of both worlds: the full power of Snyk CLI for scanning operations, combined with efficient REST API access for querying and management tasks.
Features
๐ Auto-generated TypeScript Client - Generated from official Snyk OpenAPI spec
๐ค MCP Server Integration - Built-in Model Context Protocol server for AI assistants (Claude, etc.)
๐ฆ Complete Type Safety - Full TypeScript support with IntelliSense
๐ Axios-based HTTP Client - Reliable HTTP operations with error handling
๐งช Comprehensive Testing - Vitest with coverage support
๐๏ธ Modular Architecture - Clean separation between generated and custom code
Installation
Build
The build process includes OpenAPI code generation and TypeScript compilation:
Usage
Basic API Client Usage
MCP Server Usage
The MCP server provides AI assistants with access to Snyk security data. Configure it in your AI assistant (e.g., Claude Desktop):
Starting the MCP Server
Testing the MCP Server
Test the MCP server without Claude Desktop using the provided test scripts:
List all available tools:
This will show both Snyk CLI tools and REST API tools.
Testing REST API tools:
The snyk-rest-get-issues.ts script accepts the same parameters as the snyk_rest_get_issues MCP tool:
projectId- Project ID in UUID format (optional)status- Issue status: open, resolved, ignored (optional, default: open)severity- Issue severity: low, medium, high, critical (optional)
Testing snyk_rest_get_issue tool:
The snyk-rest-get-issue.ts script requires:
issue_id- The unique identifier (UUID) of the issue to retrieve (required)
Claude Desktop Configuration
Add to your Claude Desktop config file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
Option 1: Using npx with ts-node (recommended for development)
Option 2: Using compiled JavaScript (recommended for production)
Build the project first with npm run build, then:
Important: Replace /absolute/path/to/snyk-mcp-rest with the actual absolute path to your project directory (e.g., /Users/yourname/Projects/snyk-mcp-rest).
Available MCP Tools
The MCP server provides two types of tools:
Snyk CLI Tools
All native Snyk CLI commands are available as MCP tools with the snyk_ prefix. For a complete list of available CLI tools and their parameters, run:
Key CLI tools include:
snyk_test- Test projects for open source vulnerabilitiessnyk_code_test- Static application security testing (SAST)snyk_container_test- Container and Kubernetes security scanningsnyk_iac_test- Infrastructure as Code scanningsnyk_monitor- Snapshot and continuously monitor projectssnyk_sbom_test- Generate and test Software Bill of Materials
Refer to the official Snyk CLI documentation for detailed usage of each CLI tool.
REST API Tools
Custom tools built using the Snyk REST API for querying and management:
snyk_rest_find_projects - Search for Snyk projects by name using the Snyk REST API
Parameters:
query(required): Search query string to match against project names
Configuration (via environment variables):
SNYK_ORG_ID(required): Snyk Organization ID (UUID)
Returns: List of projects with their IDs and names
snyk_rest_get_issues - Retrieve Snyk security issues for an organization and project using the Snyk REST API
SNYK_ORG_ID(required): Snyk Organization ID (UUID)SNYK_ORG_SLUG(required): Organization slug for URLsReturns: Formatted issues with direct Snyk URLs. The
repositoryfield will benullunless explicitly provided by specialized tools likesnyk_rest_get_repo_issues
Note: The
projectIdparameter must be in UUID format. To find the Project ID for a repository:const projectsApi = new ProjectsApi(config); const projects = await projectsApi.listOrgProjects({ version: "2024-11-05", orgId: "your-org-id", names: ["owner/my-repo"], }); const projectId = projects.data.data?.[0]?.id;
Available APIs
The client provides access to all Snyk REST API endpoints:
AccessRequestsApi - Manage access requests
AppsApi - Snyk Apps management
AuditLogsApi - Audit log access
CloudApi - Cloud security operations
ContainerImageApi - Container image scanning
CustomBaseImagesApi - Custom base image management
FindingsApi - Security findings
GroupsApi / GroupApi - Group management
IacSettingsApi - Infrastructure as Code settings
InvitesApi - User invitations
IssuesApi - Security issues management
OrgsApi - Organization operations
PoliciesApi - Policy management
ProjectsApi - Project operations
SbomApi - Software Bill of Materials
ServiceAccountsApi - Service account management
SlackApi / SlackSettingsApi - Slack integration
TargetsApi - Target management
TenantsApi - Tenant operations
TestsApi - Testing operations
UsersApi - User management
...and many more! See src/generated/api/ for the complete list.
Development
Running Tests
The project includes comprehensive test coverage:
Test Suites
API Client Tests (
tests/api.test.ts) - Configuration, API instantiation, exports (18 tests)MCP Server Tests (
tests/mcp-server.test.ts) - Issue retrieval, filtering, pagination, project name fetching (9 tests)MCP Server Logic Tests (
tests/mcp-server-logic.test.ts) - Handler functions, tool schema (21 tests)MCP Business Logic Tests (
tests/mcp-business-logic.test.ts) - Issue formatting, response handling (25 tests)Integration Tests (
tests/integration.test.ts) - Multi-API workflows, pagination handling (7 tests)Error Handling Tests (
tests/error-handling.test.ts) - HTTP errors, network failures, validation (8 tests)Index Exports Tests (
tests/index.test.ts) - Module exports and type definitions (14 tests)
Test Statistics: 102 test cases across 7 test files covering core functionality, error scenarios, and edge cases.
Coverage: 93%+ overall code coverage (100% for src/index.ts, 93%+ for src/mcp-server.ts). Generated code (src/generated/**) is excluded from coverage as per project policy.
Project Structure
Important: Never edit files in src/generated/ - they are auto-generated from the OpenAPI spec.
Error Handling
The client uses Axios for HTTP operations. Handle errors appropriately:
Environment Variables
Create a .env file in the project root:
For the MCP server, these environment variables are used:
SNYK_API_KEY(required) - Your Snyk API token (get from https://app.snyk.io/account)SNYK_ORG_ID(required) - Your Snyk Organization ID (UUID format)SNYK_ORG_SLUG(required) - Your Snyk Organization slug for URLs (e.g.,my-org)SNYK_CLI_PROXY_ENABLED(optional) - Enable/disable Snyk CLI tool proxying (default:true)Set to
false,0, ornoto disable Snyk CLI tools and only use REST API toolsWhen disabled, only custom REST API tools (
snyk_rest_*) will be availableWhen enabled (default), both Snyk CLI tools and REST API tools are available
You can find your Organization ID and slug in the Snyk web UI under your organization settings.
Example: Disabling Snyk CLI Proxy
If you want to use only the REST API tools and disable the Snyk CLI proxy, add this to your .env file:
Or set it in your Claude Desktop configuration:
Version Information
API Version: Uses Snyk REST API version
2024-11-05(all API calls requireversionparameter)OpenAPI Spec: Generated from
v1-api-spec.yamlTypeScript: 5.9+
Node.js: Compatible with modern Node.js versions (ES2020 target)
Configuration
Code generation is configured via openapitools.json:
Template:
typescript-axiosSingle request parameter: Enabled
Separate models and API: Enabled
Output:
./src/generated
License
MIT
Repository
https://github.com/axelspringer/snyk-mcp-rest
Contributing
Make changes to custom code (not
src/generated/)Update OpenAPI spec or generator config if needed
Run
npm testto verify changesUpdate this README if adding new features