(
state: State<'_, AppState>,
startup_trace: State<'_, DesktopStartupTrace>,
)
| 123 | |
| 124 | #[tauri::command] |
| 125 | pub async fn initialize_mcp_servers( |
| 126 | state: State<'_, AppState>, |
| 127 | startup_trace: State<'_, DesktopStartupTrace>, |
| 128 | ) -> Result<(), String> { |
| 129 | let trace_started = Instant::now(); |
| 130 | let result = async { |
| 131 | let mcp_service = state |
| 132 | .mcp_service |
| 133 | .as_ref() |
| 134 | .ok_or_else(|| "MCP service not initialized".to_string())?; |
| 135 | |
| 136 | mcp_service |
| 137 | .server_manager() |
| 138 | .initialize_all() |
| 139 | .await |
| 140 | .map_err(|e| e.to_string())?; |
| 141 | |
| 142 | Ok(()) |
| 143 | } |
| 144 | .await; |
| 145 | startup_trace.record_tauri_command_elapsed("initialize_mcp_servers", None, trace_started); |
| 146 | result |
| 147 | } |
| 148 | |
| 149 | #[tauri::command] |
| 150 | pub async fn initialize_mcp_servers_non_destructive( |
nothing calls this directly
no test coverage detected