Guided first-time onboarding: authenticate with SafeDep Cloud and inject the SafeDep MCP server into AI coding agent config files in a single command.
Agents supported: Claude Code, Cursor, Gemini CLI, OpenCode, Antigravity.
safedep setup mcp install [flags]
| Flag | Description |
|---|---|
--mcp-url <url> |
SafeDep MCP server URL (default: https://mcp.safedep.io/model-context-protocol/threats/v1). |
--workspace <dir> |
Project directory for workspace-level injection. Empty (default) skips workspace injection. |
--force |
Bypass credential check and always re-authenticate via device flow. |
Inherits root flags --output, --profile, and --insecure-keychain-fallback.
- Checks for existing credentials (API key + tenant) in the active profile's keychain. If found and
--forceis not set, skips authentication and goes directly to agent configuration. - If no credentials exist (or
--forceis set): runs the OAuth2 device-code flow, prompts for tenant selection (and registration if the account is new), creates an API key, and saves everything to 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.
If authentication succeeds but agent configuration fails, credentials are kept and an advisory message is printed. Use safedep protect mcp install to retry the configuration step.
0on success, including the case where no agents are detected.1on authentication or keychain error.