datarobot_genai.drmcpbase.oauth_protected_resource_metadata.entities
entities
CrossApplicationAccessMetadata
dataclass
Bases: BaseDataClass
Cross-Application Access parameters for the hybrid RFC 8693 / RFC 7523 flow.
Mirrors dragent.cross_app_access_config.CrossApplicationAccessConfig so an
agent can either declare the block itself or read this one off the MCP
server's protected resource metadata document.
Source code in datarobot_genai/drmcpbase/oauth_protected_resource_metadata/entities.py
from_settings
classmethod
from_settings(*, trusted_issuer: str | None = None, exchange_audience: str | None = None, token_url: str | None = None, token_audience: str | None = None, scopes: str | None = None, token_endpoint_auth_method: str | None = None) -> CrossApplicationAccessMetadata | None
Assemble the block from the flat MCP_XAA_* settings.
All four required settings must be present. A partial block is dropped with a warning naming exactly what is missing rather than raising: the deployment tooling rejects it up front, so reaching here means the container was configured by hand and a broken well-known route helps nobody.
Source code in datarobot_genai/drmcpbase/oauth_protected_resource_metadata/entities.py
MCPOAuthProtectedResourceMetadataConfig
dataclass
Bases: BaseDataClass
User-authored part of the document, from the server's own settings.
Every field is optional, so a config that only declares
cross_application_access is valid. resource and
authorization_servers are published verbatim; scopes_supported is
handed in by the server, derived from the scope rules it actually enforces.
Source code in datarobot_genai/drmcpbase/oauth_protected_resource_metadata/entities.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | |
from_settings
classmethod
from_settings(*, resource: str | None = None, authorization_servers: str | None = None, scopes_supported: list[str] | None = None, xaa_trusted_issuer: str | None = None, xaa_exchange_audience: str | None = None, xaa_token_url: str | None = None, xaa_token_audience: str | None = None, xaa_scopes: str | None = None, xaa_token_endpoint_auth_method: str | None = None) -> MCPOAuthProtectedResourceMetadataConfig
Assemble the config from the server's settings.
Every parameter is the flat string an env var or runtime parameter can
carry, except scopes_supported: the scope rules declared in code
and configuration (see
datarobot_genai.drmcpbase.oauth_scopes.derived_scopes) are never a
flat setting, so there is nothing here to split. Blank entries are
dropped and an empty list publishes nothing, like every other unset
field.
What is published is the union of those declarations with the
Cross-Application Access scopes. RFC 9728 asks for the scopes "used in
authorization requests to request access to this protected resource" —
not the ones this resource enforces — and the exchange asks for the
Cross-App scopes on its second hop, so a client asking for exactly
scopes_supported (mcp-remote, and Cursor and Claude Code behind
it) could not otherwise reproduce a token the exchange would produce.
Not because anything downstream demands them. A deployment can be configured to require scopes of its own on an inbound token, but that is published in no document a client can read — a reason the union is useful, never a rule this library can assume.
Enforcement is unchanged: each tools/call is checked against the
called tool's own declarations, never against this list.
Source code in datarobot_genai/drmcpbase/oauth_protected_resource_metadata/entities.py
MCPOAuthProtectedResourceMetadataAdminConfig
dataclass
Bases: BaseDataClass
Server-owned facts about this deployment, not user-authored metadata.
Source code in datarobot_genai/drmcpbase/oauth_protected_resource_metadata/entities.py
MCPOAuthProtectedResourceMetadata
dataclass
Bases: BaseDataClass
The document served at /.well-known/oauth-protected-resource.
Registered RFC 9728 parameters keep their standard names.
cross_application_access is a DataRobot addition published under its own
name, matching the agent-side config block exactly. Unset fields are dropped
by to_dict_without_null_attribute, so a config that only declares
cross_application_access yields just that block plus
bearer_methods_supported.
Source code in datarobot_genai/drmcpbase/oauth_protected_resource_metadata/entities.py
ErrorCodeInAuthErrorResponse
Bases: Enum
It is based on https://www.rfc-editor.org/info/rfc6750/#section-3.1.
Source code in datarobot_genai/drmcpbase/oauth_protected_resource_metadata/entities.py
split_list_setting
Read a comma-separated setting, treating blank and unset alike.