Snyk/snyk-ls
Built by Metorial, the integration platform for agentic AI.
Snyk/snyk-ls
Server Summary
Real-time security diagnostics
Code analysis
Vulnerability scanning for open source dependencies
Infrastructure as code scanning
Code quality and security issue identification
Actionable insights and automated fixes
Authentication and progress reporting
Trusted folder management
The language server follows the Language Server Protocol and integrates with Snyk Open Source, Snyk Infrastructure as Code and Snyk Code. For the former two, it uses the Snyk CLI as a data provider, for the latter it is connecting directly to the Snyk Code API.
Right now the language server supports the following actions:
$/progress
$/cancelRequest
textDocument/publishDiagnostics
types.PublishDiagnosticsParams
{
"uri": "file:///path/to/file",
"diagnostics": [
{
"range": {
"start": { "line": 1, "character": 0 },
"end": { "line": 2, "character": 0 },
},
"severity": 1,
"code": "S100",
"source": "Snyk",
"message": "Message",
"tags": ["security"],
"data": {
"id": "123",
"issueType": "vulnerability",
"packageName": "packageName",
"packageVersion": "packageVersion",
"issue": "issue",
"additionalData": {
"ruleId": "ruleId",
"identifiers": {
"cwe": ["cwe"],
"cve": ["cve"]
},
"description": "description",
"language": "language",
"packageManager": "packageManager",
"packageName": "packageName"
}
}
}
]
}
{
"uri": "file:///path/to/file",
"diagnostics": [
{
"range": {
"start": { "line": 1, "character": 0 },
"end": { "line": 2, "character": 0 },
},
"severity": 1,
"code": "S100",
"source": "Snyk",
"message": "Message",
"tags": ["security"],
"data": {
"id": "123",
"filePath": "filePath",
"range": {
"start": { "line": 1, "character": 0 },
"end": { "line": 2, "character": 0 },
},
"additionalData": {
"message": "message",
"rule": "rule",
"ruleId": "ruleId",
"dataFlow": [
{
"filePath": "filePath",
"range": {
"start": { "line": 1, "character": 0 },
"end": { "line": 2, "character": 0 },
},
}
],
"cwe": "cwe",
"isSecurityType": true
}
}
}
]
}
window/logMessage
window/showMessage
SDKs callback to retrieve configured SDKs from the client
workspace/snyk.sdks
types.WorkspaceFolder
[{
"type": "java", // or python or go
"path": "/path/to/sdk" // JAVA_HOME for java, GOROOT for Go, Python executable for Python
}]
Folder Config Notification
$/snyk.folderConfigs
types.FolderConfigsParam
{
"folderConfigs":
[
{
"folderPath": "the/folder/path",
"baseBranch": "the-base-branch", // e.g. main
"localBranches": [ "branch1", "branch2" ]
}
]
}
Custom Publish Diagnostics Notification
$/snyk.publishDiagnostics316
types.PublishDiagnosticsParams
MCP Server URL Notification to publish the listening address. The server listens for POST
requests on /messages
and for SSE subscriptions on /sse
. An example can be found in the mcp package in the smoke test.
$/snyk.mcpServerURL
types.McpServerURLParams
{
"url": "https://127.0.0.1:7595"
}
Authentication Notification
$/snyk.hasAuthenticated
types.AuthenticationParams
{
"token": "the snyk token", // this can be an oauth2.Token string or a legacy token
"apiUrl": "https://api.snyk.io"
}
CLI Path Notification
$/snyk.isAvailableCli
types.SnykIsAvailableCli
{
"cliPath": "/a/path/to/cli-executable"
}
Trusted Folder Notification
$/snyk.addTrustedFolders
types.SnykTrustedFoldersParams
{
"trustedFolders": ["/a/path/to/trust"]
}
Scan Notification
$/snyk.scan
types.ScanParams
{
"status": "success", // possible values: "error", "inProgress", "success"
"product": "code", // possible values: "code", "oss", "iac"
"folderPath": "/a/path/to/folder",
}
{
"status": "error",
"product": "code",
"folderPath": "/a/path/to/folder",
"errorMessage": "An error occurred",
"cliError": {
"code": "CLI_ERROR_CODE",
"message": "An error occurred"
},
}
Summary Panel Status Notification
$/snyk.scanSummary
types.ScanSummary
{
"scanSummary": "