Synchronous wrapper to start the MCP server # Errors This function will return an error if the MCP server fails to start or if the tokio runtime cannot be created.
()
| 43 | /// |
| 44 | /// This function will return an error if the MCP server fails to start or if the tokio runtime cannot be created. |
| 45 | pub fn start_mcp_server() -> Result<(), Box<dyn std::error::Error + Send + Sync>> { |
| 46 | let rt = tokio::runtime::Runtime::new() |
| 47 | .map_err(|e| McpError::internal_error(t!("mcp.mod.failedToCreateRuntime", error = e.to_string()), None))?; |
| 48 | |
| 49 | rt.block_on(start_mcp_server_async()) |
| 50 | .map_err(|e| McpError::internal_error(t!("mcp.mod.failedToStart", error = e.to_string()), None))?; |
| 51 | Ok(()) |
| 52 | } |
no test coverage detected