> 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/goose-cli-guide.md).

# Connect Goose CLI to Snyk

How to set up Snyk Studio and the Snyk MCP server in Goose CLI

Connect Goose CLI 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 the Goose CLI](#install-goosecli)
* [Install the Snyk CLI](https://docs.snyk.io/developer-tools/snyk-cli/install-the-snyk-cli)

Install the Goose CLI. For more details, visit the official [Goose CLI installation instructions.](https://goose-docs.ai/docs/quickstart/)

## Install the Snyk MCP server in Goose CLI using npx command

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

To install the Snyk MCP server using the Goose CLI interactive session, proceed with the following instructions:

* Start an interactive Goose configuration wizard by running the `goose configure` command:

  <figure><img src="https://2912686697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN5N885PkllOWeBmgm3Bp%2Fuploads%2FqYMdaEehAMb3484dow6L%2Fimage%20(288).png?alt=media&amp;token=43e3cfc2-4ff9-495d-8826-e571d5e3b800" alt="Goose CLI interactive session used to add the Snyk MCP server"><figcaption></figcaption></figure>
* From the configuration menu, chose **Add Extension.**
* Choose **Command-line extension (run a local command or script).**
* Name this extension **Snyk Security.**
* Run the command by typing in: `npx -y snyk@latest mcp -t stdio`
* Continue with the defaults (timeout of 300 seconds), and optionally provide the Snyk API token if your Organization policy requires one.

Use the following Goose configuration example:

<figure><img src="https://2912686697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN5N885PkllOWeBmgm3Bp%2Fuploads%2FQ05KJTTHT8XJmgPB8RbP%2Fimage%20(289).png?alt=media&amp;token=1880ae07-202e-42f7-8a80-e30dee56f5e4" alt="Completed Goose configuration walkthrough"><figcaption></figcaption></figure>

Start or resume your Goose session with the Snyk MCP server enabled.

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

This installation instruction assumes you have installed the Snyk CLI and the `snyk` executable is available in your system path.

Install the Snyk MCP server using the Goose CLI interactive session by following these instructions:

* Start an interactive Goose configuration wizard by running the `goose configure` command.
* Choose **Add Extension f**rom the configuration menu.
* Select **Command-line extension (run a local command or script).**
* Name this extension **Snyk Security.**
* Run the command by typing in: `/path/to/snyk mcp -t stdio` - replacing `/path/to/snyk` with the fully qualified absolute path to your Snyk CLI.
* Continue with the defaults (timeout of 300 seconds), and optionally provide the Snyk API token if your Organization policy requires one.

{% 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 %}

Start or resume your Goose session with the Snyk MCP server enabled.

## 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.

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%2FGcDiEJ9FDLiwHZug6nHz%2Fimage%20(291).png?alt=media&amp;token=823196ee-ebf7-4cc4-9352-530ab1ba0f4f" alt="Prompting Goose CLI to authenticate the Snyk account"><figcaption></figcaption></figure>

If you are not authenticated, this prompt opens a browser for you to authenticate to the Snyk Web UI, and then you can continue with the agent.

<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 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).

Use the generic rule text with [Goose CLI recipes](https://goose-docs.ai/docs/guides/recipes/session-recipes/) or with the [Goose hints file](https://goose-docs.ai/docs/guides/context-engineering/using-goosehints/). Add it to the `.goosehints` file in the root directory of the project.

## 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 %}

Goose CLI invokes Snyk scanning, providing output, and insights based on the results that Snyk returned:

<figure><img src="https://2912686697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN5N885PkllOWeBmgm3Bp%2Fuploads%2FXRyXl0I8JuLcWIpYmB4g%2Fimage%20(292).png?alt=media&amp;token=312eaef5-0225-406c-87aa-53726361115e" alt="Goose CLI 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/goose-cli-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.
