Detect AI coding agents installed on this machine and inject the SafeDep MCP server entry into each agent's config file.
Agents supported: Claude Code, Cursor, Gemini CLI, OpenCode, Antigravity, VS Code.
safedep protect mcp install [flags]
| Flag | Description |
|---|---|
--mcp-url <url> |
SafeDep MCP server URL (default: https://mcp.safedep.io/model-context-protocol/threats/v1/mcp). |
--workspace <dir> |
Project directory for workspace-level injection. Empty (default) skips workspace injection. |
Inherits root flags --output, --profile, and --insecure-keychain-fallback.
Requires an authenticated session with API key and tenant credentials stored in the keychain. Run safedep auth login first, or use pnpx @safedep/cli setup mcp for a guided first-time setup.
- Resolves the active profile's API key and tenant from the keychain.
- Derives the machine's stable endpoint identity (
X-Endpoint-ID) from the hardware UUID and hostname. - Detects which supported AI agents are installed on this machine.
- Writes the
mcpServers.safedepentry into each detected agent's config file. The write is idempotent — repeated calls update only thesafedepkey; all other keys in the config file are preserved.
0on success, including the case where no agents are detected.1on any error (missing credentials, filesystem failure, endpoint identity failure).