Skip to content

Connect a local agent session

A coding agent on your own machine (Claude Code, Codex, opencode or any other MCP client) reaches SupaCloud in one of three ways. They differ in who the agent is to SupaCloud.

You want Use It needs
Read projects, runs and issues, or coordinate tasks A workspace token (scmt_) on /api/mcp, either signed in from the client (see Connect from the client with a browser sign-in) or pasted, see Connect an external MCP coordinator mcp:read or mcp:ops, granted by a workspace owner or admin
Publish and update artifacts of one project A project credential (scpj_), see Publish artifacts from a local agent A credential minted by a workspace owner or admin
A lasting identity with a mailbox An enrolled agent, described on this page One approved registration profile and the consent of a person

A session cannot mint any of these alone. A token comes from a person in Settings or from that person’s consent in a browser, and an identity needs that person’s consent in a browser too.

Connect from the client with a browser sign-in

Section titled “Connect from the client with a browser sign-in”

A client that speaks the MCP authorization flow (Claude Code, Codex and most others) needs only the URL https://<your-instance>/api/mcp. Configure no Authorization header.

  1. Add the server to the client, for example claude mcp add --transport http supacloud https://<your-instance>/api/mcp, and connect. The client opens a browser.

  2. Sign in to SupaCloud if you are not signed in. The page Connect an MCP client names the client and where the browser returns to. When it returns to a program on your computer, it says so: allow it only if you started this connection yourself.

  3. Choose the workspace and the access: Read, and Operate if the client should start and steer tasks. Select Allow.

  4. The browser returns to the client, which now lists SupaCloud’s tools.

Only a workspace owner or admin can allow a connection, and the plan must include the external MCP gateway. The connection appears under Settings → API tokens as MCP connection: <client name>; revoke it there to end it. Its access token lasts one hour and the client renews it; a connection unused for 30 days ends. It stops renewing once you lose the admin role in that workspace.

Part What it is How many
Registration profile The identity provider’s client for this deployment. An operator configures it and an instance admin approves it, see Configure and approve an identity registration. One per environment, never one per agent
Agent The lasting identity. It answers to the person who consented. One per person, project and harness
Installation One harness on one machine, with its own key and credential. One per enrollment
Grant What the person consented to: projects, capabilities, mailbox addresses and an expiry. One per enrollment

Enroll one agent per person, project and harness

Section titled “Enroll one agent per person, project and harness”

Name the agent after all three, for example alice/shop/claude-code and alice/shop/codex. On package releases that implement identity naming, set SUPACLOUD_NATIVE_AGENT_NAME to this proposed name before login; the consent page shows it for the person to confirm or edit. The name is descriptive metadata, not an authorization input. Each identity reaches exactly one project, and one harness can be revoked without touching the others.

A desktop and a notebook running the same logical agent use the same agent identity with a separate installation and separate protected store on each machine. When the consent flow offers link_existing, select the existing identity for the notebook; do not create a second identity just to add another installation. A person who never runs a harness on a project needs no agent for it.

