MCPcopy Create free account
hub / github.com/PowerShell/DSC / start_mcp_server

Function start_mcp_server

dsc/src/mcp/mod.rs:45–52  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

43///
44/// This function will return an error if the MCP server fails to start or if the tokio runtime cannot be created.
45pub 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}

Callers 1

mainFunction · 0.85

Calls 2

start_mcp_server_asyncFunction · 0.85
newFunction · 0.50

Tested by

no test coverage detected