> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anonalabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent self-onboarding

> A coding agent sets up Anona Compute from the terminal. You approve one browser sign-in.

> For agents: fetch [`/llms.txt`](https://docs.anonalabs.com/compute/agents/docs-for-agents) first. It indexes every page as Markdown.

Give Claude Code, Codex, Cursor or any MCP client its own computers. The agent installs the CLI, asks you to approve a sign-in, registers the MCP server and creates a sandbox to prove it works. You do one thing: approve the sign-in in your browser.

> [card] [Paste one prompt](https://docs.anonalabs.com/compute/agents/onboarding-prompt.md)
>
> Hand this to your agent and it does the rest.

> [card] [Docs for agents](https://docs.anonalabs.com/compute/agents/docs-for-agents.md)
>
> `llms.txt` and a Markdown copy of every page.

## The flow

```text theme={null}
agent                          you                         Anona Compute
  |  anona-compute login --no-browser                            |
  |------------------------------------------------------------->|  device code request
  |  prints URL + code                                           |
  |-------------------------------> opens URL, checks code,      |
  |                                 picks organization, approves |
  |                                 |--------------------------->|
  |  CLI now holds a session for this machine                    |
  |  claude mcp add anona-compute -- anona-compute mcp           |
  |  tools/call create_sandbox, run_command, kill_sandbox        |
  |------------------------------------------------------------->|
```

The sign-in is a standard device flow (RFC 8628). The agent never sees your password or an API key. The CLI trades its session for gateway tokens that last 15 minutes, and `anona-compute logout` revokes the session.

## Ways to connect

| Path | Needs | Good for | Credential |
| - | - | - | - |
| **A. CLI and MCP** | The `anona-compute` binary | Claude Code, Codex, Cursor, any stdio MCP client | Browser sign-in held by the CLI |
| **B. CLI with an API key** | The binary and an `e2b_` key | Headless machines and CI | A scoped, expiring [API key](https://docs.anonalabs.com/compute/guides/ci.md) |
| **C. SDK in the agent's code** | `pip install anona` or `npm install @anona/sdk` | An agent you wrote | An API key in `ANONA_API_KEY` |
| **D. Stock E2B SDK** | `pip install e2b` and two environment variables | Code that already uses E2B | An API key as `E2B_API_KEY` |

> [!NOTE]
>
> **Coming soon:** downloadable `anona-compute` binaries and the `anona` and `@anona/sdk` packages. Until they ship, path D works today; see [Migrate from E2B](https://docs.anonalabs.com/compute/migrate-from-e2b.md).

## Setup per path

> [tab] A. CLI and MCP
>
> ```bash agent_login.sh theme={null}
> anona-compute login --no-browser   # prints a URL and a code; the human approves
> anona-compute whoami               # user, organization, role
> ```
>
> Then register the server with the agent's client:
>
> ```bash claude_code.sh theme={null}
> claude mcp add anona-compute -- anona-compute mcp
> ```
>
> ```bash codex.sh theme={null}
> codex mcp add anona-compute -- anona-compute mcp
> ```
>
> Cursor and other clients: see [Agents via MCP](https://docs.anonalabs.com/compute/guides/mcp.md). MCP tools usually load when the client starts, so restart the agent once.

> [tab] B. API key
>
> Create a key in the [dashboard](https://app.compute.anonalabs.com) under **API keys**, with the least access the job needs. Then:
>
> ```bash agent_key.sh theme={null}
> printenv ANONA_API_KEY | anona-compute login --with-api-key
> anona-compute whoami
> ```

> [tab] C and D. SDK
>
> ```bash agent_env.sh theme={null}
> export E2B_DOMAIN=compute.anonalabs.com
> export E2B_API_KEY=e2b_YOUR_API_KEY
> ```
>
> The [quickstart](https://docs.anonalabs.com/compute/quickstart.md) has the first sandbox in Python and TypeScript.

## What the agent gets

Over MCP the agent can create, pause, resume, extend and delete sandboxes; run commands and background processes; read and write files; get a live-view link for you to watch, a preview link for a dev server it started, an SSH config and a desktop screenshot; and read its own usage. The full list is in [Agents via MCP](https://docs.anonalabs.com/compute/guides/mcp.md#tools).

## Limits

* The agent can do what your role and credential allow, no more. Start it with `--read-only` after `mcp` to offer only the tools that do not change sandboxes.
* A browser sign-in is a session for one machine. It cannot be used with the SDK or the REST API; those need an API key.
* Sandbox limits (count, size, lifetime) come from your plan. See [Limits](https://docs.anonalabs.com/compute/concepts/limits.md).
* Billing is per active CPU and resident memory; an agent that leaves sandboxes running is billed. Tell it to delete them (the MCP tool is `kill_sandbox`) or let it [pause when idle](https://docs.anonalabs.com/compute/concepts/lifecycle.md#pause-when-idle).

## Troubleshooting

**The agent says the tools are missing.** The client loads MCP tools at start. Restart it, then ask it to list its tools.

**`login` waits forever.** The code expires. Run it again, open the URL it prints and check that the code matches.

**`unauthorized` after a while.** The session was revoked, or the key expired. Run `anona-compute whoami`, then sign in again.

**A create fails with a limit error.** Your plan's sandbox, memory or lifetime limit is reached. The message names it; see [Troubleshooting](https://docs.anonalabs.com/compute/troubleshooting.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.