Clarified ask
This is a documentation/pattern ask, not a request for new OAuth runtime functionality.
The SDK already has the primitives we need for OAuth/BYOK provider auth:
- bearer/introspection/custom authentication can populate request
authInfo
authInfo carries the token and stable credential/client identity
createDerivedAccountStore can require auth and derive the per-request account from ctx.authInfo
- missing auth already maps to SDK
AUTH_REQUIRED
We need docs/examples that show how to combine these pieces for Storefront-backed provider adapters.
Storefront model
Storefront is the buyer-facing seller/platform boundary. Inside that boundary, some backing adapters are provider-auth adapters: the client owns the provider credential lifecycle, passes the current provider bearer/API/OAuth token to the MCP session or tool call, and the Storefront adapter derives the per-request account/auth context from that credential.
Other Storefront flows that register or acknowledge buyer accounts can continue to use sync_accounts / implicit-account patterns. This issue is not asking to replace those shapes.
Desired docs/example
Show createDerivedAccountStore as the canonical pattern for provider-auth adapters behind a Storefront boundary:
const accounts = createDerivedAccountStore<MyAdapterMeta>({
toAccount: (ctx) => ({
id: 'audiostack',
name: 'AudioStack',
status: 'active',
authInfo: ctx?.authInfo,
ctx_metadata: {},
}),
})
The important properties:
- platform handlers can read the provider token from the resolved account/request auth context, e.g.
ctx.account.authInfo.token or the current equivalent field
- handlers can use a stable non-secret identity such as
ctx.account.authInfo.clientId / credential id for idempotency and cache scoping
- the host app does not persist provider credentials
- no refresh token store, provider token store, or OAuth callback route is required when the client owns OAuth
AUTH_REQUIRED from createDerivedAccountStore is the standard signal clients can use to prompt for provider credentials
Per-tool / per-specialism guidance
Please document the expected pattern when only some Storefront-backed adapter tools require provider auth:
- AudioStack creative tools require AudioStack bearer/OAuth auth.
get_adcp_capabilities should not require provider auth.
- Some sales adapters may require auth for
list_accounts, get_products, etc.
If account-resolution-level auth via createDerivedAccountStore is the intended mechanism, document that. If a tool/specialism should instead gate inside the handler using ctx.account.authInfo, show that pattern.
Non-goal
This is not asking the SDK to store provider credentials or implement OAuth on behalf of the Storefront host. For client-owned OAuth, the SDK already has the needed auth primitives; we just need the derived-account BYOK/provider-adapter recipe documented clearly.
Clarified ask
This is a documentation/pattern ask, not a request for new OAuth runtime functionality.
The SDK already has the primitives we need for OAuth/BYOK provider auth:
authInfoauthInfocarries the token and stable credential/client identitycreateDerivedAccountStorecan require auth and derive the per-request account fromctx.authInfoAUTH_REQUIREDWe need docs/examples that show how to combine these pieces for Storefront-backed provider adapters.
Storefront model
Storefront is the buyer-facing seller/platform boundary. Inside that boundary, some backing adapters are provider-auth adapters: the client owns the provider credential lifecycle, passes the current provider bearer/API/OAuth token to the MCP session or tool call, and the Storefront adapter derives the per-request account/auth context from that credential.
Other Storefront flows that register or acknowledge buyer accounts can continue to use
sync_accounts/ implicit-account patterns. This issue is not asking to replace those shapes.Desired docs/example
Show
createDerivedAccountStoreas the canonical pattern for provider-auth adapters behind a Storefront boundary:The important properties:
ctx.account.authInfo.tokenor the current equivalent fieldctx.account.authInfo.clientId/ credential id for idempotency and cache scopingAUTH_REQUIREDfromcreateDerivedAccountStoreis the standard signal clients can use to prompt for provider credentialsPer-tool / per-specialism guidance
Please document the expected pattern when only some Storefront-backed adapter tools require provider auth:
get_adcp_capabilitiesshould not require provider auth.list_accounts,get_products, etc.If account-resolution-level auth via
createDerivedAccountStoreis the intended mechanism, document that. If a tool/specialism should instead gate inside the handler usingctx.account.authInfo, show that pattern.Non-goal
This is not asking the SDK to store provider credentials or implement OAuth on behalf of the Storefront host. For client-owned OAuth, the SDK already has the needed auth primitives; we just need the derived-account BYOK/provider-adapter recipe documented clearly.