File tree 1 file changed +4
-2
lines changed
Filter options
1 file changed +4
-2
lines changed
Original file line number Diff line number Diff line change 12
12
from mcp .client .sse import sse_client
13
13
from mcp .client .streamable_http import GetSessionIdCallback , streamablehttp_client
14
14
from mcp .shared .message import SessionMessage
15
- from mcp .types import CallToolResult
15
+ from mcp .types import CallToolResult , InitializeResult
16
16
from typing_extensions import NotRequired , TypedDict
17
17
18
18
from ..exceptions import UserError
@@ -73,6 +73,7 @@ def __init__(self, cache_tools_list: bool, client_session_timeout_seconds: float
73
73
self .exit_stack : AsyncExitStack = AsyncExitStack ()
74
74
self ._cleanup_lock : asyncio .Lock = asyncio .Lock ()
75
75
self .cache_tools_list = cache_tools_list
76
+ self .server_initialize_result : InitializeResult | None = None
76
77
77
78
self .client_session_timeout_seconds = client_session_timeout_seconds
78
79
@@ -122,7 +123,8 @@ async def connect(self):
122
123
else None ,
123
124
)
124
125
)
125
- await session .initialize ()
126
+ server_result = await session .initialize ()
127
+ self .server_initialize_result = server_result
126
128
self .session = session
127
129
except Exception as e :
128
130
logger .error (f"Error initializing MCP server: { e } " )
You can’t perform that action at this time.
0 commit comments