# Connect an agent

Add an agent, copy its key and send your first ask from Claude Code, Codex, a script, CI or any MCP client.

Assent gives you one inbox and one set of rules for every agent you run. Each agent connects in the way that suits it:

| Agent | How it connects |
|---|---|
| Claude Code | The [Claude Code hook](https://docs.specvista.com/assent/claude-code.md) for risky tool calls, and the [MCP server](https://docs.specvista.com/assent/mcp.md) for asks it decides to send |
| ChatGPT, Claude Desktop, Cursor, Codex and other MCP clients | The [MCP server](https://docs.specvista.com/assent/mcp.md). See [Connect Claude, ChatGPT, Cursor or Codex](https://docs.specvista.com/assent/connect-an-assistant.md) |
| Shell scripts and CI jobs | The [command line](https://docs.specvista.com/assent/cli.md), or the [HTTP API](https://docs.specvista.com/assent/api.md). See [Scripts and CI](https://docs.specvista.com/assent/scripts-and-ci.md) |
| Scheduled jobs and automations | The command line or the HTTP API, with the [helper](https://docs.specvista.com/assent/connect-a-computer.md) on a paired Mac or Windows computer to restart them when you answer |

Whichever way it connects, each agent needs its own agent key, except Claude, ChatGPT, Cursor and Claude Code, which can sign in with OAuth. You need an Assent account first; it is invite only (see [Build with AI agents](https://docs.specvista.com/assent/agents.md#access-comes-first)).

## 1. Add the agent

Verify your email address first: Assent asks for it before you can add an agent.

In Assent, open **Agents** and choose **Add agent** (on the web) or **Add an agent** (in the app). Give it:

- **Name**, the name you see on its asks.
- **What it does**, an optional line about the agent.
- **Runs on**: Mac, Windows PC, Server or Cloud.
- **Schedule**, optional, for example `daily 6:00`.
- **When you answer one of its asks**: **Next run** waits for its next scheduled run. **Run now** restarts it on its computer straight away and needs the [helper](https://docs.specvista.com/assent/connect-a-computer.md) on a paired computer.

Assent then shows the agent key, which starts with `oak_`. Copy it now: Assent shows it once. Give it to the agent as `ASSENT_AGENT_KEY`, and rotate it from the agent's settings if it leaks.

If you only want to see how it feels first, **Connect** has a **Try a sample agent** button. The sample agent posts one approval, a few renewals and a small plan. It never runs anything, and you can remove it from the same place.

## 2. Send your first ask

Every request carries the agent key as a bearer token in the `Authorization` header. The API base is `https://ordia-api.specvista.com/api/v1`, and **Connect**, under **Scripts and services**, shows the same command.

```bash
curl -X POST https://ordia-api.specvista.com/api/v1/agent/ask \
  -H "Authorization: Bearer $ASSENT_AGENT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind":"approve","title":"Try Assent","why":"So you can see how an agent ask reaches you","items":[{"id":"a","title":"First option","selected":true}]}'
```

The ask arrives in Assent straight away, with a push if the app is installed. Approve or decline it, then read the answer back with `GET /api/v1/agent/answers`.

An approve, to-do or pay ask needs a `why`: one sentence on why the person should act now. A title that reads like a status update is refused too, so phrase it as an action ("Approve sending 3 applications") or a question.

## 3. Or connect an MCP client

Point any MCP client at the Assent MCP server:

```text
https://ordia-api.specvista.com/api/v1/mcp
```

Send the agent key as a bearer token in the `Authorization` header. The client can then ask, wait for your answer, check your standing rules, read answers and mark them picked up, add to-dos, write notes, take shared locks, hand work to another agent and report each run. [Connect Claude, ChatGPT, Cursor or Codex](https://docs.specvista.com/assent/connect-an-assistant.md) has the setup for each assistant, and [MCP server](https://docs.specvista.com/assent/mcp.md) lists every tool.

## 4. The command line and the helper

The [command line](https://docs.specvista.com/assent/cli.md) wraps the same API for shell scripts and CI (see [Scripts and CI](https://docs.specvista.com/assent/scripts-and-ci.md)), and the [helper](https://docs.specvista.com/assent/helper.md) pairs a Mac or Windows computer so **Run now** can restart an agent with your answer.

```bash
npm install -g assent-cli
```

```bash
npm install -g assent-helper
```

Then run `assent-helper pair`, and scan the QR code it shows with your iPhone camera, or type its 8 character code at [assent.specvista.com/connect/pair](https://assent.specvista.com/connect/pair). The code lasts 10 minutes. Pairing is needed once on each computer. [Connect a computer](https://docs.specvista.com/assent/connect-a-computer.md) walks through every step on macOS and Windows.
