Sign inSign up

mekayelanik/snyk-mcp

By mekayelanik

•Updated 1 day ago

Image
0

9.3K

mekayelanik/snyk-mcp repository overview

Snyk Logo

⁠Snyk CLI MCP Server - Docker Image

Unofficial Multi-Architecture Docker Image for Snyk CLI MCP Server

Docker Pulls Docker Stars GHCR License: GPL-3.0 Platforms GitHub Stars GitHub Forks GitHub Issues Last Commit

⁠Overview

This is an unofficial, community-maintained Docker image that packages the Snyk CLI MCP Server⁠ for containerized deployment. It enables AI agents (Claude Code, VS Code Copilot, Cursor, Windsurf, etc.) to perform security scanning via the Model Context Protocol (MCP).

Upstream: github.com/snyk/cli⁠ (Apache License 2.0)

⁠Key Features
  • Multi-Architecture Support - Native support for x86-64 and ARM64
  • Multiple Transport Protocols - Streamable HTTP, SSE, and WebSocket support (selectable via env var)
  • 11 Security Scanning Tools - SCA, SAST, container, IaC, SBOM, and AIBOM scanning
  • Python AI Project Support - snyk_aibom for AI Bill of Materials generation
  • Secure by Design - API key auth (case-insensitive Bearer), CORS, TLS termination, security headers
  • High Performance - HAProxy with QUIC/HTTP3 support, ZSTD compression
⁠Available Snyk MCP Tools
ToolDescription
snyk_sca_scanOpen source dependency vulnerability scanning (pip, pipenv, poetry, npm, etc.)
snyk_code_scanStatic Application Security Testing (SAST) for source code
snyk_container_scanContainer image vulnerability scanning
snyk_iac_scanInfrastructure as Code security scanning (Terraform, K8s, Docker Compose)
snyk_sbom_scanSoftware Bill of Materials analysis
snyk_aibomAI Bill of Materials for Python AI projects (models, datasets, tools)
snyk_authAuthenticate with Snyk
snyk_logoutLog out of Snyk
snyk_auth_statusCheck authentication status
snyk_trustTrust a folder for scanning
snyk_versionDisplay version information

⁠😎 Buy Me a Coffee ☕︎

Your support encourages me to keep creating/supporting my open-source projects. If you found value in this project, you can buy me a coffee to keep me inspired.

Buy Me A Coffee ⁠

⁠Quick Start

⁠Prerequisites

CRITICAL: Do NOT expose this container directly to the internet without proper security measures (reverse proxy, SSL/TLS, authentication, firewall rules).


services:
  snyk-mcp:
    image: mekayelanik/snyk-mcp:latest
    container_name: snyk-mcp
    restart: unless-stopped
    ports:
      - "8010:8010"
    volumes:
      - /path/to/your/projects:/data:ro
    environment:
      - SNYK_TOKEN=${SNYK_TOKEN}
      - PORT=8010
      - INTERNAL_PORT=38011
      - PUID=1000
      - PGID=1000
      - TZ=UTC
      - NODE_ENV=production
      - PROTOCOL=SHTTP
      - ENABLE_HTTPS=false
      - HTTP_VERSION_MODE=auto
      - DATA_DIR=/data
      - SNYK_MCP_PROFILE=full
      # Optional: Snyk organization ID
      # - SNYK_CFG_ORG=your-org-id
      # Optional: require Bearer token auth at HAProxy layer
      # - API_KEY=replace-with-strong-secret
      # Optional: CORS origins
      # - CORS=*
⁠Docker Run
docker run -d \
  --name=snyk-mcp \
  --restart=unless-stopped \
  -p 8010:8010 \
  -v /path/to/your/projects:/data:ro \
  -e SNYK_TOKEN=your-snyk-api-token \
  -e PORT=8010 \
  -e PROTOCOL=SHTTP \
  -e SNYK_MCP_PROFILE=full \
  mekayelanik/snyk-mcp:latest
