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

# Connect Factory to Snyk

How to configure the local Snyk MCP server for the Factory App and Droid

Connect Factory to the local Snyk MCP server to scan code and dependencies from your coding assistant. The Factory App and Droid use the user-level MCP configuration at `~/.factory/mcp.json`.

{% hint style="info" %}
This is a manual MCP integration. It does not install Snyk Studio Secure at inception hooks or Agentic Development Security (ADS) Agent Behavior Governance hooks for Factory. Rules guide the model when invoking scans and do not guarantee tool execution.
{% endhint %}

## Install Factory

Install the [Factory App](https://docs.factory.com/factory-app/quickstart), or use [Droid in your terminal or IDE](https://docs.snyk.io/agent-security/agentic-security-with-snyk-studio/quickstart-guides/factory-terminal-ide-guide.md). Install and authenticate the [Snyk CLI](https://docs.snyk.io/developer-tools/snyk-cli/install-the-snyk-cli), and enable the Snyk products you want to scan with.

```bash
snyk auth
```

## Install the Snyk MCP server in Factory

Create or edit `~/.factory/mcp.json`. Merge the Snyk entry into the existing `mcpServers` object and preserve your other server entries:

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

Replace the `command` value with the absolute path to your Snyk CLI executable. For configuration scope and server management, visit the [Factory MCP documentation](https://docs.factory.com/harness/mcp).

## Set up the Snyk MCP server

Open the repository you want to scan. Check that Factory loads the Snyk MCP server, then complete any Snyk authentication or repository-trust request.

In Droid, use `/mcp` to inspect the server connection and available tools. For scan or authentication failures, visit [Troubleshooting](https://docs.snyk.io/agent-security/agentic-security-with-snyk-studio/troubleshooting.md).

## Secure at inception rules

To guide scans during development, add the generic rule text to your repository's `AGENTS.md`, for example under a `## Security scanning` heading. For the instruction file's location and behavior, visit the [Factory AGENTS.md documentation](https://docs.factory.com/harness/agents-md). 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).

These are model instructions, not programmatic hooks. Visit [Directives](https://docs.snyk.io/agent-security/agentic-security-with-snyk-studio/directives.md) for the differences between rules, hooks, commands, and skills.

## Examples

Ask Factory to invoke Snyk scanning tools:

```
Scan this repository for code and dependency vulnerabilities. Summarize the findings before making changes.
```

Review the tool calls and scan results. A successful direct MCP scan confirms that Factory can invoke Snyk tools. It does not verify automatic Studio hook scanning.


---

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