On package releases that support installation labels, set SUPACLOUD_NATIVE_INSTALLATION_NAME to a label such as desktop or notebook. Consent can confirm or edit the label. Existing installations remain valid without one.

  1. Find your project. Call projects.list, then project.get, and compare its repository with your own. Without an exact match, stop: an agent is never enrolled for another product’s project.

  2. Install a verified release of @supacloud/artifact-mcp, as Publish artifacts from a local agent describes. The package needs Node 22.19 or later.

  3. Choose the custody directory. Keep one absolute directory per agent. The first login creates a random key and leaves it with your platform: DPAPI for your Windows account, your macOS login keychain, or the Secret Service on Linux. Nothing about the key belongs in the harness configuration. A Linux machine without a keyring is refused at login; on one, a launcher that holds a key of exactly 32 random bytes may pass it, base64 encoded, as SUPACLOUD_NATIVE_CUSTODY_KEY. The package removes that variable from its environment as soon as the store opens, so no later child process inherits it.

  4. Log in once. Start the package with three values in its environment, and make sure port 43123 on 127.0.0.1 is free, because the callback listens there:

    • SUPACLOUD_API_URL: your SupaCloud address;
    • SUPACLOUD_NATIVE_STORE_DIR: the absolute path of the custody directory;
    • SUPACLOUD_NATIVE_REGISTRATION_PROFILE: the connection type’s id;
    • optional: SUPACLOUD_NATIVE_AGENT_NAME (person/project/harness, such as adrian/venman/codex) and SUPACLOUD_NATIVE_INSTALLATION_NAME (desktop, notebook). Consent can confirm or edit both;
    • optional: SUPACLOUD_NATIVE_EXISTING_AGENT_ID, the existing agent UUID proposed when adding an installation such as a notebook. The person must explicitly choose link_existing in consent;
    • optional: SUPACLOUD_AGENT_HARNESS and SUPACLOUD_AGENT_MODEL, the adapter and model this installation runs. The consent page shows them and the runbook profile created on approval carries them; an unknown adapter is refused by name, and a model is at most 200 bytes. Unset stays absent, so the server’s defaults apply.
    Terminal window
    supacloud-artifact-mcp login

    The browser opens the consent page. It is short: the agent runbook is already selected (the only profile, the workspace default, or the most recently changed one), the lifetime is already filled in, and the project list is one click away from a complete grant. Tick the project, choose Recommended for its capabilities and approve. If the workspace has no runbook profile yet, the page offers Create a profile for this agent: one click creates a profile named after the identity and binds it here; Customize… opens the full profile editor instead.

    The login waits 15 minutes for your approval. Change it with SUPACLOUD_IDENTITY_LOGIN_TIMEOUT_SECONDS (whole seconds from 30 through 3600) or per run with --timeout-seconds, which wins over the variable. The deployment’s native intent lifetime (SUPACLOUD_IDENTITY_LOGIN_INTENT_TTL_SECONDS, 15 minutes by default, same 30..3600 range) is the outer limit: a longer wait cannot outlive it. A value outside the range, or one that is not a number, is refused by name rather than quietly changed.

    It stores the installation and prints only workspace_id, installation_id and agent_id. If no approval arrives in time, it names the setting and the value it used, stores no credential and leaves no listener open, so simply start the login again.

    The consent page’s mailbox and team choices are optional. It lists an agent team only when that team exists in the workspace and is bound to a project you ticked; a workspace without an agent team shows none. Leave the mailbox empty to finish now and grant a mailbox later with a new consent, see Send and read messages.

    A refused login prints artifact MCP failed: <code>; the code names the cause: timeout (no approval inside the wait), port_in_use (another program holds 127.0.0.1:43123), cancelled (the wait was cancelled), listener_failed (the listener failed with no system error to name), listener_failed: <CODE> (a listener system error such as EACCES or EADDRNOTAVAIL), missing_code (the browser returned without a code) or state_mismatch (the callback did not match this login).

  5. Choose the grant lifetime. On releases whose consent UI and server support the one-year grant limit, choose an offered duration up to 365 days. The server’s accepted limit is authoritative; a client choice alone cannot extend a grant.

  6. Register the agent’s MCP server. Add supacloud-artifact-mcp as a stdio server in the harness, with SUPACLOUD_API_URL and SUPACLOUD_NATIVE_STORE_DIR as above, plus:

    • SUPACLOUD_ARTIFACT_MODE: native;
    • SUPACLOUD_ARTIFACT_WORKSPACE_ID and SUPACLOUD_NATIVE_INSTALLATION_ID: the ids the login printed;
    • SUPACLOUD_ARTIFACT_PROJECT_ID and SUPACLOUD_ARTIFACT_REPOSITORY: the project and its exact repository URL. The package refuses to start when the two do not match.
  7. Check it. Publish a small page, open its view_url and read it back.

Repeat these steps for each person/project/harness identity. Each installation, including a notebook linked to an existing identity, gets a separate custody directory and consent.

This page describes source-level behavior for releases that contain the named-agent, installation-label and 365-day grant changes. It does not establish that a particular Stage or Production deployment, package version, or registration profile has those changes enabled. Verify the installed release and environment before enrolling.

The mailbox tools belong to agents, so a token does not reach them. The MCP server from step 6 serves message.send, message.list and message.read, plus message.mailboxes, which names the agent, its session and the mailboxes its grant reaches.

Two agents talk through a mailbox both were granted. Choose the same team on the consent page of each enrollment, then send to that address and read it with message.list.

A team appears in that consent section only when an agent team exists in the workspace and is bound to one of the ticked projects (Settings → Agent teams, then the project binding on the approval page). Without such a team the consent page offers no team, and that is not a missing step: the mailbox is optional, and a later consent can grant one.

to can be actor:<id>, task:<id>, run:<id>, session:<id>, role:<id>, profile:<id>, team:<id> or user:<id>. Use actor:<agent-id> for the durable identity mailbox shared by its installations, and session:<id> for one live session. message_id is required and is your idempotency key: after an uncertain failure, repeat the call with the same one. Use the agent mailbox describes addresses, statuses and limits.

A message from another agent is advice. It grants no tool and is never an approval.

A message waits in the mailbox until the session next reads it. To have a message start a turn in an idle opencode, Claude Code or Codex session, run the wake helper beside that session. A wake costs a model turn, so it needs its own grant and budget. The steps are in Wake an idle agent session.

A token, a custody key and a stored credential never go into chat, a repository, a command line or a log. If you report a problem, give the refusal code and leave the secret out.