# Connect your AI agent

CoDNA is meant to be read through the agent you already talk to. Each person connects their own:
the agent signs in as you, and searches, reads and writes exactly what you can, nothing more.

You need two things:

- **The address.** Your CoDNA's address followed by `/mcp`, for example
  `https://acme.codna.me/mcp`. The web app's **Connect an AI agent** page shows it with a copy
  button, along with these steps for your CoDNA.
- **Your CoDNA sign-in.** The first time, the agent opens your browser; sign in as you do on the
  web, then approve the screen that asks to let it use your CoDNA knowledge base.

There is no API key or token to paste anywhere. If your agent asks for one, leave it empty: CoDNA
refuses fixed tokens here, so that an agent always acts for a person, and stops when that person
is removed.

An agent your team runs for other people, such as a support bot, connects differently: as itself,
knowing only what is shared with it. See [Agents](https://codna.me/docs/agents.md).

## Claude on the web, desktop and phone

1. In Claude, open **Customize → Connectors** and choose **Add custom connector**.
2. Name it after your organization and paste the address.
3. If Claude asks how it should identify itself (**OAuth client**), choose **Register
   automatically**.
4. Choose **Add**, then **Connect**, and sign in.
5. In a chat, turn it on under **+ → Connectors**.

A connector added once is in Claude's desktop and phone apps too.

**On a Team or Enterprise plan** an Owner adds it for everyone, under **Organization settings →
Connectors** (**Add → Custom**, then **Web**). Everyone else finds it in **Customize → Connectors**,
marked Custom, and chooses **Connect** to sign in as themselves.

## Claude Code

In a terminal:

```bash
claude mcp add --transport http codna https://acme.codna.me/mcp
```

Then, in Claude Code, run `/mcp`, choose **codna**, and sign in when your browser opens.

## ChatGPT

1. In ChatGPT on the web, open **Settings → Apps → Advanced settings** and turn on **Developer
   mode**. In a Business, Enterprise or Edu workspace an admin may have to allow it first.
2. In **Settings → Apps**, choose **Create app**. Name it, paste the address, and choose **OAuth**.
3. Sign in, then choose **Create**.
4. In a chat, choose **+ → More** and pick it.

OpenAI lets an app change things only on Business, Enterprise and Edu plans. On other plans ChatGPT
can search and read your CoDNA, but not write to it.

## Codex, and the ChatGPT desktop app

The ChatGPT desktop app includes Codex, which has its own list of servers:

1. Open **Settings → Plugins → MCPs**, then **Add** and **Connect to a custom MCP**.
2. Give it a name of letters, digits and hyphens, such as `acme-codna`. A name already in the list
   cannot be reused.
3. Choose **Streamable HTTP** and paste the address. Leave **Bearer token env var** and both kinds
   of header empty.
4. **Save**, then **Authenticate** beside it in the list, and sign in.
5. Start a **new** thread. A thread has the tools of the servers that were connected when it
   began, so one started earlier will not see CoDNA.

From a terminal, the Codex CLI does the same:

```bash
codex mcp add acme-codna --url https://acme.codna.me/mcp
```

```bash
codex mcp login acme-codna
```

## Other agents

Anything that speaks MCP over Streamable HTTP can connect with the address alone. Asked without a
sign-in, CoDNA answers with where to sign in, and the agent takes it from there: it registers
itself with your organization's identity provider and opens your browser.

If your identity provider cannot register agents itself, the **Connect an AI agent** page shows a
client ID to give your agent instead.

## Checking it works

Ask your agent **"Who am I in CoDNA?"** It calls `whoami` and answers with your email and how many
groups you are in.

In the web app, the **Connect an AI agent** page then says *Your agent is connected* and when it
last called, and **Connect your AI agent** on the home page's Get started list is ticked.

## If it does not connect

- **The agent has no CoDNA tools, or answers from somewhere else.** Turn the connector on in that
  conversation (Claude: **+ → Connectors**), or start a new one (Codex threads).
- **"Couldn't connect" or "authorization failed" before any sign-in page.** The identity provider
  refused to register the agent. Whoever runs your CoDNA can check its settings in
  [MCP server](https://codna.me/docs/mcp.md#claude-and-chatgpt).
- **The sign-in page says you have no account.** You sign in to the agent with the same account
  as the web app; ask whoever manages your CoDNA to add you.
