1919from mcp .client .auth import OAuthClientProvider , TokenStorage
2020from mcp .client .session import ClientSession
2121from mcp .client .sse import sse_client
22- from mcp .client .streamable_http import streamablehttp_client
22+ from mcp .client .streamable_http import streamable_http_client
2323from mcp .shared .auth import OAuthClientInformationFull , OAuthClientMetadata , OAuthToken
2424
2525
@@ -188,9 +188,7 @@ async def _default_redirect_handler(authorization_url: str) -> None:
188188 # Create OAuth authentication handler using the new interface
189189 oauth_auth = OAuthClientProvider (
190190 server_url = self .server_url .replace ("/mcp" , "" ),
191- client_metadata = OAuthClientMetadata .model_validate (
192- client_metadata_dict
193- ),
191+ client_metadata = OAuthClientMetadata .model_validate (client_metadata_dict ),
194192 storage = InMemoryTokenStorage (),
195193 redirect_handler = _default_redirect_handler ,
196194 callback_handler = callback_handler ,
@@ -207,7 +205,7 @@ async def _default_redirect_handler(authorization_url: str) -> None:
207205 await self ._run_session (read_stream , write_stream , None )
208206 else :
209207 print ("📡 Opening StreamableHTTP transport connection with auth..." )
210- async with streamablehttp_client (
208+ async with streamable_http_client (
211209 url = self .server_url ,
212210 auth = oauth_auth ,
213211 timeout = timedelta (seconds = 60 ),
@@ -322,9 +320,7 @@ async def interactive_loop(self):
322320 await self .call_tool (tool_name , arguments )
323321
324322 else :
325- print (
326- "❌ Unknown command. Try 'list', 'call <tool_name>', or 'quit'"
327- )
323+ print ("❌ Unknown command. Try 'list', 'call <tool_name>', or 'quit'" )
328324
329325 except KeyboardInterrupt :
330326 print ("\n \n 👋 Goodbye!" )
0 commit comments