# Connect an AI client to Agents First

> Public quickstart for connecting Claude, Claude Code, ChatGPT, and OpenAI Codex
> to the Agents First MCP server. No portal login is required to read
> this page — you sign in once during your client's OAuth approve step.

## Quickstart — connect a client (CLI-first)

Connect any MCP-capable AI client to your Agents First workspace. Registration and sign-in are automatic OAuth 2.1 + PKCE — you approve once in your browser, and no token is ever pasted into a config file. CLI clients (Claude Code, Codex) are the fastest path; Claude web/Desktop and ChatGPT connect from their own UI.

**MCP server URL**

`https://app.agentsfirst.ai/api/external-agent/mcp`

Registration is automatic — no manual app setup. The primary path is a Client ID Metadata Document (CIMD): your client presents its hosted client-metadata URL as its client_id and this server registers it on the fly. Clients that don't support CIMD fall back automatically to Dynamic Client Registration (DCR). Either way you finish the same OAuth 2.1 + PKCE sign-in below.

### Claude (web, Desktop, mobile)

_Pro / Max / Team / Enterprise. On Team/Enterprise an Owner adds it in Organization settings._

1. Open Settings → Connectors (or Customize → Connectors).
2. Click “Add custom connector”.
3. Paste the MCP server URL below and click Add.
4. Click Connect, sign in to the portal, and Approve once — the button shows “Authorizing…”, no need to click twice.

### Claude Code (CLI)

_Any Claude Code install. Uses a loopback OAuth callback._

1. Run the command below to register the connector.
2. Start Claude Code and run /mcp, then choose Authenticate — your browser opens to the portal.
3. Approve once; the CLI captures the callback and stores the token.

```bash
claude mcp add --transport http agentsfirst https://app.agentsfirst.ai/api/external-agent/mcp
```

### ChatGPT (Developer Mode)

_Plus / Pro / Business / Enterprise / Edu (web). Admins enable Developer Mode for a workspace._

1. Settings → Apps → Advanced settings → enable Developer mode.
2. Settings → Apps & Connectors → Create.
3. Enter a name and paste the MCP server URL below; choose Authentication = OAuth.
4. Click Create, then complete the OAuth sign-in + single Approve.

### OpenAI Codex (CLI / IDE)

_Codex CLI and the IDE extension share config. Uses a loopback OAuth callback._

1. Run the two commands below (add, then login).
2. A browser opens to the portal; Approve once to mint the token.
3. Run /mcp inside Codex to confirm the connection is live.

```bash
codex mcp add agentsfirst --url https://app.agentsfirst.ai/api/external-agent/mcp
codex mcp login agentsfirst
```

Manual fallback — add this to `~/.codex/config.toml` if `codex mcp add` is unavailable (never put a bearer token in this file):

```toml
[mcp_servers.agentsfirst]
enabled = true
url = "https://app.agentsfirst.ai/api/external-agent/mcp"
oauth_resource = "https://app.agentsfirst.ai/api/external-agent/mcp"
```

Older Codex builds: if the connection does not start the OAuth login, add `experimental_use_rmcp_client = true` to ~/.codex/config.toml (newer builds enable the OAuth-capable MCP client automatically).

### First things to ask

- Give me a briefing on my workspace
- Triage my inbox
- Help me email my list

## More

- OAuth discovery & full lifecycle (discover → register → authorize → use → revoke): /auth.md
- Reference docs: https://agentsfirst.ai/docs/external-agents/mcp
- Support: https://agentsfirst.ai/support
