Snyk
Snyk finds and fixes vulnerabilities in code, open source dependencies, containers and infrastructure as code. The Willow connector calls the Snyk REST API and the V1 API, so an agent can read and manage what Snyk has already scanned: organizations, projects, targets, issues, ignores, collections, policies and audit logs.
It does not scan code. Scanning a folder needs the Snyk CLI on the machine that holds the code, which is what the separate Snyk card with the Official badge runs (npx snyk mcp). Snyk does not offer a hosted version of that server. Use this connector to ask questions like "which critical issues are open in project X?" and the CLI server to scan a local checkout. Both cards appear under the Snyk name.
Snyk's API is open to Enterprise plan customers. On Free and Team plans a personal token works for the CLI, IDE and CI/CD integrations only, and the API calls fail. See Authentication for API.
Authentication
The connector supports two methods: OAuth (the default), where each user signs in to Snyk through a Snyk App, and API Key, where one token is shared. Snyk Apps and tokens only work on the hosts of their own region, so you also pick a Region in Willow.
OAuth
Each user signs in with their own Snyk account, and the tools act as that user, in the organizations that user can see. You register a Snyk App once and give Willow its client ID and secret.
Create the Snyk App
-
In Willow, start adding the Snyk connector (see Configure in Willow), select OAuth, and copy the Redirect URL. Note the scopes selected there.
-
Get the ID of the Snyk Organization that will own the app, from the Organization's Settings in Snyk.
-
Create the app with the Snyk API, on the API host of your region (
api.snyk.iobelow), using an API token of a user who can manage apps in that organization:curl --request POST \--url "https://api.snyk.io/rest/orgs/<org_id>/apps/creations?version=2024-10-15" \--header "Authorization: token <API_TOKEN>" \--header "Content-Type: application/vnd.api+json" \--data '{"data": {"type": "app","attributes": {"name": "Willow","context": "user","redirect_uris": ["<Redirect URL from Willow>"],"scopes": ["org.read", "org.project.read", "org.project.snapshot.read", "org.project.ignore.read", "org.collection.read"]}}}'Or run
snyk apps createwith the Snyk CLI. See Create a Snyk App using the Snyk API. -
Copy
client_idandclient_secretfrom the response. Snyk shows the secret once.
context: user lets the app act as each user who signs in, with that user's access. With context: tenant, the user who signs in picks one organization or group for the connection instead.
Scopes
You can't change a Snyk App's scopes after you create it, so put every scope selected in Willow in the app's scopes. The example above uses the default, read-only set:
org.read,org.project.read,org.project.snapshot.read,org.project.ignore.read,org.collection.read(default)org.project.edit— Update Projectorg.project.delete— Delete Project, Delete Targetorg.project.ignore.create,org.project.ignore.delete— Create Project Ignore, Delete Project Ignoreorg.project.tag.edit— Add Project Tag, Remove Project Tag
To add a scope later, create a new app with the full list and replace the client ID and secret in Willow. Users then sign in again. See Scopes to request.
Snyk Apps can't call group-level endpoints, and no app scope covers memberships or audit logs. With OAuth, List Groups, List Group Organizations, List Group Issues, Get Group Issue, List Organization Members and Search Organization Audit Logs fail, and Willow flags them as missing scopes. Turn them off, or use an API key for them.
Access tokens are short-lived. Willow refreshes them with the refresh token, which Snyk replaces on every refresh.
API Key
Willow sends the token as Authorization: token <token>.
Use a service account token. Snyk recommends service accounts for any automation, because they keep working when people change roles or leave. A personal access token also works, for a quick test.
Create a service account token
- In Snyk, open the Group or Organization the connector should reach and go to Settings → Service accounts.
- Click Create a service account and enter a unique name, such as
willow. - Choose a role. The token can do whatever that role can, so pick the narrowest one that covers your tools. For a Group service account, Group Viewer is read-only, Group Admin has full access. For an Organization service account, choose Org Admin, Org Collaborator or a custom role.
- Do not choose OAuth 2.0 client credentials. Those service accounts hand out short-lived access tokens that need refreshing, and this connector does not support them.
- Click Create and copy the token. Snyk shows it once.
Creating a Group service account takes a Group admin. Creating an Organization service account takes a Group member who is an Org Admin, or a Group admin. See Service accounts.
Or create a personal access token
- In Snyk, open your account settings and select the Personal access tokens tab.
- Enter a name, pick an expiry (90 days at most), and click Generate new token.
- Copy the token. Snyk shows it once.
A personal access token acts as you, with your permissions. See Personal Access Tokens (PATs).
Region
Snyk hosts accounts in separate regions, each with its own API host. Pick the one that matches the address you sign in to Snyk at. With OAuth, users sign in on that address and the app must be created on that region's API host.
| Sign-in address | Region in Willow | API host used |
|---|---|---|
app.snyk.io | SNYK-US-01 | api.snyk.io |
app.us.snyk.io | SNYK-US-02 | api.us.snyk.io |
app.eu.snyk.io | SNYK-EU-01 | api.eu.snyk.io |
app.au.snyk.io | SNYK-AU-01 | api.au.snyk.io |
SNYK-US-01 is the default. Snyk for Government and single-tenant (Private Cloud) deployments are not in the list.
Configure in Willow
- In Willow, go to MCP Servers → + Add MCP server.
- Find the Snyk card with the By Willow badge and click + Use.
- Under Configuration, pick your Region.
- Under Authentication, choose a method:
- OAuth: paste the Snyk App's Client ID and Client Secret, and keep the scopes the app was created with.
- API Key: paste the token.
- Click Save Changes. With OAuth, each user signs in to Snyk the first time they use a tool.
- To check it, run Get Current User, then List Organizations. Both are read-only. A
200with your organizations confirms the credentials and region match.
Most tools take an organization ID. Run List Organizations first and use the id it returns.
Available Tools
The Snyk connector provides 31 tools.
Account and organizations (6 tools)
- Get Current User — show who the token belongs to.
- List Organizations — organizations the token can access, filterable by name or group.
- Get Organization — one organization's name, slug and group.
- List Groups — groups the token can access. This is a beta endpoint in Snyk's API.
- List Group Organizations — organizations in a group.
- List Organization Members — members with their role, filterable by email or role.
Projects (4 tools)
- List Projects — projects with their latest issue counts by severity, filterable by name prefix, type, target, criticality and lifecycle.
- Get Project — one project with issue counts, dependency total, tags and lifecycle.
- Update Project — change business criticality, environment, lifecycle, test frequency or tags.
- Delete Project — permanently delete a project.
Targets (3 tools)
- List Targets — repositories, images and other sources, filterable by name or URL.
- Get Target — one target's name, URL and visibility.
- Delete Target — permanently delete a target and the projects imported from it.
Issues (5 tools)
- List Organization Issues — issues across an organization or in one project, filterable by type, severity, status, ignored state and dates.
- Get Organization Issue — one issue in full: CVE and CWE identifiers, severities, exploit maturity, fix options, risk score.
- List Group Issues — the same list across every organization in a group.
- Get Group Issue — one group issue in full.
- List Package Issues — known vulnerabilities of one package version, given as a package URL such as
pkg:npm/lodash@4.17.20. It needs no project.
Issue paths, ignores and tags (7 tools)
- List Issue Paths — the dependency paths through which an issue reaches a project.
- List Project Ignores — ignores set on a project through Snyk. Ignores from
.snykfiles and policies are not included. - Get Project Ignore — the ignores on one issue of a project.
- Create Project Ignore — ignore a vulnerability or license issue, with a reason type, an optional expiry and an optional path.
- Delete Project Ignore — remove every ignore on one issue of a project.
- Add Project Tag — add a key and value tag to a project.
- Remove Project Tag — remove a key and value tag from a project.
Collections (3 tools)
- List Collections — project collections with issue counts by severity.
- Get Collection — one collection's name. Its counts are in List Collections.
- List Collection Projects — projects in a collection with issue counts and last test time.
Policies and audit logs (3 tools)
- List Organization Policies — ignore policies with their review state.
- Get Organization Policy — one policy with its conditions and action.
- Search Organization Audit Logs — user activity in an organization, newest first, from a date range.
Delete Project, Delete Target, Create Project Ignore and Delete Project Ignore change what Snyk reports or remove data. Ignoring an issue hides it from reports. Consider requiring approval for them in Manage Tools.
Pagination
List tools return a next_cursor when more results exist. Pass it back as starting_after (or cursor for audit logs) to get the next page. Snyk returns 10 results per page by default and up to 100 with limit.
Troubleshooting
401 Unauthorized on every call
Cause: The token is wrong, revoked or expired, or it belongs to a different region than the one selected. Snyk tokens are region-specific, and a token used on the wrong region's host returns 401.
Solution: Check the Region against your sign-in address (see the table above). If the region is right, create a new token. Personal access tokens last 90 days at most.
401 or 403 on a Free or Team plan
Cause: The Snyk API is only open to Enterprise plans. On other plans a personal token does not have API access.
Solution: Use a token from an Enterprise account.
403 Forbidden on one tool
Cause: The token's role does not include the permission for that action, or the organization is outside the token's scope. A Group Viewer service account cannot write at all. The tag tools need a Group Admin token.
Solution: Create the service account with a role that has the permission, or at the level (Group or Organization) that contains the organization.
OAuth sign-in fails
Cause: Willow requested a scope the Snyk App was not created with, or the user lacks the permission behind one of the app's scopes. Snyk only completes sign-in when the user has every permission the app asks for.
Solution: Match the scopes in Willow to the app's scopes. If the app needs a different set, create a new app and replace the client ID and secret.
OAuth tools stop working after a while
Cause: The refresh token expired or was revoked, for example when the user revoked the app under Account Settings → Authorized Snyk Apps in Snyk.
Solution: Have the user sign in again.
429 Too Many Requests
Cause: Snyk allows 1620 requests per minute for each API key.
Solution: Wait a minute and retry, or narrow the request with filters and limit.
Additional Resources
- About the Snyk REST API — regions, versioning, pagination, rate limits
- Snyk Apps APIs — create and manage the OAuth app
- OAuth2 API — authorize, token and revoke endpoints
- Authentication for API — token header and token types
- Service accounts — create a service account token
- Personal Access Tokens (PATs)
- Regional hosting and data residency — regions and URLs
- Snyk API reference