Skip to content

Commit 6eca4b3

Browse files
committed
feat: enhance server management and configuration handling
- Updated LocalTable to filter out disabled servers based on the selected client. - Added new client "roo_code" to the clients list with appropriate configuration. - Introduced optional `disabled` property in SseConfig and StdioServerConfig types for better server management. - Implemented path handling for "roo_code" in the client configuration. - Added a command to check for the existence of the mcplinker configuration file. - Removed the unused json_manager.rs file to streamline the codebase.
1 parent bf9e9c8 commit 6eca4b3

File tree

14 files changed

+663
-469
lines changed

14 files changed

+663
-469
lines changed

src-tauri/src/client.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,25 @@ impl ClientConfig {
7070
("windsurf", _) => PathBuf::from(home).join(".codeium/windsurf/mcp_config.json"),
7171
("cherrystudio", _) => PathBuf::from(home).join(".config/cherrystudio/mcp.json"),
7272
("mcplinker", _) => PathBuf::from(home).join(".config/mcplinker/mcp.json"),
73+
("roo_code", Some(base_path)) => {
74+
// For roo_code, if a path is provided, use path + .roo/mcp.json
75+
if base_path.is_empty() {
76+
#[cfg(target_os = "macos")]
77+
{
78+
// On macOS, use the globalStorage path for roo_code
79+
PathBuf::from(&home)
80+
.join("Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json")
81+
}
82+
#[cfg(not(target_os = "macos"))]
83+
{
84+
// On other platforms, return empty path
85+
PathBuf::from("")
86+
}
87+
} else {
88+
// If a base path is provided, use base_path + .roo/mcp.json
89+
PathBuf::from(base_path).join(".roo/mcp.json")
90+
}
91+
}
7392
(_, Some(path_str)) => {
7493
if path_str.is_empty() {
7594
PathBuf::from(&home).join("mcp.json")

src-tauri/src/cmd.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::client::ClientConfig;
22
use crate::json_manager::JsonManager;
33
use serde_json::{json, Value};
4+
use std::path::PathBuf;
45

56
#[tauri::command]
67
pub async fn read_json_file(client_name: String, path: Option<String>) -> Result<Value, String> {
@@ -53,3 +54,10 @@ pub async fn get_app_path(client_name: String, path: Option<String>) -> Result<S
5354

5455
Ok(file_path.to_string_lossy().to_string())
5556
}
57+
58+
#[tauri::command]
59+
pub fn check_mcplinker_config_exists() -> bool {
60+
let home_dir = dirs::home_dir().unwrap_or_default();
61+
let config_path: PathBuf = home_dir.join(".config/mcplinker/mcp.json");
62+
config_path.exists()
63+
}

0 commit comments

Comments
 (0)