⁠Access Endpoints
ServiceEndpointDescription
MCP (SHTTP)http://host-ip:8010/mcpStreamable HTTP MCP endpoint (recommended)
MCP (SSE)http://host-ip:8010/sseServer-Sent Events MCP endpoint
MCP (WS)ws://host-ip:8010/messageWebSocket MCP endpoint
Healthhttp://host-ip:8010/healthzHealth check endpoint

When HTTPS is enabled (ENABLE_HTTPS=true), use TLS endpoints:

ServiceEndpoint
MCP (SHTTP)https://host-ip:8010/mcp
MCP (SSE)https://host-ip:8010/sse
MCP (WS)wss://host-ip:8010/message

Security Warning: The container defaults to HTTP (ENABLE_HTTPS=false) for easier local setup. Use ENABLE_HTTPS=true with your own certificates for production. See CERTIFICATE_SETUP_GUIDE.md⁠ for instructions.


⁠Configuration

⁠Complete Environment Variables Reference
⁠Core Settings
VariableDefaultPossible ValuesDescription
PORT80101-65535External HAProxy listening port
INTERNAL_PORT380111-65535Internal supergateway port (do not expose)
PROTOCOLSHTTPSHTTP, SSE, WSMCP transport protocol
PUID1000Any valid UIDProcess user ID
PGID1000Any valid GIDProcess group ID
TZUTCAny timezoneContainer timezone
NODE_ENV(empty)production, etc.Node.js environment
DATA_DIR/dataAny pathDirectory for mounted projects
⁠Snyk Settings
VariableDefaultPossible ValuesDescription
SNYK_TOKEN(empty)API token stringSnyk API token (required for scanning)
SNYK_CFG_ORG(empty)Organization IDSnyk organization ID
SNYK_MCP_PROFILEfullminimal, full, previewTool profile (see below)
SNYK_DEBUGfalsetrue, falseEnable debug logging
SNYK_DISABLE_ANALYTICS(empty)1Disable Snyk analytics
⁠Snyk MCP Profiles
ProfileToolsDescription
minimalEssentialMinimum scanning tools, low token usage
full11All stable tools (recommended)
preview11+Full profile plus experimental tools
⁠Security Settings
VariableDefaultPossible ValuesDescription
API_KEY(empty)5-256 printable charsBearer token for HAProxy authentication
CORS(empty)Origins (comma-separated) or *Allowed CORS origins
ENABLE_HTTPSfalsetrue, falseEnable TLS termination
TLS_CERT_PATH/etc/haproxy/certs/server.crtFile pathTLS certificate path
TLS_KEY_PATH/etc/haproxy/certs/server.keyFile pathTLS private key path
TLS_MIN_VERSIONTLSv1.3TLSv1.2, TLSv1.3Minimum TLS version
HTTP_VERSION_MODEautoauto, h1, h2, h3, h1+h2, allHTTP version negotiation
RATE_LIMIT00-NMax requests per RATE_LIMIT_PERIOD per IP (0 = disabled)
RATE_LIMIT_PERIOD10s10s, 1m, 1h, etc.Sliding window for rate limiting
MAX_CONNECTIONS_PER_IP00-NMax concurrent connections per IP (0 = disabled)
IP_ALLOWLIST(empty)Comma-separated IPs/CIDRsIPs/CIDRs to allow (all others blocked)
IP_BLOCKLIST(empty)Comma-separated IPs/CIDRsIPs/CIDRs to block

Boolean values: true, 1, yes, on are all accepted as truthy. Everything else is falsy.

⁠API Key Authentication Notes
  • Set API_KEY to enforce auth at the reverse proxy level.
  • Header: Authorization: Bearer <API_KEY>.
  • /healthz and CORS preflight (OPTIONS) bypass authentication.
⁠Rate Limiting and IP Access Control
  • Rate limiting: Set RATE_LIMIT=100 to allow 100 requests per RATE_LIMIT_PERIOD (default 10s) per IP. Exceeding the limit returns HTTP 429 with a Retry-After header.
  • Connection limiting: Set MAX_CONNECTIONS_PER_IP=50 to cap concurrent connections per IP. Exceeding returns HTTP 429.
  • IP blocklist: Set IP_BLOCKLIST=192.0.2.0/24,198.51.100.5 to block specific IPs/CIDRs. Blocked IPs receive HTTP 403.
  • IP allowlist: Set IP_ALLOWLIST=10.0.0.0/8,192.168.1.0/24 to allow only listed IPs/CIDRs. All others receive HTTP 403. Localhost is always allowed.
  • All features default to disabled. Combine as needed — blocklist is checked before allowlist.

