source="mcp_server", and provisionally assigns those new tools to MainAgent.
Lifecycle
- Install a curated server from
client.mcp_catalog, or create a server definition withclient.mcp_servers.create(...). - Store a tenant- or user-scoped credential, or complete the server’s OAuth flow.
- Test the connection and discover remote tools.
- Review the newly provisioned tools on
MainAgent, then change assignments, catalog status, and approval policy as needed.
import_tool(...) remains an explicit one-tool recovery path when automatic provisioning did not create a remote definition. It returns an unassigned tool; assign it through the agent tool APIs. Do not call it routinely after successful discovery because the tool may already exist.
Credential scopes
Each server declares its allowed credential scopes and one default. Tenant-scoped credentials are shared by authorized tenant workloads. User-scoped credentials belong to the authenticated user;credentials_self(...) returns only that caller’s credential metadata. API responses never return stored secret values.
Set background_safe only when a credential may be used after the initiating request is no longer active. OAuth state is single-use and must be returned unchanged to the exchange endpoint.

