# MCP Configuration for AI Coding Agents --- The Model Context Protocol (MCP) allows AI coding agents to interact with your Deployment.io infrastructure. Once configured, agents like Claude Code, Cursor, OpenAI Codex, Gemini CLI, and Antigravity can deploy your apps, manage environments, fetch runtime logs, and monitor builds — directly from your development workflow. ## Prerequisites - A Deployment.io account ## Connection Methods There are two ways to connect your coding agent to Deployment.io: 1. **OAuth (recommended)** — The agent opens a browser window, you log in and approve access. No manual key copying needed. 2. **API Key** — Generate a key from the dashboard and paste it into your agent's configuration. --- ## Method 1: OAuth (Recommended) OAuth lets you connect with a single click — no API key to copy or manage. ### Claude Code CLI Run the following command: ```bash claude mcp add --transport http Deployment-io https://api.deployment.io/v1/mcp ``` Claude Code will open a browser window where you log in to Deployment.io and approve access. The connection is established automatically. ### Claude Desktop 1. Go to **Customize > Connectors > + > Add custom connector**. 2. Enter the name `Deployment-io` and the URL: `https://api.deployment.io/v1/mcp` 3. Claude Desktop will open a browser for you to log in and approve access. ### Cursor 1. Open Cursor and go to **Settings > Tools & MCP**. 2. Click **Add Custom MCP**. 3. Enter the URL: `https://api.deployment.io/v1/mcp` 4. Cursor will open a browser for you to log in and approve access. ### OpenAI Codex 1. Add the server to your `~/.codex/config.toml`: ```toml [mcp_servers.Deployment-io] url = "https://api.deployment.io/v1/mcp" ``` 2. Run the OAuth login command: ```bash codex mcp login Deployment-io ``` Codex will open a browser window where you log in to Deployment.io and approve access. ### Antigravity 1. Open the **Menu** in the Agent pane and go to **MCP Servers > Manage MCP Servers**. 2. Click **View raw config** to open `mcp_config.json`. 3. Add the following configuration: ```json { "mcpServers": { "Deployment-io": { "serverUrl": "https://api.deployment.io/v1/mcp" } } } ``` 4. Click **Refresh**. Antigravity will open a browser for you to log in and approve access. --- ## Method 2: API Key If your agent doesn't support OAuth, or you prefer manual configuration, use an API key. ### Step 1: Generate an API Key 1. Go to **Organization Settings > Agent Keys** in your Deployment.io dashboard. 2. Click **Create New Key** and give it a descriptive name (e.g., "Claude Code Key"). 3. Copy the API key immediately — you won't be able to see it again. ### Step 2: Copy the MCP Configuration After generating your key, you'll see an MCP JSON configuration block like this: ```json { "mcpServers": { "Deployment-io": { "url": "https://api.deployment.io/v1/mcp", "headers": { "Authorization": "Bearer YOUR_API_KEY" } } } } ``` Replace `YOUR_API_KEY` with the key you copied in Step 1. ### Agent Setup with API Key #### Claude Code CLI ```bash claude mcp add --transport http Deployment-io https://api.deployment.io/v1/mcp \ --header "Authorization: Bearer YOUR_API_KEY" ``` #### Claude Desktop Add the configuration to your `claude_desktop_config.json` file: - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json` - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json` Merge the MCP JSON config from Step 2 into the file. #### Cursor 1. Open Cursor and go to **Settings > Tools & MCP**. 2. Click **Add Custom MCP**. 3. Paste the MCP JSON configuration from Step 2 into the editor. 4. Save and restart Cursor. #### Windsurf 1. Open Windsurf and go to **Settings > MCP**. 2. Click **Add Server** and select **HTTP**. 3. Paste the MCP JSON configuration from Step 2. 4. Save and restart Windsurf. #### OpenAI Codex Add the server to your `~/.codex/config.toml`: ```toml [mcp_servers.Deployment-io] url = "https://api.deployment.io/v1/mcp" bearer_token_env_var = "DEPLOYMENT_IO_API_KEY" ``` Then set the environment variable: ```bash export DEPLOYMENT_IO_API_KEY=YOUR_API_KEY ``` #### Gemini CLI Run the following command: ```bash gemini mcp add -s user --transport http \ --header "Authorization: Bearer YOUR_API_KEY" \ Deployment-io https://api.deployment.io/v1/mcp ``` Or manually add to your `~/.gemini/settings.json`: ```json { "mcpServers": { "Deployment-io": { "httpUrl": "https://api.deployment.io/v1/mcp", "headers": { "Authorization": "Bearer YOUR_API_KEY" } } } } ``` #### Antigravity 1. Open the **Menu** in the Agent pane and go to **MCP Servers > Manage MCP Servers**. 2. Click **View raw config** to open `mcp_config.json`. 3. Add the following configuration: ```json { "mcpServers": { "Deployment-io": { "serverUrl": "https://api.deployment.io/v1/mcp", "headers": { "Authorization": "Bearer YOUR_API_KEY" } } } } ``` 4. Click **Refresh** and restart Antigravity. --- ## Troubleshooting - **Verify your connection works:** Run a simple prompt like "list my environments" in your agent. If the connection is working, you'll see your environments listed. - **Check the MCP URL:** Ensure the URL is exactly `https://api.deployment.io/v1/mcp` with no trailing slash. - **OAuth issues:** If the browser authorization window doesn't open, check that your agent supports OAuth-based MCP connections. Fall back to the API key method if needed. - **Regenerate the key:** If your API key stops working, it may have been revoked. Create a new one from the Agent Keys settings page. - **Revoke access:** You can revoke OAuth-connected agents or API keys anytime from **Organization Settings > Agent Keys**. --- Source: https://deployment.io/docs/coding-agents/mcp-configuration/