# Connecting AI agents (MCP)

Connect Claude, ChatGPT, Cursor, and other agent clients to your account over MCP, with OAuth or an API key.

Source: https://nextjs-saas-template.lubomirgeorgiev.com/docs/mcp
Index: https://nextjs-saas-template.lubomirgeorgiev.com/llms.txt

The public API is also a remote MCP server, so any compatible agent client can use it as a set of tools. Every REST operation becomes one tool, derived from the same OpenAPI document this site publishes.

[Browse the REST API reference](https://nextjs-saas-template.lubomirgeorgiev.com/docs/api.md) [How authentication works](https://nextjs-saas-template.lubomirgeorgiev.com/docs/authentication.md)

## Option 1: sign in with OAuth

Paste the endpoint URL into the client and it discovers the authorization server and opens a consent screen in your browser. Clients with a stable metadata-document identity use it directly; other compatible clients dynamically register as a fallback. You approve the requested scopes once, and the grant can be revoked under Settings → API & MCP. OAuth is the only option for hosted assistants with no bearer-token field.

## Option 2: send an API key

Create a key in your account settings, grant it only the scopes the agent needs, and have the client send it as an Authorization bearer header. The secret is shown once at creation. Command-line and editor clients support this; it needs no browser round trip, which makes it convenient for scripts and CI.

## Per-client setup

MCP endpoint

`https://nextjs-saas-template.lubomirgeorgiev.com/mcp`

Streamable HTTP. Most clients only need this URL.

The client opens a browser window and you approve the requested scopes once. Nothing to copy, and you can revoke it later from the connected apps list under Settings → API & MCP.

Claude Code

streamable-http

[Client docs](https://docs.claude.com/en/docs/claude-code/mcp)

Run this command.

```bash
claude mcp add --transport http saas-template https://nextjs-saas-template.lubomirgeorgiev.com/mcp
# then run /mcp inside Claude Code and authenticate in the browser
```

claude.ai / Claude Desktop

streamable-http

[Client docs](https://support.anthropic.com/en/articles/11175166-about-custom-connectors-remote-mcp)

Paste this URL into the client's connector settings.

```
https://nextjs-saas-template.lubomirgeorgiev.com/mcp
```

ChatGPT

streamable-http

[Client docs](https://developers.openai.com/api/docs/mcp)

Paste this URL into the client's connector settings.

```
https://nextjs-saas-template.lubomirgeorgiev.com/mcp
```

Codex CLI

streamable-http

[Client docs](https://developers.openai.com/codex/mcp)

Run this command.

```bash
codex mcp add saas-template --url https://nextjs-saas-template.lubomirgeorgiev.com/mcp
codex mcp login saas-template

# If that fails with "unknown client", this server could not fetch Codex's
# client metadata document. Register the client directly instead:
codex mcp login saas-template --oauth-client-registration DCR
```

Cursor

streamable-http

[Client docs](https://cursor.com/docs/context/mcp)

Add this to `~/.cursor/mcp.json`.

```json
{
  "mcpServers" : {
    "saas-template" : {
      "url" : "https://nextjs-saas-template.lubomirgeorgiev.com/mcp"
    }
  }
}
```

VS Code (Copilot)

streamable-http

[Client docs](https://code.visualstudio.com/docs/copilot/customization/mcp-servers)

Add this to `.vscode/mcp.json`.

```json
{
  "servers" : {
    "saas-template" : {
      "type" : "http" ,
      "url" : "https://nextjs-saas-template.lubomirgeorgiev.com/mcp"
    }
  }
}
```

Antigravity

streamable-http

[Client docs](https://antigravity.google/docs/mcp)

Add this to `~/.gemini/config/mcp_config.json`.

```json
{
  "mcpServers" : {
    "saas-template" : {
      "serverUrl" : "https://nextjs-saas-template.lubomirgeorgiev.com/mcp"
    }
  }
}
```

Grok CLI

streamable-http

[Client docs](https://docs.x.ai/build/features/mcp-servers)

Run this command.

```bash
grok mcp add --transport http saas-template https://nextjs-saas-template.lubomirgeorgiev.com/mcp
# OAuth runs on first use; approve in the browser, or press i on the server in /mcps
```

opencode

streamable-http

[Client docs](https://opencode.ai/docs/mcp-servers/)

Add this to `~/.config/opencode/opencode.json`.

```json
{
  "mcp" : {
    "saas-template" : {
      "type" : "remote" ,
      "url" : "https://nextjs-saas-template.lubomirgeorgiev.com/mcp" ,
      "enabled" : true
    }
  }
}
```

## Which tools an agent sees

Tool listings are filtered by the credential: an operation whose scope the key or grant does not hold is never advertised, so an agent cannot even attempt it. Team permissions are checked again on every call, so revoking someone's membership removes their agent's access too. Failed calls come back with the API's stable error code rather than translated prose, which is what lets a model react to a missing scope or a rate limit.
