# MCP Setup

Step-by-step setup for connecting your AI assistant to the [Aigon MCP server](/docs/mcp/).

**Endpoint:** `https://mcp.aigon.ai/mcp/`

> **The trailing slash matters.** The URL must end with `/mcp/` (not `/mcp`). Omitting the trailing slash will cause connection failures.

Authentication is handled automatically via [OAuth](/docs/auth/#oauth) — a browser window opens for login and consent on first use.

---

## Claude Code {#claude-code}

Claude Code supports HTTP transport natively:

```bash
claude mcp add aigon-mcp-server --transport http https://mcp.aigon.ai/mcp/
```

Verify with `/mcp` — it should show `aigon-mcp-server` as connected.

---

## Claude Desktop {#claude-desktop}

Add to `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "aigon-mcp-server": {
      "type": "http",
      "url": "https://mcp.aigon.ai/mcp/"
    }
  }
}
```

**File location:**
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`

**Restart Claude Desktop** after editing.

If your version of Claude Desktop does not support HTTP transport, use `mcp-remote` as a bridge:

```json
{
  "mcpServers": {
    "aigon-mcp-server": {
      "command": "npx",
      "args": ["mcp-remote", "https://mcp.aigon.ai/mcp/"]
    }
  }
}
```

**If Claude Desktop cannot find `npx`**, use the absolute path to your Node.js installation:

```json
{
  "mcpServers": {
    "aigon-mcp-server": {
      "command": "/path/to/npx",
      "args": ["mcp-remote", "https://mcp.aigon.ai/mcp/"],
      "env": {
        "PATH": "/path/to/node:/usr/local/bin:/usr/bin:/bin"
      }
    }
  }
}
```

Find your npx path with `which npx` in your terminal.

---

## Claude.ai {#claude-ai}

Go to [claude.ai/customize/connectors](https://claude.ai/customize/connectors), click **+** to add a connector, and enter the SSE endpoint:

```
https://mcp.aigon.ai/sse
```

Claude.ai connectors currently use SSE transport (not HTTP). Note that when the MCP server restarts you may have to disconnect and reconnect at this URL.

![Claude.ai connector setup](/_assets/graphics/claudeai-connector-setup.png)

---

## Cursor {#cursor}

Add to `.cursor/mcp.json` in your project root, or `~/.cursor/mcp.json` for global access:

```json
{
  "mcpServers": {
    "aigon-mcp-server": {
      "url": "https://mcp.aigon.ai/mcp/"
    }
  }
}
```

Cursor supports HTTP transport and OAuth natively.

---

## Gemini CLI {#gemini-cli}

Add to `~/.gemini/settings.json`:

```json
{
  "mcpServers": {
    "aigon-mcp-server": {
      "url": "https://mcp.aigon.ai/mcp/"
    }
  }
}
```

---

## ChatGPT {#chatgpt}

ChatGPT supports remote MCP servers for Pro, Team, and Enterprise users:

1. Go to **Settings → Apps & Connectors**
2. Enable **Developer Mode**
3. Click **Add connector**
4. Enter the server URL: `https://mcp.aigon.ai/mcp/`
5. Select **OAuth** for authentication
6. Click **I trust this application**

Once added, enable it in a chat via the **+** icon → **Developer Mode** → **Add sources**.

---

## Other Clients {#other-clients}

Any client that supports HTTP transport can connect to:

```
https://mcp.aigon.ai/mcp/
```

The server advertises OAuth metadata at `/.well-known/oauth-protected-resource`. Clients that support OAuth 2.1 will handle authentication automatically. See [Authentication](/docs/auth/#oauth) for the full flow.

### SSE Transport (Fallback)

If your client does not support HTTP transport, the legacy SSE endpoint is available at:

```
https://mcp.aigon.ai/sse
```

SSE transport is not recommended for new setups — use HTTP transport where possible.

---

## Troubleshooting

**Browser doesn't open for login**
The OAuth flow requires a browser. Make sure your MCP client supports OAuth 2.1 with PKCE, or use `mcp-remote` which handles it.

**"aigon-mcp-server" not showing as connected**
Check that the endpoint URL is exactly `https://mcp.aigon.ai/mcp/` — the **trailing slash is required**.

**Claude Desktop: "npx not found"**
Claude Desktop runs in a sandboxed environment and may not see your shell PATH. Use the absolute path to `npx` as shown above.
