π The fast, Pythonic way to build MCP servers and clients.
chore: Update SDK documentation (#2588)
marvin-context-protocol[bot]855e01ed2175
diff --git a/docs/python-sdk/fastmcp-server-auth-oauth_proxy.mdx b/docs/python-sdk/fastmcp-server-auth-oauth_proxy.mdxindex c8de4bb4e..058055b82 100644--- a/docs/python-sdk/fastmcp-server-auth-oauth_proxy.mdx+++ b/docs/python-sdk/fastmcp-server-auth-oauth_proxy.mdx@@ -26,7 +26,7 @@ production use with enterprise identity providers.## Functions-### `create_consent_html` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L254" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `create_consent_html` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L257" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoncreate_consent_html(client_id: str, redirect_uri: str, scopes: list[str], txn_id: str, csrf_token: str, client_name: str | None = None, title: str = 'Application Access Request', server_name: str | None = None, server_icon_url: str | None = None, server_website_url: str | None = None, client_website_url: str | None = None, csp_policy: str | None = None) -> str@@ -42,7 +42,7 @@ If empty string "", disables CSP entirely (no meta tag is rendered).If a non-empty string, uses that as the CSP policy value.-### `create_error_html` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L424" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `create_error_html` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L427" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoncreate_error_html(error_title: str, error_message: str, error_details: dict[str, str] | None = None, server_name: str | None = None, server_icon_url: str | None = None) -> str@@ -64,7 +64,7 @@ Create a styled HTML error page for OAuth errors.## Classes-### `OAuthTransaction` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L104" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `OAuthTransaction` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L107" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>OAuth transaction state for consent flow.@@ -73,7 +73,7 @@ Stored server-side to track active authorization flows with client context.Includes CSRF tokens for consent protection per MCP security best practices.-### `ClientCode` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L125" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ClientCode` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L128" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Client authorization code with PKCE and upstream tokens.@@ -82,7 +82,7 @@ Stored server-side after upstream IdP callback. Contains the upstreamtokens bound to the client's PKCE challenge for secure token exchange.-### `UpstreamTokenSet` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L143" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `UpstreamTokenSet` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L146" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Stored upstream OAuth tokens from identity provider.@@ -92,7 +92,7 @@ and stored in plaintext within this model. Encryption is handled transparentlyat the storage layer via FernetEncryptionWrapper. Tokens are never exposed to MCP clients.-### `JTIMapping` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L165" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `JTIMapping` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L168" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Maps FastMCP token JTI to upstream token ID.@@ -101,7 +101,7 @@ This allows stateless JWT validation while still being able to look upthe corresponding upstream token when tools need to access upstream APIs.-### `RefreshTokenMetadata` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L177" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `RefreshTokenMetadata` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L180" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Metadata for a refresh token, stored keyed by token hash.@@ -110,7 +110,7 @@ We store only metadata (not the token itself) for security - if storageis compromised, attackers get hashes they can't reverse into usable tokens.-### `ProxyDCRClient` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L199" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `ProxyDCRClient` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L202" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Client for DCR proxy with configurable redirect URI validation.@@ -140,7 +140,7 @@ arise from accepting arbitrary redirect URIs.**Methods:**-#### `validate_redirect_uri` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L228" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `validate_redirect_uri` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L231" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonvalidate_redirect_uri(self, redirect_uri: AnyUrl | None) -> AnyUrl@@ -154,7 +154,7 @@ This is essential for cached token scenarios where the client mayreconnect with a different port.-### `OAuthProxy` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L512" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `OAuthProxy` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L515" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>OAuth provider that presents a DCR-compliant interface while proxying to non-DCR IDPs.@@ -268,7 +268,7 @@ Handles provider-specific requirements:**Methods:**-#### `get_client` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L909" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_client` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L924" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_client(self, client_id: str) -> OAuthClientInformationFull | None@@ -280,7 +280,7 @@ provided to the DCR client during registration, not the upstream client ID.For unregistered clients, returns None (which will raise an error in the SDK).-#### `register_client` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L925" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `register_client` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L940" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonregister_client(self, client_info: OAuthClientInformationFull) -> None@@ -294,7 +294,7 @@ redirect URI will likely be localhost or unknown to the proxied IDP. Theproxied IDP only knows about this server's fixed redirect URI.-#### `authorize` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L978" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `authorize` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L993" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonauthorize(self, client: OAuthClientInformationFull, params: AuthorizationParams) -> str@@ -311,7 +311,7 @@ If consent is disabled (require_authorization_consent=False), skip the consent sand redirect directly to the upstream IdP.-#### `load_authorization_code` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L1058" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `load_authorization_code` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L1073" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonload_authorization_code(self, client: OAuthClientInformationFull, authorization_code: str) -> AuthorizationCode | None@@ -323,7 +323,7 @@ Look up our client code and return authorization code objectwith PKCE challenge for validation.-#### `exchange_authorization_code` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L1106" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `exchange_authorization_code` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L1121" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonexchange_authorization_code(self, client: OAuthClientInformationFull, authorization_code: AuthorizationCode) -> OAuthToken@@ -341,7 +341,7 @@ Implements the token factory pattern:PKCE validation is handled by the MCP framework before this method is called.-#### `load_refresh_token` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L1284" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `load_refresh_token` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L1308" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonload_refresh_token(self, client: OAuthClientInformationFull, refresh_token: str) -> RefreshToken | None@@ -353,7 +353,7 @@ Looks up by token hash and reconstructs the RefreshToken object.Validates that the token belongs to the requesting client.-#### `exchange_refresh_token` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L1313" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `exchange_refresh_token` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L1337" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonexchange_refresh_token(self, client: OAuthClientInformationFull, refresh_token: RefreshToken, scopes: list[str]) -> OAuthToken@@ -370,7 +370,7 @@ Implements two-tier refresh:6. Keep same FastMCP refresh token (unless upstream rotates)-#### `load_access_token` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L1517" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `load_access_token` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L1546" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonload_access_token(self, token: str) -> AccessToken | None@@ -389,7 +389,7 @@ The FastMCP JWT is a reference token - all authorization data comesfrom validating the upstream token via the TokenVerifier.-#### `revoke_token` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L1573" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `revoke_token` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L1602" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonrevoke_token(self, token: AccessToken | RefreshToken) -> None@@ -402,7 +402,7 @@ For all tokens, attempts upstream revocation if endpoint is configured.Access token JTI mappings expire via TTL.-#### `get_routes` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L1606" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_routes` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oauth_proxy.py#L1635" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_routes(self, mcp_path: str | None = None) -> list[Route]diff --git a/docs/python-sdk/fastmcp-server-auth-oidc_proxy.mdx b/docs/python-sdk/fastmcp-server-auth-oidc_proxy.mdxindex 184bc82af..a1794bb6f 100644--- a/docs/python-sdk/fastmcp-server-auth-oidc_proxy.mdx+++ b/docs/python-sdk/fastmcp-server-auth-oidc_proxy.mdx@@ -52,7 +52,7 @@ that is OIDC compliant.**Methods:**-#### `get_oidc_configuration` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oidc_proxy.py#L373" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_oidc_configuration` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oidc_proxy.py#L380" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_oidc_configuration(self, config_url: AnyHttpUrl, strict: bool | None, timeout_seconds: int | None) -> OIDCConfiguration@@ -66,7 +66,7 @@ Gets the OIDC configuration for the specified configuration URL.- `timeout_seconds`: HTTP request timeout in seconds-#### `get_token_verifier` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oidc_proxy.py#L390" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_token_verifier` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/server/auth/oidc_proxy.py#L397" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_token_verifier(self) -> TokenVerifier