⁠Mounting Projects for Scanning

Mount your project directories to /data (or the path specified by DATA_DIR). Each subdirectory becomes a scannable project.

volumes:
  # Mount entire projects directory
  - /home/user/projects:/data:ro
  # Or mount individual projects
  - /home/user/my-python-app:/data/my-python-app:ro
  - /home/user/my-node-app:/data/my-node-app:ro

Then tell your AI agent to scan using the mounted path:

  • "Scan /data/my-python-app for vulnerabilities"
  • "Run an SCA scan on /data/my-node-app"
  • "Generate an AIBOM for /data/my-python-app"


⁠Memory & Concurrency Tuning

This image embeds mcp-proxy (sparfenyuk/mcp-proxy) as the stdio↔HTTP bridge. Key knobs:

  • MCP_PROXY_STATELESS=false (default): one stdio backend child is shared across all MCP sessions, JSON-RPC-id-multiplexed. Minimal memory, no per-request fork cost.
  • MCP_PROXY_STATELESS=true: per-request transport instance. Use only when full session isolation is required — memory grows with concurrency.
  • HAPROXY_FRONTEND_MAXCONN / HAPROXY_SERVER_MAXCONN: HAProxy-level caps. Bound bursts so the backend cannot be flooded. Defaults of 64/16 are sensible for a single replica.

Root cause for the migration: supergateway 3.4.3 stateless mode (its default) spawned a child stdio process per POST and never reaped it (supercorp-ai/supergateway#108). mcp-proxy stateful default shares one stdio backend across sessions and reduced RSS by ~4.6× in our fleet testing.

⁠MCP Client Configuration

⁠Claude Code

Add to ~/.claude.json under mcpServers:

{
  "mcpServers": {
    "snyk": {
      "type": "sse",
      "url": "http://host-ip:8010/sse"
    }
  }
}

Or for Streamable HTTP:

{
  "mcpServers": {
    "snyk": {
      "type": "http",
      "url": "http://host-ip:8010/mcp"
    }
  }
}
⁠VS Code / Codex / Cursor / Windsurf

All use the same JSON format. Configure in the respective config file:

  • VS Code: .vscode/settings.json (key: mcp.servers)
  • Codex: ~/.codex/config.json (key: mcpServers)
  • Cursor: ~/.cursor/mcp.json (key: mcpServers)
  • Windsurf: .codeium/mcp_settings.json (key: mcpServers)
{
  "mcpServers": {
    "snyk": {
      "transport": "http",
      "url": "http://host-ip:8010/mcp"
    }
  }
}

⁠Available Tags

TagPlatformDescription
latestamd64, arm64Latest stable release
1.1307.0-preview.91928dab0e1a2966de1d90a2f917496fa3032222amd64, arm64Specific version

⁠License

This Docker image packaging is licensed under the GNU General Public License v3.0⁠.

⁠Upstream Licenses
  • Snyk CLI: Apache License 2.0⁠ - Copyright 2015 Snyk Ltd.
  • mcp-proxy: MIT License
  • HAProxy: GNU General Public License v2.0

This is an unofficial community packaging. It is NOT affiliated with, endorsed by, or supported by Snyk Ltd. See NOTICE⁠ for full attribution.


⁠😎 Buy Me a Coffee ☕︎

Your support encourages me to keep creating/supporting my open-source projects. If you found value in this project, you can buy me a coffee to keep me inspired.

Buy Me A Coffee ⁠


⁠Maintainer

Mohammad Mekayel Anik

Tag summary

Content type

Image

Digest

sha256:b5c0e435c…

Size

178.9 MB

Last updated

1 day ago

docker pull mekayelanik/snyk-mcp