> For the complete documentation index, see [llms.txt](https://docs.snyk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snyk.io/agent-security/agentic-security-with-snyk-studio/quickstart-guides/cline-guide.md).

# Connect Cline to Snyk

How to set up Snyk Studio and the Snyk MCP server in Cline

Connect Cline to the local Snyk MCP server to scan code and dependencies from your coding assistant.

{% hint style="info" %}
This setup provides MCP access. It does not install Studio Secure at inception hooks. Rules instruct the agent when to scan and depend on the model following those instructions.

For clients supported by the Studio CLI installer, use [Getting started with Snyk Studio](https://docs.snyk.io/agent-security/agentic-security-with-snyk-studio/getting-started-with-snyk-studio.md). For enterprise deployment, use the [Agentic Development Security (ADS) installer](https://docs.snyk.io/agent-security/evo-by-snyk/agentic-development-security-ads/activation-and-deployment.md).
{% endhint %}

## Prerequisites

* Install Cline
* [Install the Snyk CLI](https://docs.snyk.io/developer-tools/snyk-cli/install-the-snyk-cli)

Consult the official Cline documentation for [Cline installation instructions](https://docs.cline.bot/getting-started/installing-cline).

## Install the Snyk MCP server in Cline using npx

This installation instruction assumes you have a Node.js local development environment setup with the `npx` executable.

Open the Cline MCP configuration from **MCP Servers** in the top toolbar. Select **Configure**, then **Configure MCP Servers**. Visit the [Cline MCP documentation](https://docs.cline.bot/mcp/mcp-overview).

<figure><img src="https://2912686697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN5N885PkllOWeBmgm3Bp%2Fuploads%2F8micjAAA3GCeCRtV05Rk%2Fimage%20(352).png?alt=media&amp;token=8ea99120-a6b1-4473-bbfb-93764f6fcab2" alt="Manage MCP Servers icon in the Cline bottom panel"><figcaption></figcaption></figure>

Click the **Configure MCP Servers** button from the **MCP Servers** tab:

<figure><img src="https://2912686697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN5N885PkllOWeBmgm3Bp%2Fuploads%2FKOLbwow3XWWAfddf1el1%2Fimage%20(353).png?alt=media&amp;token=ae4d7565-1d78-4904-af95-3a8b34aebdc7" alt="Configure MCP Servers button on the MCP Servers tab"><figcaption></figcaption></figure>

To install the Snyk MCP server, add the following `mcpServers` configuration block to the Cline MCP Servers configuration file:

```json5
{
  "mcpServers": {
    "Snyk Security": {
      "command": "npx",
      "args": ["-y", "snyk@latest", "mcp", "-t", "stdio"]
    }
  }
}
```

## Install the Snyk MCP server in Cline using Snyk CLI

Ensure that the Snyk CLI is installed and that the `snyk` executable is available in your system path.

To install the Snyk MCP server with the Snyk CLI, follow these instructions:

* Add the following `mcpServers` configuration block to the Cline MCP Servers configuration file:

  ```json5
  {
    "mcpServers": {
      "Snyk Security": {
        "command": "/absolute/path/to/snyk",
        "args": ["mcp", "-t", "stdio"]
      }
    }
  }
  ```

{% hint style="info" %}
If you installed `snyk` using npm as a global module and you are using fnm to manage your versions, then you must specify the absolute path to the `snyk` executable. For example: `/Users/username/.local/state/fnm_multishells/8831_1753881185071/bin/snyk`.
{% endhint %}

After saving the MCP Servers configuration, confirm the Snyk MCP server is successfully installed and listed in the Cline UI.

<figure><img src="https://2912686697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN5N885PkllOWeBmgm3Bp%2Fuploads%2Fn7BCnAxnIcyVnWYO02JA%2Fimage%20(354).png?alt=media&amp;token=97b69cd4-4dbd-46e9-b623-80ae7ec7107f" alt="Snyk MCP server listed as installed in Cline"><figcaption></figcaption></figure>

## Set up the Snyk MCP server

Authenticate with Snyk and complete the client's trust request for the repository directory when prompted.

The assistant invokes the authentication and trust workflows. Complete any browser confirmation request.

<figure><img src="https://2912686697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN5N885PkllOWeBmgm3Bp%2Fuploads%2FStm3NoyCMSz2LS2GrN7W%2Fimage.png?alt=media&amp;token=9be18d8b-903e-4614-ae47-8b2bc7e5bf46" alt="Cline running a Snyk workflow through the MCP server"><figcaption></figcaption></figure>

You can explicitly prompt to authenticate your account as follows:

```
Authenticate my Snyk account
```

<figure><img src="https://2912686697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN5N885PkllOWeBmgm3Bp%2Fuploads%2FTUoB0HFdV96KOI6ljJR2%2Fimage%20(355).png?alt=media&amp;token=39d841d6-1f2e-471f-bc8c-67887d7e9412" alt="Asking Cline to authenticate the Snyk account"><figcaption></figcaption></figure>

After enabling Act mode and approving the request, the agent opens a browser for you to authenticate to the Snyk Web UI, then continues the session.

<figure><img src="https://2912686697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN5N885PkllOWeBmgm3Bp%2Fuploads%2F30hph000Rxu2wufNaIcW%2Fimage.png?alt=media&amp;token=5dcb41d2-5f19-469f-ae83-fc1db7143a9a" alt="Browser opened by the agent to authenticate to the Snyk Web UI" width="375"><figcaption></figcaption></figure>

## Secure at inception rules

Add rules to guide the assistant when invoking Snyk scans. Rules do not guarantee that the model runs a scan. For the generic rule text, visit [Rules for manual MCP integrations](https://docs.snyk.io/agent-security/agentic-security-with-snyk-studio/directives.md#rules-for-manual-mcp-integrations).

The following is a suggested instruction for [Cline rules](https://docs.cline.bot/features/cline-rules). Open the Rules and Workflows menu using the bottom chat navigation from Cline.

<figure><img src="https://2912686697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN5N885PkllOWeBmgm3Bp%2Fuploads%2FLTKALrk4MAT1rxaOZ9PV%2Fimage.png?alt=media&amp;token=fd8bc016-9103-449f-9054-18505ec4231e" alt="Snyk rules added to the Cline rules configuration"><figcaption></figcaption></figure>

Add the generic rule text as a global rule.

## Examples

In the chat, you can tag specific files or functions and ask the agent to scan your code and third-party dependencies of the Project.

{% code title="prompt" overflow="wrap" %}

```
Scan this directory for code security & dependency vulnerabilities and security issues
```

{% endcode %}

Cline invokes Snyk scanning tools and summarizes the results:

<figure><img src="https://2912686697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN5N885PkllOWeBmgm3Bp%2Fuploads%2FM5ktlMLhoCe13LHAFWAG%2Fimage.png?alt=media&amp;token=c8b5a48a-20f2-4b09-8290-f03c46569365" alt="Cline reporting the results of a Snyk scan"><figcaption></figcaption></figure>

If the connection fails, visit [Troubleshooting](https://docs.snyk.io/agent-security/agentic-security-with-snyk-studio/troubleshooting.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snyk.io/agent-security/agentic-security-with-snyk-studio/quickstart-guides/cline-guide.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
