|
13 | 13 | from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream |
14 | 14 |
|
15 | 15 | import mcp.types as types |
16 | | -from mcp.client.session import ClientSession, ElicitationFnT, ListRootsFnT, LoggingFnT, MessageHandlerFnT, SamplingFnT |
| 16 | +from mcp.client.session import ( |
| 17 | + ClientSession, |
| 18 | + ElicitationFnT, |
| 19 | + ListRootsFnT, |
| 20 | + LoggingFnT, |
| 21 | + MessageHandlerFnT, |
| 22 | + ProgressNotificationFnT, |
| 23 | + PromptListChangedFnT, |
| 24 | + ResourceListChangedFnT, |
| 25 | + ResourceUpdatedFnT, |
| 26 | + SamplingFnT, |
| 27 | + ToolListChangedFnT, |
| 28 | +) |
17 | 29 | from mcp.server import Server |
18 | 30 | from mcp.server.fastmcp import FastMCP |
19 | 31 | from mcp.shared.message import SessionMessage |
@@ -53,6 +65,11 @@ async def create_connected_server_and_client_session( |
53 | 65 | sampling_callback: SamplingFnT | None = None, |
54 | 66 | list_roots_callback: ListRootsFnT | None = None, |
55 | 67 | logging_callback: LoggingFnT | None = None, |
| 68 | + progress_notification_callback: ProgressNotificationFnT | None = None, |
| 69 | + resource_updated_callback: ResourceUpdatedFnT | None = None, |
| 70 | + resource_list_changed_callback: ResourceListChangedFnT | None = None, |
| 71 | + tool_list_changed_callback: ToolListChangedFnT | None = None, |
| 72 | + prompt_list_changed_callback: PromptListChangedFnT | None = None, |
56 | 73 | message_handler: MessageHandlerFnT | None = None, |
57 | 74 | client_info: types.Implementation | None = None, |
58 | 75 | raise_exceptions: bool = False, |
@@ -88,6 +105,11 @@ async def create_connected_server_and_client_session( |
88 | 105 | sampling_callback=sampling_callback, |
89 | 106 | list_roots_callback=list_roots_callback, |
90 | 107 | logging_callback=logging_callback, |
| 108 | + progress_notification_callback=progress_notification_callback, |
| 109 | + resource_updated_callback=resource_updated_callback, |
| 110 | + resource_list_changed_callback=resource_list_changed_callback, |
| 111 | + tool_list_changed_callback=tool_list_changed_callback, |
| 112 | + prompt_list_changed_callback=prompt_list_changed_callback, |
91 | 113 | message_handler=message_handler, |
92 | 114 | client_info=client_info, |
93 | 115 | elicitation_callback=elicitation_callback, |
|
0 commit comments