Before the token exists
Provider app credentials must be registered before connecting a user. A dynamic MCP token can start with an unconnected user and let a capable client request consent when an operation needs it. A fixed token requires the connection to exist when you issue it. To connect beforehand, follow these steps:1
Register the OAuth app
Store the provider app’s Choose the OAuth method when prompted. For automation, use the explicit
client_id and client_secret as one atomic pair
in the bucket. The Engine derives the callback as
<engine.public_url>/workspace/connect/callback; redirect_uri is not
credential input.--no-input --value-stdin form.2
Connect a user
One person’s grant against that registration. The
--user-ref you choose here is the value everything downstream uses.--user-ref stable and meaningful — it is your identifier for that person, not the provider’s.
The app credentials and connected-user tokens have separate lifecycles. A
compatible target service can reuse a source app through
ref: "${bucket.auth.<source-service>.<source-auth-name>}" under the target
service’s auth block in the MCP configuration. The MCP’s top-level bucket
selects where the source pair is stored. The source service must be
workspace-enabled, but it does not need to expose operations through the MCP.
The resulting access, refresh, and ID tokens remain attached to the target
service and user.
For a standalone CLI connection that needs the same routing without loading an
MCP, pass --auth-ref '${bucket.auth.<source-service>.<source-auth-name>}' with
the target --type and --auth-name. This initialization/debug command has no
SDK or MCP identity selector and does not infer the reference from app identity.
Two ways to bind a token
The choice is made when you issue the token, and it decides who can steer it afterwards.Dynamic — the caller names the user
Issue an ordinary token, then send selectors as headers on the MCP connection. Both positional arguments are yours — the server, then a name for this token:
Configure these once on the connection as the routing context for physical calls. A Unified call may instead provide non-secret, target-keyed
selectors for the services in its selected graph; a dynamic token honors those selectors at execution time. See call a unified operation.
Fixed — the token names the user
--fixed-binding resolves a service, auth scheme, user, and optional resource at issuance. Caller headers and Unified call selectors cannot override it.
service-slug,auth-name,end-user-ref[,resource-id]. Use the same
service slug you use in workspace and MCP configuration; internal service UUIDs
are never part of this command. Both jira and a provider-qualified slug such
as @atlassian/jira use the ordinary workspace service-reference resolver.
Repeat the flag once per service/auth pair the token may reach. Different
services on one token may intentionally use different end-user references:
Reach for fixed binding when the MCP client only supports an
Authorization header, or whenever a token must be permanently limited to one customer’s account. It removes a whole class of “the agent acted as the wrong user” mistakes, because the caller has no say in it.Flags
mcp token generate
When one user has several tenants
A single OAuth token can front several provider sites, shops, or accounts. The Engine discovers them and picks a default when there is exactly one.X-Fused-Resource-ID per call.
Find the connection ID with:
Who refreshes the token
Nobody, manually. The Engine refreshes eligible connections at startup and hourly, scheduling from whichever expires first. An expired access token is not a reconnect — the Engine rotates it while the refresh grant is still valid. A connection becomesreconnect_required only when refresh material is missing, expired, revoked, or rejected by the provider. A client with URL elicitation support can present a reconnect link on the affected call. Otherwise, run the same connect flow again for the same bucket, service, auth name, and user reference.
What the agent never sees
The MCP token authenticates the client to the Engine. That is all it does. Provider credentials and OAuth tokens stay in the server’s bucket, are never sent to the MCP client, and never appear in the agent’s context. Do not add a second token format or an MCP-client OAuth flow. SDK and MCP deliberately share one execution-token contract, and provider OAuth stays inside the Engine.Connect a user's account
The full connect flow, resource selection, and what happens when a grant lapses.