(settings_path: &Path, tracedecay_bin: &str)
| 89 | // --------------------------------------------------------------------------- |
| 90 | |
| 91 | fn install_mcp_server(settings_path: &Path, tracedecay_bin: &str) -> Result<()> { |
| 92 | if let Some(parent) = settings_path.parent() { |
| 93 | std::fs::create_dir_all(parent).ok(); |
| 94 | } |
| 95 | |
| 96 | let backup = backup_config_file(settings_path)?; |
| 97 | let mut settings = match load_json_file_strict(settings_path) { |
| 98 | Ok(v) => v, |
| 99 | Err(e) => { |
| 100 | if let Some(ref b) = backup { |
| 101 | eprintln!(" Backup preserved at: {}", b.display()); |
| 102 | } |
| 103 | return Err(e); |
| 104 | } |
| 105 | }; |
| 106 | settings["mcpServers"]["tracedecay"] = json!({ |
| 107 | "command": tracedecay_bin, |
| 108 | "args": ["serve"], |
| 109 | "disabled": false |
| 110 | }); |
| 111 | |
| 112 | safe_write_json_file(settings_path, &settings, backup.as_deref())?; |
| 113 | eprintln!( |
| 114 | "\x1b[32m✔\x1b[0m Added tracedecay MCP server to {}", |
| 115 | settings_path.display() |
| 116 | ); |
| 117 | Ok(()) |
| 118 | } |
| 119 | |
| 120 | /// Remove MCP server entry from Roo Code's `cline_mcp_settings.json`. |
| 121 | fn uninstall_mcp_server(settings_path: &Path) { |
no test coverage detected