# Connect an agent

An agent connects to Catena with one of three methods: the CLI, an MCP (Model
Context Protocol) connector, or a secret key. Which one you'll use depends on
where the agent runs. Each method connects the software to an agent identity in
your organization, and the agent's [policy](https://docs.catena.com/policies.md) applies the same way no
matter which method you choose.

## Choose a method

Use the table below to find the method that fits where your agent runs:

| Where your agent runs                                                                     | Use                                 | Guide                                         |
| ----------------------------------------------------------------------------------------- | ----------------------------------- | --------------------------------------------- |
| A terminal on your machine or a VM you keep: Claude Code, Codex, Cursor, OpenClaw, Hermes | The CLI, with `catena link`         | [Link with the CLI](https://docs.catena.com/connect/cli.md)             |
| A desktop or web app with custom connectors: Claude, ChatGPT                              | The MCP connector                   | [Link with the MCP](https://docs.catena.com/connect/mcp.md)             |
| A cloud sandbox that starts fresh for each task                                           | A secret key in `CATENA_SECRET_KEY` | [Link with secret keys](https://docs.catena.com/connect/secret-keys.md) |
| A CI job, a serverless function, or a server you deploy                                   | A secret key in `CATENA_SECRET_KEY` | [Link with secret keys](https://docs.catena.com/connect/secret-keys.md) |
| Your own code                                                                             | The SDK, with a secret key          | [SDK reference](https://docs.catena.com/sdk.md)                         |

## Capabilities by method

|                                                              | CLI | SDK and API | MCP connector |
| ------------------------------------------------------------ | --- | ----------- | ------------- |
| Read accounts, balances, and transactions                    | Yes | Yes         | Yes           |
| Add counterparties and request payment details               | Yes | Yes         | Yes           |
| Surface transactions for approval                            | Yes | Yes         | Yes           |
| Send transactions without approval, when permitted by policy | Yes | Yes         | No            |
| Pay x402 and MPP endpoints                                   | Yes | Yes         | No            |
| Ask for a temporary limit increase                           | Yes | Yes         | Yes           |

> [!NOTE] **Signing keys**
>
> The CLI and the SDK hold a signing key, so they can sign a wallet payment that
> the policy allows without a person. An MCP connection holds no signing key,
> which means an admin will approve and sign each of its wallet sends.

## Give your agent this prompt

To connect an agent that runs commands in a terminal, paste the prompt below
into it. Replace `agent_id` with the agent's ID from the console, or remove that
part to create a new agent.

```prompt
Connect yourself to my Catena account. Install the Catena CLI with `npm i -g @catena/cli`, then run `catena guide` and follow it to link the existing agent `agent_id`. Once linked, install the Catena skill so future sessions know to use the CLI: `npx -y skills add catena-labs/skills --skill catena-cli --global --yes`.
```

The prompt sends the agent to `catena guide` for the linking steps, and the
guide matches the CLI version the agent installed. If the agent gets stuck, a
person can follow the same steps in [Link with the CLI](https://docs.catena.com/connect/cli.md).

## Create the agent

To create an agent in the console:

1. Open the **Agents** page and click **Add agent**.
2. Name the agent and choose a policy.
3. Give the agent's ID (`agent_...`) to your agent.

The agent shows **Pending connection** until software connects to it.

Creating the agent first is optional. If you run `catena link` with no agent ID,
we will create a new agent when you approve the link. In addition, the MCP
connector lets you choose or create an agent during sign-in.

Missing an agent tool you'd find helpful? Send us an email at
<support@catena.com>.

## Related

- [Quickstart](https://docs.catena.com/quickstart.md): Give your agent one prompt, approve it into your sandbox, and have it make a test payment that you'll see in the console.
- [Set policies](https://docs.catena.com/policies.md): Decide what each agent can do with its policy, from the accounts it can read and the counterparties it can pay to its spending rules and temporary overrides.
