Before the token exists
An OAuth token resolves against a connection that must already be there. Two things have to happen first, both covered in the Bucket section:1
Register the OAuth app
Your
client_id, client_secret, and redirect_uri with the provider, stored against a bucket.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.
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. Then you 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.