File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -791,8 +791,9 @@ pub extern "C" fn mcp_list_tools_init() -> usize {
791791 // Clone the Arc to share the service across async boundaries
792792 let service_arc = client. service . clone ( ) ;
793793
794- // Use the client's runtime to spawn the task
795- client. runtime . spawn ( async move {
794+ // Use the client's runtime handle to spawn the task (Windows compatible)
795+ let handle = client. runtime . handle ( ) . clone ( ) ;
796+ handle. spawn ( async move {
796797 let service_guard = service_arc. lock ( ) . await ;
797798 if let Some ( service) = service_guard. as_ref ( ) {
798799 match service. list_tools ( None ) . await {
@@ -878,8 +879,9 @@ pub extern "C" fn mcp_call_tool_init(tool_name: *const c_char, arguments: *const
878879 if let Some ( client) = client_opt. as_ref ( ) {
879880 let service_arc = client. service . clone ( ) ;
880881
881- // Use the client's runtime to spawn the task
882- client. runtime . spawn ( async move {
882+ // Use the client's runtime handle to spawn the task (Windows compatible)
883+ let handle = client. runtime . handle ( ) . clone ( ) ;
884+ handle. spawn ( async move {
883885 let service_guard = service_arc. lock ( ) . await ;
884886 if let Some ( service) = service_guard. as_ref ( ) {
885887 // Parse arguments
You can’t perform that action at this time.
0 commit comments