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):
bodylet connect --server https://bodylet.sanstour.com --client claude-codeApprove the code on https://bodylet.sanstour.com/connect and choose what the agent may do. Then check:
claude mcp get bodyletIt should say Status: ✔ Connected. Start a new Claude Code session: the Bodylet tools load when a session starts. Ask "List my Bodylet machines."
Codex#
bodylet connect --server https://bodylet.sanstour.com --client codexApprove the code the same way. Then check:
codex mcp get bodylet
bodylet agent checkcodex 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:
curl --proto '=https' --tlsv1.2 -fsS https://bodylet.sanstour.com/install.sh | sh -s -- --client-onlyOn Windows:
& ([scriptblock]::Create((irm https://bodylet.sanstour.com/install.ps1))) -ClientOnlyThen run bodylet connect --server https://bodylet.sanstour.com --client claude-code (or codex) as above.
What you choose when you approve an agent#
| Choice | Options |
|---|---|
| Name of the agent token | Shown in the dashboard and in the activity log |
| What the agent may do | Grouped 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 machines | Chosen machines, or "All machines, including future ones" |
| Token expires | In 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:
- On Agent tokens, choose New token. Give it a name, the capabilities, the machines, and an expiry. Choose Create token.
- The token is shown once. Copy it.
- In your own terminal (never in a conversation with an agent):
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-codeagent 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"):
| Address | https://bodylet.sanstour.com/mcp |
| Authentication | The 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:
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:
bodylet connect --server https://bodylet.sanstour.com --agent
bodylet whoami
bodylet machinesSee 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:
- On Agent tokens, in the box Operator tokens, choose New operator token. Give it a name and an expiry.
- The token is shown once. In your own terminal, store it under a profile of its own:
bodylet agent login --profile owner --server https://bodylet.sanstour.com
bodylet --profile owner tokensRevoke an operator token in the same box, with Revoke.
Check, change and remove access#
| To | Do |
|---|---|
| See whether the stored token works | bodylet agent check |
| See which account and token are in use | bodylet whoami |
| Remove the entry from Claude Code and delete the stored token | bodylet agent remove --client claude-code |
| Take access back from anywhere | On Agent tokens, choose Revoke. Its next request is refused |