Skip to main content
Scan dependencies, detect vulnerabilities, find leaked secrets, and review code for security issues directly inside OpenCode, powered by your AI agent.
You can also connect the Endor Labs documentation MCP server 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, with separate vulnerability and malware results
  • Scan for vulnerabilities and malware in your open source dependencies, including Conan and segment-matched C/C++ projects
  • Find leaked secrets in your working tree, branch diff, or Git history
  • Run SAST and AI SAST scans on your full repository or changed files with the scan tool
  • Inspect schemas and fetch resources using describe_resource_schema and get_resource with field projections
  • Run AI security reviews on your code changes (Enterprise Edition)
Scans initiated through the MCP server skip admission policy evaluation so policy violations don’t block findings from returning to your IDE. By default, the scan tool runs in quick-scan summary mode without function-level reachability analysis. For full reachability and admission policy enforcement, run a full Endor Labs scan or use the Endor Labs platform.
Node.js: 18 or later required, 24 LTS recommendedThe 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.
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

OpenCode reads MCP server definitions from an opencode.json (or opencode.jsonc) configuration file. Add the file to your project root to scope the server to that project, or to ~/.config/opencode/opencode.json to make it available across all projects.

Verify the installation

Confirm that endor-cli-tools appears in the list with a connected status.

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.
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. The following video shows the Endor Labs MCP server in action.

Manage MCP server tools

Use opencode mcp list to view your configured servers and their connection status. To temporarily disable the Endor Labs MCP server without removing it from your configuration, set "enabled": false on its entry in opencode.json. To disable specific tools instead of the entire server, add a tools key to opencode.json. Tool names are prefixed with the server name.

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 version in your project (python, java, go, npm, or maven) has known vulnerabilities.
  • check_dependency_for_risks: Check a dependency version for security risks. Returns confirmed vulnerability IDs (vulnerability_ids) and malware IDs (malware_ids) separately, excluding disputed or withdrawn CVEs and contested malware records.
  • get_endor_vulnerability: Get the details of a specific vulnerability (CVE or GHSA ID) from the Endor Labs vulnerability database.
  • describe_resource_schema: Inspect the valid snake_case field paths for a supported resource type (Project, PackageVersion, Vulnerability, Finding, Metric, ScanRequest, ScanResult, or Policy), optionally scoped with path_prefix and max_depth. Use these paths to request a subset of fields with get_resource.
  • get_resource: Retrieve an Endor Labs resource (Project, PackageVersion, Vulnerability, Finding, Metric, ScanRequest, ScanResult, or Policy) by uuid or exact name. Accepts an optional fields list of field mask paths to return only the requested fields and avoid timeouts on large resources, and an optional namespace override.
  • scan: Run an Endor Labs security scan (vulnerabilities, dependencies, secrets, sast, ai-sast, or ghactions). Requires an absolute repository path and rejects relative paths. Supports the following options:
    • namespace: Override the server’s configured namespace for a single scan call.
    • scan_options.summary: Returns severity counts and the top five findings by default (true). Set scan_options.summary to false to return the full list of findings.
    • scan_options.diff_scope: Limit sast, ai-sast, secrets, or vulnerabilities scans to uncommitted local changes (local) or changes relative to the default branch (baseline). Cannot be combined with pr_incremental, pr_baseline, include_path, or exclude_path.
    • scan_options.languages: Limit dependency scanning to specific languages. Passing "c" selects Conan C/C++ dependency scanning only.
    • scan_options.segment_match_languages: Run source-level segment matching, such as ["c"] for C/C++ projects that don’t use Conan.
  • security_review: Perform security review analysis on code diffs (local_changes or main_vs_last_commit). The tool sets the --diff-scope scan option automatically based on the review type, and accepts an optional namespace override. Requires the Enterprise Edition and AI security code review enabled for your namespace. See AI security code review 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 AGENTS.md

To enhance the MCP server integration, you can add instructions in AGENTS.md at the root of your repository. OpenCode reads AGENTS.md files to guide AI development with your project-specific instructions.
  1. Navigate to the root of your repository.
  2. Create or edit the AGENTS.md file in the root of your repository.
  3. Add appropriate rules for your project. For example, you can add a rule to check if the code is free from vulnerabilities.

Example AGENTS.md instructions

You can use the following AGENTS.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 OpenCode rules documentation.

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.

Troubleshooting

Use the following troubleshooting steps to resolve common issues with the Endor Labs MCP server.
Run npx --version in your terminal. If the command fails, install Node.js version 18 or later (Node.js 24 LTS recommended). After installing, restart your IDE or CLI to reload the MCP server configuration.
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.
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.
For installation options, see Install endorctl. For more details on how npx and a system-installed endorctl differ, see the FAQ entry below.
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.
With this approach, updates are managed by your existing package manager (for example, brew upgrade endorctl).
Verify your namespace is correct and your user has Read-Only permissions in Endor Labs. See Authorization policies for details. Also ensure endorctl is on your PATH if you installed it globally instead of using npx.
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. 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.
    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.
If this returns a version number, your Windows setup is complete and the MCP server can use npx to run endorctl.