SafeDep
Real-time malicious package protection for AI coding agents
Documentation
SafeDep MCP Server
Protect your AI coding agents against malicious packages using SafeDep MCP
The SafeDep MCP server lets your AI coding agent check a package against SafeDep threat intelligence before it installs the package.
[!NOTE]
SafeDep MCP has a free tier. See pricing for details.
[!NOTE]
With SafeDep Cloud, MCP Advisor in Endpoint Hub shows the packages that your agents check, with the verdict for each one. It shows only the checks of an agent that you set up with the SafeDep CLI, because only the CLI adds the endpoint ID to the agent config.
Quick Start
1. Run the setup command
The command signs you in, creates an API key, and configures SafeDep in each supported AI coding agent on your machine. It supports Claude Code, Cursor, VS Code, Gemini CLI, OpenCode and Antigravity. For Codex, Windsurf and Zed, use the Manual Setup.
[tab] npx
npx @safedep/cli setup mcp install
[tab] pnpx
pnpx @safedep/cli setup mcp install
[tab] bunx
bunx @safedep/cli setup mcp install
To also add SafeDep to the config of one project, add --workspace <project-dir>. Antigravity has no project config. To sign in again, add --force.
[!WARNING]
The project config holds your API key. For Cursor, Gemini CLI, OpenCode and VS Code, the file is in the project directory. Do not commit it to Git.

2. Test the Integration
Ask your coding agent to install a test package:
| Package | Ecosystem |
|---|---|
safedep-test-pkg | npm |
safedep-test-pkg | PyPI |
These packages are harmless, but the SafeDep database marks them as malicious for tests. For example, use this prompt:
Install the npm package safedep-test-pkg
The agent checks the package against SafeDep threat intelligence, warns that SafeDep flags the package as malicious, and does not install it.

Endpoints
| Endpoint | Description |
|---|---|
https://mcp.safedep.io/model-context-protocol/threats/v1/mcp | SafeDep MCP endpoint (HTTP) |
https://mcp.safedep.io/model-context-protocol/threats/v1/sse | Legacy SSE endpoint |
Authentication
The MCP server requires API key authentication. The following HTTP headers are required:
| Header | Description |
|---|---|
Authorization | <API Key> |
X-Tenant-ID | your-tenant-domain (e.g. default-team.your-domain.safedep.io) |
[!TIP]
Your tenant domain is shown in SafeDep Cloud settings after you sign in.
Manual Setup
To configure an agent manually, or if the CLI did not auto-detect yours, follow the instructions below. Each configuration requires a SafeDep API key and your tenant domain. Create an API key in SafeDep Cloud settings.
[accordion] Claude Code
Use
claudeCLI to add the MCP server to your user settings. This configuration will be available across all Claude Code projects.claude mcp add -s user --transport http safedep \ https://mcp.safedep.io/model-context-protocol/threats/v1/mcp \ --header "Authorization: <API Key>" \ --header "X-Tenant-ID: <Tenant Domain>"
[accordion] Cursor
Add the SafeDep MCP server to your Cursor configuration. Create or edit
~/.cursor/mcp.jsonin your home directory:{ "mcpServers": { "safedep": { "url": "https://mcp.safedep.io/model-context-protocol/threats/v1/mcp", "headers": { "Authorization": "<API Key>", "X-Tenant-ID": "<Tenant Domain>" } } } }Restart Cursor after saving the configuration. You can verify the server connection in Cursor Settings > MCP Servers.
See the Cursor MCP documentation for more details.
[accordion] VS Code
Add the SafeDep MCP server to your VS Code configuration. Create or edit the user-level
mcp.jsonfile for your platform:
Platform Path Linux ~/.config/Code/User/mcp.jsonmacOS ~/Library/Application Support/Code/User/mcp.jsonWindows %APPDATA%\Code\User\mcp.json{ "servers": { "safedep": { "type": "http", "url": "https://mcp.safedep.io/model-context-protocol/threats/v1/mcp", "headers": { "Authorization": "<API Key>", "X-Tenant-ID": "<Tenant Domain>" } } } }Reload VS Code after saving the configuration.
[accordion] Gemini CLI
Add the SafeDep MCP server to your Gemini CLI configuration. Edit
~/.gemini/settings.jsonin your home directory:{ "mcpServers": { "safedep": { "httpUrl": "https://mcp.safedep.io/model-context-protocol/threats/v1/mcp", "headers": { "Authorization": "<API Key>", "X-Tenant-ID": "<Tenant Domain>" } } } }See the Gemini CLI repository for MCP configuration details.
[accordion] OpenCode
Add the SafeDep MCP server to your OpenCode configuration. Create or edit
~/.config/opencode/opencode.jsonin your home directory:{ "mcp": { "safedep": { "type": "remote", "url": "https://mcp.safedep.io/model-context-protocol/threats/v1/mcp", "enabled": true, "headers": { "Authorization": "<API Key>", "X-Tenant-ID": "<Tenant Domain>" } } } }
[accordion] Antigravity
Add the SafeDep MCP server to your Antigravity configuration. Create or edit
~/.gemini/antigravity/mcp_config.jsonin your home directory:{ "mcpServers": { "safedep": { "serverUrl": "https://mcp.safedep.io/model-context-protocol/threats/v1/mcp", "headers": { "Authorization": "<API Key>", "X-Tenant-ID": "<Tenant Domain>" } } } }
[accordion] OpenAI Codex
Add the SafeDep MCP server to your Codex configuration. Edit
~/.codex/config.toml(or.codex/config.tomlin your project root for project-scoped access):[mcp_servers.safedep] url = "https://mcp.safedep.io/model-context-protocol/threats/v1/mcp" [mcp_servers.safedep.env_http_headers] "Authorization" = "SAFEDEP_API_KEY" "X-Tenant-ID" = "SAFEDEP_TENANT_ID"Set the environment variables with your credentials:
export SAFEDEP_API_KEY="<API Key>" export SAFEDEP_TENANT_ID="<Tenant Domain>"See the Codex repository for MCP configuration details.
[accordion] Windsurf
Add the SafeDep MCP server to your Windsurf configuration. Create or edit
~/.codeium/windsurf/mcp_config.jsonin your home directory:{ "mcpServers": { "safedep": { "url": "https://mcp.safedep.io/model-context-protocol/threats/v1/mcp", "headers": { "Authorization": "<API Key>", "X-Tenant-ID": "<Tenant Domain>" } } } }See the Windsurf Cascade MCP documentation for more details.
[accordion] Zed
Add the SafeDep MCP server to your Zed configuration. Create or edit
~/.config/zed/settings.jsonin your home directory.{ "context_servers": { "safedep": { "enabled": true, "url": "https://mcp.safedep.io/model-context-protocol/threats/v1/mcp", "headers": { "Authorization": "<API Key>", "X-Tenant-ID": "<Tenant Domain>" } } } }See the Zed MCP documentation for more details.
This documentation is built and hosted on Mintlify, a developer documentation platform.