MCPcopy Create free account
hub / github.com/GCWing/BitFun / toggle_mcp_server

Method toggle_mcp_server

src/apps/cli/src/modes/chat.rs:2329–2337  ·  view source on GitHub ↗

Schedule an MCP server toggle (deferred to allow loading state to render)

(&mut self, server_id: &str, chat_view: &mut ChatView)

Source from the content-addressed store, hash-verified

2327
2328 /// Schedule an MCP server toggle (deferred to allow loading state to render)
2329 fn toggle_mcp_server(&mut self, server_id: &str, chat_view: &mut ChatView) {
2330 if self.pending_mcp_op.is_some() || self.is_mcp_server_task_running(server_id) {
2331 return;
2332 }
2333
2334 // Set loading indicator immediately — will be rendered before execution
2335 chat_view.mcp_selector_set_loading(Some(server_id.to_string()));
2336 self.pending_mcp_op = Some(PendingMcpOp::Toggle(server_id.to_string()));
2337 }
2338
2339 /// Execute MCP server toggle (called from main loop after render)
2340 fn execute_mcp_toggle(

Callers 2

handle_key_eventMethod · 0.80
handle_non_key_eventMethod · 0.80

Calls 2

Tested by

no test coverage detected