@@ -102,20 +102,16 @@ def __init__(self, port=3000):
102102 self .port = port
103103 self .server = None
104104 self .thread = None
105- self .callback_data = {
106- "authorization_code" : None ,
107- "state" : None ,
108- "error" : None
109- }
105+ self .callback_data = {"authorization_code" : None , "state" : None , "error" : None }
110106
111107 def _create_handler_with_data (self ):
112108 """Create a handler class with access to callback data."""
113109 callback_data = self .callback_data
114-
110+
115111 class DataCallbackHandler (CallbackHandler ):
116112 def __init__ (self , request , client_address , server ):
117113 super ().__init__ (request , client_address , server , callback_data )
118-
114+
119115 return DataCallbackHandler
120116
121117 def start (self ):
@@ -144,7 +140,7 @@ def wait_for_callback(self, timeout=300):
144140 raise Exception (f"OAuth error: { self .callback_data ['error' ]} " )
145141 time .sleep (0.1 )
146142 raise Exception ("Timeout waiting for OAuth callback" )
147-
143+
148144 def get_state (self ):
149145 """Get the received state parameter."""
150146 return self .callback_data ["state" ]
@@ -155,9 +151,6 @@ class SimpleAuthClient:
155151
156152 def __init__ (self , server_url : str ):
157153 self .server_url = server_url
158- # Extract base URL for auth server (remove /mcp endpoint for auth endpoints)
159- # Use default redirect URI - this is where the auth server will redirect
160- # The user will need to copy the authorization code from this callback URL
161154 self .session : ClientSession | None = None
162155
163156 async def connect (self ):
@@ -202,8 +195,6 @@ async def _default_redirect_handler(authorization_url: str) -> None:
202195 callback_handler = callback_handler ,
203196 )
204197
205- # Initialize the auth handler and ensure we have tokens
206-
207198 # Create streamable HTTP transport with auth handler
208199 stream_context = streamablehttp_client (
209200 url = self .server_url ,
0 commit comments