# Connect an agent

Follow the setup steps for your agent. If the agent is not yet approved for your organization, an **Admin** or **Business Admin** can approve it during sign-in. Use the client id in [Introduction](/marketing-api/Ads-MCP/Introduction.md#supported-agents).

Each supported agent uses a client id registered by Snap — you do not need to request or register one. A client id from your own Marketing API OAuth app fails with `invalid_client` at authorization.

## Claude[​**](#claude "Copy to clipboard")

In the command-line examples below, `snap-ads` is a local name only — it identifies the server in the client's own configuration and namespaces its tools.

### Claude Code[​**](#claude-code "Copy to clipboard")

```
claude mcp add --transport http --client-id claude-snap-ads snap-ads https://mcp.snapchat.com/ads
claude mcp login snap-ads
```

Add `--no-browser` to `login` on a headless or SSH session to print the authorization URL instead of opening a browser.

### Claude Desktop and Claude web[​**](#claude-desktop-and-claude-web "Copy to clipboard")

Both surfaces share one account-synced connector, so adding it once covers both.

1. Open **Settings → Connectors → Add custom connector**.
2. Set the URL to `https://mcp.snapchat.com/ads`.
3. In the advanced options, set the OAuth client id to `claude-snap-ads` and leave the client secret empty.
4. Save the connector, then connect, and complete the Snapchat sign-in and approval.

### Claude Desktop through a local bridge[​**](#claude-desktop-through-a-local-bridge "Copy to clipboard")

This is an alternative to the connector above, not an addition to it. Claude Desktop can also reach the server through a bridge process that runs on your own machine. Add the following to `~/Library/Application Support/Claude/claude_desktop_config.json`:

```
{
  "mcpServers": {
    "snap-ads": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote@0.1.38",
        "https://mcp.snapchat.com/ads",
        "--static-oauth-client-info",
        "{\"client_id\":\"claude-snap-ads\",\"scope\":\"snapads.read\"}"
      ]
    }
  }
}
```

Two details are load-bearing:

* **Keep `scope` exactly as shown.** Without it the bridge requests a default set of scopes this server rejects, and authorization fails.
* **The desktop app does not inherit your shell environment.** If it cannot find `npx`, replace `command` with an absolute path to your Node installation and add an `env` block setting `PATH`.

## Codex and ChatGPT[​**](#codex-and-chatgpt "Copy to clipboard")

### Codex CLI[​**](#codex-cli "Copy to clipboard")

```
codex mcp add snap-ads --url https://mcp.snapchat.com/ads --oauth-client-id codex-snap-ads
codex mcp login snap-ads
```

`--url` selects the streamable-HTTP transport. Codex derives its own callback path and port, both already registered, so there is no redirect URI to configure.

A server you add here is also available in the ChatGPT desktop app, and using it there still authorizes as `codex-snap-ads`. If you want the ChatGPT registration instead, add a connector in the ChatGPT web app.

### ChatGPT[​**](#chatgpt "Copy to clipboard")

Add the connector in the **ChatGPT web app**. It is account-synced, so adding it once also makes it available in the ChatGPT desktop app. The desktop app's own custom MCP form is a different feature and cannot be used here, because it has no field for an OAuth client id.

Use these values:

| Setting                    | Value                                |
| -------------------------- | ------------------------------------ |
| Server URL                 | `https://mcp.snapchat.com/ads`       |
| Registration method        | User-defined OAuth client            |
| OAuth client id            | `chatgpt-snap-ads`                   |
| OAuth client secret        | Leave blank                          |
| Token endpoint auth method | `none`                               |
| Scopes                     | `snapads.read`                       |
| Authorization URL          | `https://mcp.snapchat.com/authorize` |
| Token URL                  | `https://mcp.snapchat.com/token`     |
| Resource                   | `https://mcp.snapchat.com/ads`       |

Leave the registration URL and every OpenID Connect field empty. This server supports neither dynamic client registration nor OpenID Connect.

ChatGPT generates the callback URL and shows it read-only. It should read:

`https://chatgpt.com/connector/oauth/l7g6JBPw-yDI`

Snap has already registered this URL; no advance setup is required. If ChatGPT shows a different URL, contact your Snap Account Manager about the callback URL before authorizing.

## Antigravity and Gemini[​**](#antigravity-and-gemini "Copy to clipboard")

### Antigravity[​**](#antigravity "Copy to clipboard")

Antigravity's MCP panel has no client id field, so configure it as JSON. Use its **Open MCP Config** action and edit `~/.gemini/config/mcp_config.json`:

```
{
  "mcpServers": {
    "snap-ads": {
      "type": "http",
      "url": "https://mcp.snapchat.com/ads",
      "oauth": {
        "enabled": true,
        "clientId": "antigravity-snap-ads",
        "scopes": ["snapads.read"]
      }
    }
  }
}
```

Then connect from the panel and complete the Snapchat sign-in and approval. Antigravity supplies its own callback address, so there is no `redirectUri` to set or omit.

Include `"type": "http"`. Without it the panel reports `Error: calling "initialize": rejected by transport: Service Unavailable`, which reads as a server outage but is a client-side transport selection problem.

### Gemini CLI[​**](#gemini-cli "Copy to clipboard")

The Gemini CLI signs in to Google separately from the connection it makes to Snap, and the two are independent. Recent CLI builds have retired the individual **Sign in with Google** option, which now fails with a message pointing to Antigravity, so start the CLI with a Gemini API key or with Vertex AI credentials before adding the Snap connection. If you would rather not manage the CLI's own credentials, use [Antigravity](#antigravity) instead.

`gemini mcp add --transport http snap-ads https://mcp.snapchat.com/ads` registers the server, but the CLI exposes no flag for a pre-registered OAuth client, so set the client id directly in `~/.gemini/settings.json`:

```
{
  "mcpServers": {
    "snap-ads": {
      "type": "http",
      "url": "https://mcp.snapchat.com/ads",
      "oauth": {
        "enabled": true,
        "clientId": "gemini-snap-ads",
        "scopes": ["snapads.read"]
      }
    }
  }
}
```

The CLI attempts dynamic client registration first, so `clientId` is required rather than optional. Use `type` and `url` — `httpUrl` is deprecated — and keep `scopes` an array. There is no `mcp auth` subcommand, so authorize from inside the CLI with `/mcp auth snap-ads`.

Do not set `redirectUri`. The CLI serves its callback on one fixed path, and `oauth.redirectUri` changes only the address sent to the authorization server, not the path it listens on. Pointing it elsewhere produces a successful approval followed by a "Not found" page, leaving the connection incomplete.
