> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI clients to Agent Gateway

Add the Agent Gateway MCP endpoint URL to Claude, ChatGPT, Cursor, VS Code, Claude Code, Windsurf, Grok Bot or any MCP client, then sign in once.
Each person on your team connects their own AI client to the Gateway's MCP endpoint URL, then signs in with their own account. This page shows how to add the URL to each client, and what happens the first time the client connects.

> note: Available on request
>
> Agent Gateway is available on request. [Contact us](/support/contact-us/) to enable it for your
> workspace.

## Before you start

- **The MCP endpoint URL.** Copy it from **Settings** in Agent Gateway, or from the last step of the [Quickstart](/agentkit/agent-gateway/quickstart/). If your environment has a custom domain, the URL uses it.
- **A Gateway user account** for the person connecting. You're added when you enable the Gateway. [Add more users](/agentkit/agent-gateway/users-and-access/#add-users) under **Identity**.

## Add the URL to your client

The dashboard shows the same steps under **Connect your agent** after setup. In the examples below, replace `<MCP endpoint URL>` with your URL.

### Claude

1. Open Claude, then go to **Settings** > **Connectors**.
2. Select **Add custom connector**.
3. Paste the MCP endpoint URL and select **Add**.

### ChatGPT

1. Open ChatGPT, then go to **Settings** > **Apps** > **Advanced settings**, and turn on **Developer mode**.
2. Add a new connector and paste the MCP endpoint URL.

### Cursor

In the dashboard, pick **Cursor** under **Connect your agent** and select **Open in Cursor**. Cursor opens and adds the Gateway as an MCP server named `gateway`.

### VS Code

1. Open the Command Palette: <kbd>⇧⌘P</kbd> on macOS, <kbd>Ctrl+Shift+P</kbd> on Windows and Linux.
2. Run **MCP: Add Server**, choose **HTTP** and paste the MCP endpoint URL.
3. Name the server, for example `gateway`, and choose **Global** or **Workspace**.

### Claude Code

Run this command in your terminal:

```bash
claude mcp add gateway --transport http <MCP endpoint URL>
```

### Windsurf and other MCP clients

Add the Gateway to the client's MCP server configuration as an HTTP server:

```json
{
  "mcpServers": {
    "gateway": {
      "type": "http",
      "url": "<MCP endpoint URL>"
    }
  }
}
```

The client must support remote MCP servers that sign in with OAuth.

### Grok Bot

1. In a Grok Bot chat, ask it to add the Gateway as a custom server, for example: "Add a custom MCP server called gateway at `<MCP endpoint URL>`".
2. Grok Bot shows a connect card. Select **Authorize** and sign in.

## Sign in the first time

The first time a client connects, it opens a browser window:

1. **Sign in** with your Gateway user account.
2. **Approve the consent screen.** It lets the client act on your behalf through the Gateway.

The client then lists the tools from the Gateway's connections that your groups allow.

## Connect your app accounts

Each person connects their own account for each app, such as their own Gmail or Outlook. The first time a tool needs an app you haven't connected, the client returns a link instead of a result. Open the link, sign in to the app and approve access, then ask the client to try again.

## Review and revoke access

Each user has their own account pages at `<environment URL>/ui/agents/get-started`. **Get started** there shows the MCP endpoint URL and the setup for each client, so you can send teammates that link. The same pages let each user review their own access:

- **Connected apps** lists the apps you've connected. Select **Disconnect** to stop agents from using an app. An agent asks you to connect it again the next time it needs it.
- **Authorized agents** lists the AI clients you've approved. Select **Revoke** to stop a client from getting new tokens. A token it already has keeps working until it expires.

As an admin, you set how long access tokens last with **Access token lifetime** in **Settings**.

## Common problems

### The client can't register with the Gateway

Most AI clients register themselves the first time they connect. In **Settings** > **Advanced configuration**, keep **Allow dynamic client registration** turned on. Some clients identify themselves with a metadata URL instead; for those, turn on **Allow Client ID Metadata Document (CIMD)**.

### The client connects but shows no tools, or fewer than expected

Tools appear only for connections your groups can use. Open the connection under **Connections**, then its **Policies** tab, and select **Preview Access** to see which tools a user gets. See [Access policies](/agentkit/agent-gateway/access-policies/).

### Requests return 404

The Gateway is disabled for the environment. Open **Settings** and select **Re-enable Gateway**. Users, registered clients and logs are kept while it's disabled.


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
