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

Method open_mcp_config

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

Open MCP config file in system editor or show its path

(&self, chat_state: &mut ChatState)

Source from the content-addressed store, hash-verified

2734
2735 /// Open MCP config file in system editor or show its path
2736 fn open_mcp_config(&self, chat_state: &mut ChatState) {
2737 match bitfun_core::infrastructure::try_get_path_manager_arc() {
2738 Ok(path_manager) => {
2739 let config_file = path_manager.app_config_file();
2740 chat_state.add_system_message(format!(
2741 "MCP servers are configured in:\n {}\n\n\
2742 Edit the \"mcp_servers\" section. Example (Cursor format):\n\
2743 {{\n \"mcp_servers\": {{\n \"mcpServers\": {{\n \
2744 \"my-server\": {{\n \"type\": \"stdio\",\n \
2745 \"command\": \"npx\",\n \"args\": [\"-y\", \"@modelcontextprotocol/server-xxx\"]\n \
2746 }}\n }}\n }}\n}}",
2747 config_file.display()
2748 ));
2749 }
2750 Err(_) => {
2751 chat_state.add_system_message(
2752 "Could not determine config file path. Check ~/.config/bitfun/config/app.json"
2753 .to_string(),
2754 );
2755 }
2756 }
2757 }
2758
2759 /// Switch to a different session: restore it from core, reload messages, update state
2760 fn switch_to_session(

Callers 1

handle_key_eventMethod · 0.80

Calls 3

try_get_path_manager_arcFunction · 0.85
app_config_fileMethod · 0.80
add_system_messageMethod · 0.80

Tested by

no test coverage detected