Open MCP config file in system editor or show its path
(&self, chat_state: &mut ChatState)
| 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( |
no test coverage detected