MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / restart_mcp

Function restart_mcp

crates/opencode-server/src/routes.rs:2692–2707  ·  view source on GitHub ↗
(
    State(_state): State<Arc<ServerState>>,
    Path(name): Path<String>,
)

Source from the content-addressed store, hash-verified

2690}
2691
2692async fn restart_mcp(
2693 State(_state): State<Arc<ServerState>>,
2694 Path(name): Path<String>,
2695) -> Result<Json<McpRestartResponse>> {
2696 let manager = get_mcp_oauth_manager();
2697 ensure_mcp_server_registered(manager, &name).await?;
2698 let server = manager
2699 .restart(&name)
2700 .await
2701 .map_err(mcp_error_to_api_error)?;
2702
2703 Ok(Json(McpRestartResponse {
2704 success: true,
2705 server: server.into(),
2706 }))
2707}
2708
2709fn mcp_error_to_api_error(error: McpOAuthError) -> ApiError {
2710 match error {

Callers

nothing calls this directly

Calls 3

get_mcp_oauth_managerFunction · 0.85
restartMethod · 0.45

Tested by

no test coverage detected