> ## Documentation Index
> Fetch the complete documentation index at: https://docs.endorlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Endor Labs MCP server in Google Antigravity

> Learn how to deploy and run the Endor Labs MCP server in Google Antigravity.

Scan dependencies, detect vulnerabilities, find leaked secrets, and review code for security issues directly inside Google Antigravity, powered by your AI agent.

> [!TIP]
>
> You can also connect the [Endor Labs documentation MCP server](https://docs.endorlabs.com/introduction/doc-tools/docs-mcp-server.md) to get accurate, real-time answers about Endor Labs directly in your AI tools.

The Endor Labs MCP server runs locally on your machine as a lightweight process. Your IDE or CLI launches it through `npx` or a system-installed `endorctl` and communicates with it over stdio. When the AI agent needs security context, the server calls the Endor Labs cloud platform and returns the results. The server uses the stdio transport only, so configure it with a `command` and `args` entry rather than an HTTP (`type: http`) URL.

## What you can do

With the Endor Labs MCP server, you can:

* **Check dependency safety** before adding a new package
* **Scan for vulnerabilities and malware** in your open source dependencies
* **Find leaked secrets** accidentally committed in your Git history
* **Run static analysis (SAST)** on your code with the `scan` tool
* **Run AI security reviews** on your code changes (Enterprise Edition)

The MCP server returns the full set of findings for the dependency, package, or code you ask about. It does not perform function-level reachability analysis and does not filter findings by an action policy. For reachability and policy-based findings, run a full Endor Labs scan or use the Endor Labs platform.

> [!NOTE]
>
> **Node.js: 18 or later required, 24 LTS recommended**
>
> The Endor Labs MCP server runs `endorctl` through `npx`, which requires Node.js 18 or later. npm is included with Node.js, so no separate npm installation or version is required. On Node.js versions older than 24, you may see a harmless warning printed before scan output.
>
> ```text theme={null}
> (node:NNNNN) ExperimentalWarning: CommonJS module .../debug/src/node.js is loading ES Module .../supports-color/index.js using require().
> ```
>
> This is a Node.js runtime notice, not an error from `endorctl` or the MCP server, and it does not affect scan results. To silence it, upgrade Node.js to 24 LTS or later, then restart your IDE or CLI. Verify with `node --version`.

## Install the MCP server

The Developer Edition is free and uses default security policies from Endor Labs. You do not need an Endor Labs account. When you use the MCP server for the first time, a browser window opens for authentication through GitHub, GitLab, or Google.

On the agent panel, click **...**, then select **MCP Servers** > **Manage MCP Servers**. Click **Raw Config** to open the raw configuration editor and add the generated configuration.

### Developer Edition Configuration

For manual configuration, copy and paste the following JSON directly into your MCP configuration file.

<details><summary>📄 View JSON configuration</summary></details>

> [!NOTE]
>
> Have questions? Email us at [community-support@endor.ai](mailto:community-support@endor.ai).

The Enterprise Edition enforces your organization's specific security policies. You need your Endor Labs namespace and an authentication method. Ensure that your developers have Read-Only permissions to Endor Labs. See [Authorization policies](https://docs.endorlabs.com/platform-administration/rbac/authorization-policies.md) for more details.

Generate the Enterprise Edition configuration for your organization.

### Enterprise Edition Configuration

<form>
  Pre-existing Endor Labs configuration?

  <fieldset aria-labelledby="mcp-preexisting-label">No
  Yes</fieldset>

  Select **Yes** if you already have Endor Labs configured locally from a previous `endorctl init`. Your existing configuration is used without additional setup.

  Using npx?

  <fieldset aria-labelledby="mcp-using-npx-label">Yes
  No</fieldset>

  Select **Yes** to use `npx` to download and run endorctl from npm. Select **No** if you have endorctl installed directly (e.g. via Homebrew or direct download).

  **Keep endorctl updated.** When using a directly installed endorctl, make sure to keep it updated with your package manager (e.g. `brew upgrade endorctl`) for the best experience. See the [endorctl installation docs](https://docs.endorlabs.com/setup-deployment/cli.md) for details.

  ↺ Reset
  ✦ Generate
</form>

Use the following optional parameters to configure the MCP server:

* `ENDOR_MCP_SERVER_AUTH_MODE`: Forces browser authentication with one of the supported modes: `github`, `gitlab`, `google`, or `sso`. Setting this variable overrides any existing local endorctl credentials. When you omit `ENDOR_MCP_SERVER_AUTH_MODE`, the MCP server reuses valid local endorctl credentials, such as those from `endorctl init`. If it finds no valid credentials, it falls back to browser authentication.
* `ENDOR_NAMESPACE`: Sets the Endor Labs namespace for the MCP server. Required for Enterprise Edition unless you already set a namespace with `endorctl init`. Not needed for Developer Edition.
* `ENDOR_MCP_SERVER_AUTH_TENANT`: Sets the tenant name for SSO authentication. Required when you set `ENDOR_MCP_SERVER_AUTH_MODE` to `sso`.

> [!NOTE]
>
> **Advanced:** Set scan environment variables in the server's `env` block to pass them through to scans. For example, set `SECRETS_RULES_PATH` to point the secret scanner at a custom ruleset. See [Manage secret rules](https://docs.endorlabs.com/scan/secrets/secret-rules.md) to configure custom rules.

## Verify the installation

1. On the agent panel, click **...**, then select **MCP Servers** > **Manage MCP Servers**.

2. Confirm that **endor-cli-tools** appears in the list and is enabled.

### Try a test prompt

After installing the MCP server, try the following prompt in your AI chat or CLI to verify that the tools are working.

```text theme={null}
Check if the npm package lodash version 4.17.20 has any vulnerabilities
```

The MCP server uses the `check_dependency_for_vulnerabilities` tool to check for known vulnerabilities and return the results. If you see a response with vulnerability details, the MCP server is working correctly.

## Manage MCP servers

1. On the agent panel, click **...**, then select **MCP Servers** > **Manage MCP Servers**.

2. From here, you can view active MCP servers, edit configurations through **Raw Config**, or enable and disable individual servers.

## How to use the Endor Labs MCP server

The Endor Labs MCP server provides the following tools:

* `check_dependency_for_vulnerabilities`: Check if a dependency in your project is vulnerable.
* `check_dependency_for_risks`: Check a dependency for security risks including vulnerabilities and malware.
* `get_endor_vulnerability`: Get the details of a specific vulnerability from the Endor Labs vulnerability database.
* `get_resource`: Retrieve additional context from commonly used Endor Labs resources about your software, such as findings, vulnerabilities, and projects.
* `scan`: Run an Endor Labs security scan to detect risks in your open source dependencies, find common security issues, and spot any credentials accidentally exposed in your Git repository.
* `security_review`: Perform security review analysis on code diffs. Analyzes local uncommitted changes (both staged and unstaged) compared to HEAD, or diffs between the main branch and the last commit. The tool sets the [`--diff-scope`](https://docs.endorlabs.com/scan/ai-sast#ai-sast-diff-scans) scan option automatically based on the review type. Requires the Enterprise Edition. You must specify your namespace in the MCP server configuration. You must also enable AI security code review for your namespace in the Endor Labs platform. See [AI security code review](https://docs.endorlabs.com/secure-ai-coding/ai-security-review.md) for setup instructions.

After you set up the MCP server, you can choose to disable the tools that you do not want to use.

## Configure GEMINI.md

Google Antigravity reads `GEMINI.md` files to guide AI development with your project-specific instructions. To enhance the MCP server integration, you can add instructions in `GEMINI.md` at the root of your repository or globally in the `~/.gemini/` directory.

1. Navigate to the root of your repository.

2. Create or edit the `GEMINI.md` file in the root of your repository. For global rules that apply across all projects, create or edit `~/.gemini/GEMINI.md`.

3. Add appropriate rules for your project. For example, you can add a rule to check if the code is free from vulnerabilities.

### Example GEMINI.md instructions

You can use the following `GEMINI.md` instructions as a quick start for the Endor Labs MCP server. Modify the instructions to meet your specific organization's needs. For more information, refer to the [Google Antigravity documentation](https://antigravity.google/docs).

> [tab] SCA Rule Example
>
> ```markdown theme={null}
> # Software Composition Analysis (SCA) Rule (Endor Labs through MCP)
>
> This project uses Endor Labs for automated dependency (SCA) scanning, integrated through the MCP server.
>
> ## Workflow
>
> Do the following steps immediately after a manifest or lockfile (like package.json or go.mod) is created or modified before any other task.
>
> 1. Run `endor-cli-tools` using the `check_dependency_for_vulnerabilities` tool through the MCP server.
> 2. Provide the **ecosystem**, **dependency name**, and **version** always when making this tool call.
> 3. If a vulnerability or error is identified:
>   - Upgrade to the suggested safe version, or
>   - Replace the dependency with a non-vulnerable alternative.
> 4. Re-run the check using `endor-cli-tools` to confirm the issue is resolved.
>
> ## Notes
> - All scans must be performed using the MCP server integration (`endor-cli-tools`). Do not invoke `endorctl` directly.
> ```

> [tab] Secrets Rule Example
>
> ```markdown theme={null}
> # Leaked Secrets Detection Rule (Endor Labs through MCP)
>
> This project uses [Endor Labs](https://docs.endorlabs.com/) for automated security scanning, integrated through the MCP server.
>
> ## Workflow
>
> Do the following steps whenever a file is modified in the repository, and before the end of an agent session.
>
> 1. Run `endor-cli-tools` using the `scan` tool through the MCP server to check for leaked secrets.
> 2. If any secrets or errors are detected:
>   - Remove the exposed secret or correct the error immediately.
>   - Re-run the scan to verify the secret has been properly removed.
> 3. Save scan results and remediation steps in a security log or as comments for audit purposes.
>
> ## Notes
> - All scans must be performed using the MCP server integration (`endor-cli-tools`). Do not invoke `endorctl` directly.
> - This scan must use the path of the directory from which the changed files are in. Use absolute paths.
> ```

> [tab] SAST Rule Example
>
> ```markdown theme={null}
> # Static Application Security Testing (SAST) Rule (Endor Labs through MCP)
>
> This project uses [Endor Labs](https://docs.endorlabs.com/) for automated SAST, integrated through the MCP server.
>
> ## Workflow
>
> Do the following steps whenever a file is modified in the repository, and before the end of an agent session.
>
> 1. Run `endor-cli-tools` using the `scan` tool through the MCP server to perform SAST scans.
> 2. If any vulnerabilities or errors are found:
>   - Present the issues to the user.
>   - Recommend and apply appropriate fixes (e.g., input sanitization, validation, escaping, secure APIs).
> 3. Save scan results and remediation steps in a security log or as comments for audit purposes.
>
> ## Notes
> - All scans must be performed using the MCP server integration (`endor-cli-tools`). Do not invoke `endorctl` directly.
> - Do not invoke Opengrep directly.
> - This scan must use the path of the directory from which the changed files are in. Use absolute paths.
> ```

## Keep endorctl up to date

The default configuration runs `npx -y endorctl`, which downloads the latest published endorctl into the npx cache (`~/.npm/_npx/`) and reuses it on later runs. If you are not getting the latest version, do one of the following:

* Clear the npx cache (`~/.npm/_npx/`), then restart your IDE or CLI so the next run downloads the current endorctl.
* Pin a specific version by changing `endorctl` to `endorctl@<version>` in your `args`.
* Install endorctl yourself and call it directly, with `command` set to `endorctl` and `args` set to `["ai-tools", "mcp-server"]`. Updates are then managed by your package manager, for example `brew upgrade endorctl`. See [Install endorctl](https://docs.endorlabs.com/setup-deployment/cli.md).

## Troubleshooting

Use the following troubleshooting steps to resolve common issues with the Endor Labs MCP server.

> [accordion] MCP server shows disconnected
>
> Run `npx --version` in your terminal. If the command fails, install [Node.js](https://nodejs.org/) version 18 or later (Node.js 24 LTS recommended). After installing, restart your IDE or CLI to reload the MCP server configuration.

> [accordion] Browser auth window does not open
>
> Ensure your IDE or CLI can open a browser. Check firewall or security software that might block browser launch. For Enterprise Edition with SSO, verify that `ENDOR_MCP_SERVER_AUTH_MODE` and `ENDOR_MCP_SERVER_AUTH_TENANT` are set correctly in your MCP configuration.

> [accordion] npx times out behind a corporate proxy
>
> Install endorctl using your preferred method and configure the MCP server to call it directly instead of using npx. In the Enterprise Edition install wizard, select **No** under **Using npx?** to generate the correct configuration. Alternatively, replace the `command` and `args` entries in your MCP configuration manually, using your client's configuration format.
>
> ```json JSON theme={null}
> "command": "endorctl",
> "args": ["ai-tools", "mcp-server"]
> ```
>
> ```toml Codex config.toml theme={null}
> command = "endorctl"
> args = ["ai-tools", "mcp-server"]
> ```
>
> For installation options, see [Install endorctl](https://docs.endorlabs.com/setup-deployment/cli.md). For more details on how npx and a system-installed endorctl differ, see the FAQ entry below.

> [accordion] Understanding npx vs. a system-installed endorctl
>
> The default MCP server configuration uses `npx -y endorctl` to run endorctl. This command downloads endorctl from the npm registry into a temporary cache (`~/.npm/_npx/`) and runs it from there. It does **not** install endorctl globally and does **not** interact with any existing endorctl binary on your system.
>
> If you have endorctl installed separately (for example, through Homebrew or a direct download), the `npx` command runs its own copy and ignores the system-installed version. These two copies are completely independent.
>
> To use your existing endorctl installation instead of npx, select **No** under **Using npx?** in the Enterprise Edition install wizard. This generates a configuration that calls `endorctl` directly, in your client's configuration format.
>
> ```json JSON theme={null}
> "command": "endorctl",
> "args": ["ai-tools", "mcp-server"]
> ```
>
> ```toml Codex config.toml theme={null}
> command = "endorctl"
> args = ["ai-tools", "mcp-server"]
> ```
>
> With this approach, updates are managed by your existing package manager (for example, `brew upgrade endorctl`).

> [accordion] Tools return errors (Enterprise)
>
> Verify your namespace is correct and your user has `Read-Only` permissions in Endor Labs. See [Authorization policies](https://docs.endorlabs.com/platform-administration/rbac/authorization-policies.md) for details. Also ensure endorctl is on your PATH if you installed it globally instead of using npx.

> [accordion] MCP server fails to start on Windows
>
> On Windows, ensure the following prerequisites are met:
>
> * Node.js is installed
> * npm global bin directory is in your PATH
>
> #### Install Node.js
>
> If Node.js is not installed, download and install the **LTS version** from [nodejs.org](https://nodejs.org/). During installation, ensure the option to add Node.js to PATH is selected.
>
> #### Configure the PATH environment variable
>
> After installing Node.js, verify that the npm global bin directory is in your PATH:
>
> 1. Run the following command in the command line.
>
>    ```powershell theme={null}
>    npm config get prefix
>    ```
>
>    This returns the npm global directory path, typically `C:\Users\<YourUsername>\AppData\Roaming\npm`.
>
> 2. Add the npm global directory path to the **Path** variable under **User variables** in your system's environment variables settings.
>
> 3. Restart for the PATH changes to take effect.
>
> #### Verify the setup
>
> Run the following command in your terminal.
>
> ```powershell theme={null}
> npx --version
> ```
>
> If this returns a version number, your Windows setup is complete and the MCP server can use `npx` to run endorctl.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.