From 8b1aff17de583d8ce0b8b5c88fdd03f9e95d4577 Mon Sep 17 00:00:00 2001 From: Nikodemas-Tuckus Date: Fri, 12 Jun 2026 12:42:08 +0300 Subject: [PATCH 1/2] Fix server_url in the simple-auth example --- examples/servers/simple-auth/mcp_simple_auth/server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/servers/simple-auth/mcp_simple_auth/server.py b/examples/servers/simple-auth/mcp_simple_auth/server.py index 0320871b12..7bdb29e888 100644 --- a/examples/servers/simple-auth/mcp_simple_auth/server.py +++ b/examples/servers/simple-auth/mcp_simple_auth/server.py @@ -31,7 +31,7 @@ class ResourceServerSettings(BaseSettings): # Server settings host: str = "localhost" port: int = 8001 - server_url: AnyHttpUrl = AnyHttpUrl("http://localhost:8001/mcp") + server_url: AnyHttpUrl = AnyHttpUrl("http://localhost:8001") # Authorization Server settings auth_server_url: AnyHttpUrl = AnyHttpUrl("http://localhost:9000") @@ -128,7 +128,7 @@ def main(port: int, auth_server: str, transport: Literal["sse", "streamable-http # Create settings host = "localhost" - server_url = f"http://{host}:{port}/mcp" + server_url = f"http://{host}:{port}" settings = ResourceServerSettings( host=host, port=port, From 0371e870c872b897cec4b8043de25e8602753b9a Mon Sep 17 00:00:00 2001 From: Nikodemas-Tuckus Date: Fri, 12 Jun 2026 12:43:03 +0300 Subject: [PATCH 2/2] Fix TODO type hint in simple-auth example --- .../simple-auth/mcp_simple_auth/simple_auth_provider.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/servers/simple-auth/mcp_simple_auth/simple_auth_provider.py b/examples/servers/simple-auth/mcp_simple_auth/simple_auth_provider.py index 48eb9a8414..7aaae8a0ea 100644 --- a/examples/servers/simple-auth/mcp_simple_auth/simple_auth_provider.py +++ b/examples/servers/simple-auth/mcp_simple_auth/simple_auth_provider.py @@ -265,8 +265,7 @@ async def exchange_refresh_token( """Exchange refresh token - not supported in this example.""" raise NotImplementedError("Refresh tokens not supported") - # TODO(Marcelo): The type hint is wrong. We need to fix, and test to check if it works. - async def revoke_token(self, token: str, token_type_hint: str | None = None) -> None: # type: ignore + async def revoke_token(self, token: AccessToken | RefreshToken) -> None: """Revoke a token.""" - if token in self.tokens: - del self.tokens[token] + if token.token in self.tokens: + del self.tokens[token.token]