π The fast, Pythonic way to build MCP servers and clients.
update docs
William Eastone457631ab019
diff --git a/docs/docs.json b/docs/docs.jsonindex 6101649c7..22412156b 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -122,7 +122,10 @@{"group": "Essentials","icon": "cube",- "pages": ["clients/client", "clients/transports"]+ "pages": [+ "clients/client",+ "clients/transports"+ ]},{"group": "Core Operations",@@ -148,7 +151,10 @@{"group": "Authentication","icon": "user-shield",- "pages": ["clients/auth/oauth", "clients/auth/bearer"]+ "pages": [+ "clients/auth/oauth",+ "clients/auth/bearer"+ ]}]},@@ -194,12 +200,17 @@},{"anchor": "What's New",- "pages": ["updates", "changelog"]+ "pages": [+ "updates",+ "changelog"+ ]},{"anchor": "Community","icon": "users",- "pages": ["community/showcase"]+ "pages": [+ "community/showcase"+ ]}]},diff --git a/docs/python-sdk/fastmcp-client-auth-oauth.mdx b/docs/python-sdk/fastmcp-client-auth-oauth.mdxindex a009f9319..30c063b93 100644--- a/docs/python-sdk/fastmcp-client-auth-oauth.mdx+++ b/docs/python-sdk/fastmcp-client-auth-oauth.mdx@@ -7,13 +7,13 @@ sidebarTitle: oauth## Functions-### `default_cache_dir` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L34" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `default_cache_dir` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L36" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythondefault_cache_dir() -> Path```-### `check_if_auth_required` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L152" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `check_if_auth_required` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L154" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoncheck_if_auth_required(mcp_url: str, httpx_kwargs: dict[str, Any] | None = None) -> bool@@ -28,7 +28,7 @@ Check if the MCP endpoint requires authentication by making a test request.## Classes-### `FileTokenStorage` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L38" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `FileTokenStorage` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L40" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>File-based token storage implementation for OAuth credentials and tokens.@@ -39,7 +39,7 @@ Each instance is tied to a specific server URL for proper token isolation.**Methods:**-#### `get_base_url` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L53" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_base_url` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L55" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_base_url(url: str) -> str@@ -48,7 +48,7 @@ get_base_url(url: str) -> strExtract the base URL (scheme + host) from a URL.-#### `get_cache_key` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L58" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_cache_key` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L60" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_cache_key(self) -> str@@ -57,7 +57,7 @@ get_cache_key(self) -> strGenerate a safe filesystem key from the server's base URL.-#### `get_tokens` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L73" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_tokens` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L75" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_tokens(self) -> OAuthToken | None@@ -66,7 +66,7 @@ get_tokens(self) -> OAuthToken | NoneLoad tokens from file storage.-#### `set_tokens` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L90" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `set_tokens` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L92" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonset_tokens(self, tokens: OAuthToken) -> None@@ -75,7 +75,7 @@ set_tokens(self, tokens: OAuthToken) -> NoneSave tokens to file storage.-#### `get_client_info` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L96" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `get_client_info` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L98" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonget_client_info(self) -> OAuthClientInformationFull | None@@ -84,7 +84,7 @@ get_client_info(self) -> OAuthClientInformationFull | NoneLoad client information from file storage.-#### `set_client_info` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L124" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `set_client_info` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L126" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonset_client_info(self, client_info: OAuthClientInformationFull) -> None@@ -93,7 +93,7 @@ set_client_info(self, client_info: OAuthClientInformationFull) -> NoneSave client information to file storage.-#### `clear` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L130" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `clear` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L132" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonclear(self) -> None@@ -102,7 +102,7 @@ clear(self) -> NoneClear all cached data for this server.-#### `clear_all` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L139" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `clear_all` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L141" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonclear_all(cls, cache_dir: Path | None = None) -> None@@ -111,7 +111,7 @@ clear_all(cls, cache_dir: Path | None = None) -> NoneClear all cached data for all servers.-### `OAuth` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L182" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+### `OAuth` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L184" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>OAuth client provider for MCP servers with browser-based authentication.@@ -122,7 +122,7 @@ a browser for user authorization and running a local callback server.**Methods:**-#### `redirect_handler` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L248" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `redirect_handler` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L250" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythonredirect_handler(self, authorization_url: str) -> None@@ -131,7 +131,7 @@ redirect_handler(self, authorization_url: str) -> NoneOpen browser for authorization.-#### `callback_handler` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L253" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>+#### `callback_handler` <sup><a href="https://github.com/jlowin/fastmcp/blob/main/src/fastmcp/client/auth/oauth.py#L255" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>```pythoncallback_handler(self) -> tuple[str, str | None]diff --git a/src/fastmcp/client/auth/oauth.py b/src/fastmcp/client/auth/oauth.pyindex eda685c58..f2418417a 100644--- a/src/fastmcp/client/auth/oauth.py+++ b/src/fastmcp/client/auth/oauth.py@@ -263,8 +263,6 @@ class OAuth(OAuthClientProvider):server_url=self.server_base_url,response_future=response_future,)- auth_code: str- state: str | None# Run server until response is received with timeout logicasync with anyio.create_task_group() as tg: