19
19
from mcp .client .auth import OAuthClientProvider , TokenStorage
20
20
from mcp .client .session import ClientSession
21
21
from 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
23
23
from mcp .shared .auth import OAuthClientInformationFull , OAuthClientMetadata , OAuthToken
24
24
25
25
@@ -188,9 +188,7 @@ async def _default_redirect_handler(authorization_url: str) -> None:
188
188
# Create OAuth authentication handler using the new interface
189
189
oauth_auth = OAuthClientProvider (
190
190
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 ),
194
192
storage = InMemoryTokenStorage (),
195
193
redirect_handler = _default_redirect_handler ,
196
194
callback_handler = callback_handler ,
@@ -207,7 +205,7 @@ async def _default_redirect_handler(authorization_url: str) -> None:
207
205
await self ._run_session (read_stream , write_stream , None )
208
206
else :
209
207
print ("📡 Opening StreamableHTTP transport connection with auth..." )
210
- async with streamablehttp_client (
208
+ async with streamable_http_client (
211
209
url = self .server_url ,
212
210
auth = oauth_auth ,
213
211
timeout = timedelta (seconds = 60 ),
@@ -322,9 +320,7 @@ async def interactive_loop(self):
322
320
await self .call_tool (tool_name , arguments )
323
321
324
322
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'" )
328
324
329
325
except KeyboardInterrupt :
330
326
print ("\n \n 👋 Goodbye!" )
0 commit comments