Skip to content
Bodylet AIBodylet AI
All pages

Connecting agents

An agent reaches your fleet with a token: a key that opens only what you granted. There are several ways to give an agent its token. In all of them, you approve or create it while signed in to your account, and the token never passes through the conversation with the agent.

Claude Code#

On the computer where Claude Code runs, with Bodylet installed (the install line of the Quick start, or the agent-only form below):

Terminal
bodylet connect --server https://bodylet.sanstour.com --client claude-code

Approve the code on https://bodylet.sanstour.com/connect and choose what the agent may do. Then check:

Terminal
claude mcp get bodylet

It should say Status: ✔ Connected. Start a new Claude Code session: the Bodylet tools load when a session starts. Ask "List my Bodylet machines."

Codex#

Terminal
bodylet connect --server https://bodylet.sanstour.com --client codex

Approve the code the same way. Then check:

Terminal
codex mcp get bodylet
bodylet agent check

codex mcp get shows the entry (enabled: true and the address https://bodylet.sanstour.com/mcp) without connecting. bodylet agent check asks Bodylet whether the stored token works, and how many machines it sees. Start a new Codex session.

Let the agent set itself up#

In Claude Code or Codex, paste:

Set up Bodylet on this machine: read https://bodylet.sanstour.com/setup and follow it.

Choose C when it asks, if this computer should not join your fleet and only the agent should get access. The agent shows each command before it runs it.

An agent on a computer that is not in your fleet#

Your laptop can drive your machines without being one of them. Install only the command line, without the runtime:

Terminal
curl --proto '=https' --tlsv1.2 -fsS https://bodylet.sanstour.com/install.sh | sh -s -- --client-only

On Windows:

PowerShell
& ([scriptblock]::Create((irm https://bodylet.sanstour.com/install.ps1))) -ClientOnly

Then run bodylet connect --server https://bodylet.sanstour.com --client claude-code (or codex) as above.

What you choose when you approve an agent#

ChoiceOptions
Name of the agent tokenShown in the dashboard and in the activity log
What the agent may doGrouped as on the page. Terminal: run commands. Files: Read files, Write files, in the folders the owner allows. Desktop: See the desktop, Use the desktop. Previews: Open previews (also needed for exposures). Port forwards: Forward ports. Applications: Check applications, Install applications. Machines on demand: Create machines, on a host, within a quota
On which machinesChosen machines, or "All machines, including future ones"
Token expiresIn 1 hour, 1 day, 7 days, 30 days, 90 days (chosen at first) or 1 year, or Never. A token that never expires works until you revoke it

The page ticks Terminal for you at first, and nothing else. Which machines it ticks depends on the setting "Give new agents access to all my machines" (see Permissions and safety). The agent gets exactly what you tick when you approve, and nothing else.

A few capabilities work together:

  • Use the desktop lets the agent click and type. Tick See the desktop too, so it can see what it does.
  • Install applications installs only the packages of a plan, usually after your approval. Tick Check applications too (see Applications and requirements).
  • Create machines counts only on a host, and only with a quota you set on the Hosts page (see Machines on demand).
  • Each one also has to be allowed on the machine by its owner (see Permissions and safety).

A token that is approved but never used within ten minutes is revoked automatically.

Create a token by hand#

You can also create a token in the dashboard and store it yourself:

  1. On Agent tokens, choose New token. Give it a name, the capabilities, the machines, and an expiry. Choose Create token.
  2. The token is shown once. Copy it.
  3. In your own terminal (never in a conversation with an agent):
Terminal
bodylet agent login --server https://bodylet.sanstour.com
bodylet agent add --client claude-code --dry-run   # shows it, changes nothing
bodylet agent add --client claude-code

agent login asks for the token without showing it, and stores it in your system's credential store. agent add adds the entry bodylet to Claude Code (or Codex with --client codex). The entry holds no token: the client asks bodylet for it at each connection.

Any other MCP client#

Bodylet speaks MCP over HTTPS ("Streamable HTTP"):

Addresshttps://bodylet.sanstour.com/mcp
AuthenticationThe header Authorization: Bearer <token>

Create a token on Agent tokens, then give it to your client through an environment variable, for example BODYLET_MCP_TOKEN, rather than writing it in a configuration file. Name the entry bodylet. Bodylet does not offer a browser sign-in for MCP clients: if your client tries one, it fails.

Scripts and CI jobs#

The bodylet command reads two environment variables, and then stores nothing:

Terminal
export BODYLET_SERVER=https://bodylet.sanstour.com
export BODYLET_TOKEN=...        # from your CI's secret store
bodylet exec build-box --shell sh -- 'make release'

Use a token limited to the machines and capabilities the job needs, with an expiry.

You, with the command line#

To use the bodylet command yourself, without adding an entry to any agent:

Terminal
bodylet connect --server https://bodylet.sanstour.com --agent
bodylet whoami
bodylet machines

See the Command reference.

An operator token for your own command line#

Some bodylet commands manage the fleet itself: pair-code, tokens, audit, approvals and provision quotas. They need an operator token, which you create in the dashboard:

  1. On Agent tokens, in the box Operator tokens, choose New operator token. Give it a name and an expiry.
  2. The token is shown once. In your own terminal, store it under a profile of its own:
Terminal
bodylet agent login --profile owner --server https://bodylet.sanstour.com
bodylet --profile owner tokens

Revoke an operator token in the same box, with Revoke.

Check, change and remove access#

ToDo
See whether the stored token worksbodylet agent check
See which account and token are in usebodylet whoami
Remove the entry from Claude Code and delete the stored tokenbodylet agent remove --client claude-code
Take access back from anywhereOn Agent tokens, choose Revoke. Its next request is refused