diff --git a/examples/servers/simple-auth/mcp_simple_auth/server.py b/examples/servers/simple-auth/mcp_simple_auth/server.py index 0320871b1..7bdb29e88 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, 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 48eb9a841..7aaae8a0e 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]