yera.tools.mcp.oauth_profiles
Predefined OAuth client behavior for MCP providers.
Symbols
compose_github_mcp_scopes
compose_github_mcp_scopes(
access_level: GitHubMCPAccessLevel,
selected_permissions: tuple[str, ...],
) → tuple[str, ...]Compose GitHub OAuth scopes from an explicit access selection.
Parameters
Selected repository-access policy.
Stable names of optional account permissions.
Returns
Requested scopes in deterministic policy order without duplicates.
Raises
If an optional permission name is unknown.
default_github_mcp_access_level
default_github_mcp_access_level() → GitHubMCPAccessLevelReturn Yera's least-privilege GitHub MCP recommendation.
Returns
Public-repository read-only access with no additional OAuth scopes.
get_mcp_oauth_client_profile
get_mcp_oauth_client_profile(
name: str,
) → MCPOAuthClientProfile | NoneReturn a predefined MCP OAuth client profile.
Parameters
Stable profile name from MCP server configuration.
Returns
The matching client profile, or None when it is unknown.
github_mcp_access_levels
github_mcp_access_levels() → tuple[GitHubMCPAccessLevel, ...]Return the ordered GitHub MCP repository-access choices.
Returns
Immutable access levels ordered from least to most privileged.
github_mcp_optional_permissions
github_mcp_optional_permissions() → tuple[GitHubMCPOptionalPermission, ...]Return the optional GitHub MCP account permissions.
Returns
Immutable permissions ordered for presentation and scope composition.
GitHubMCPAccessLevel
BaseModelDescribe one selectable GitHub MCP repository-access mode.
Fields
Stable identifier used by configuration and OAuth profiles.
Concise user-facing choice label.
Explanation of repository reach and available MCP tools.
GitHub remote MCP endpoint enforcing the selected tool mode.
OAuth scopes inherently required by this repository mode.
Whether this is Yera's recommended minimum grant.
Important consequence requiring additional user attention.
GitHubMCPOptionalPermission
BaseModelDescribe one optional GitHub MCP account permission.
Fields
Stable identifier submitted by the setup form.
Concise user-facing choice label.
Explanation of the additional account data exposed.
Exact GitHub OAuth scope requested when enabled.
Whether setup selects this permission initially.
MCPOAuthClientProfile
BaseModelDescribe how Yera authenticates with one MCP provider.
Fields
Stable name persisted in MCP server configuration.
Whether the OAuth client can protect a client secret.
OAuth grant used to authorize the user.
How the provider recognizes Yera as a client.
How authorization results return to Yera.
Whether users may connect without provider approval.
Whether users may supply a token instead.
Optional public identifier assigned to Yera by the provider.
Optional HTTPS Client ID Metadata Document URL.
Optional endpoint issuing device codes.
Optional endpoint issuing OAuth tokens.
Provider-specific scopes requested by default.
Methods
MCPOAuthClientProfile.require_client_id
require_client_id() → strReturn the profile's deployed OAuth client identifier.
Returns
Public OAuth client identifier configured for this Yera build.
Raises
If the client has not been registered.
resolve_mcp_oauth_client_profile
resolve_mcp_oauth_client_profile(
auth: MCPOAuthAuth,
) → MCPOAuthClientProfile | NoneResolve the predefined profile referenced by OAuth configuration.
Parameters
Persisted OAuth authentication configuration.
Returns
The selected predefined profile, or None for generic OAuth.
Raises
If an explicitly selected profile is unknown.
yera_oauth_client_metadata_document
yera_oauth_client_metadata_document() → dict[str, object]Return Yera's canonical public OAuth client metadata document.
Returns
JSON-compatible CIMD metadata to publish at Yera's client ID URL.