MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / install_mcp_server

Function install_mcp_server

src/agents/kilo.rs:97–125  ·  view source on GitHub ↗
(config_path: &Path, tracedecay_bin: &str)

Source from the content-addressed store, hash-verified

95// ---------------------------------------------------------------------------
96
97fn install_mcp_server(config_path: &Path, tracedecay_bin: &str) -> Result<()> {
98 if let Some(parent) = config_path.parent() {
99 std::fs::create_dir_all(parent).ok();
100 }
101
102 let backup = backup_config_file(config_path)?;
103 let mut settings = match load_jsonc_file_strict(config_path) {
104 Ok(v) => v,
105 Err(e) => {
106 if let Some(ref b) = backup {
107 eprintln!(" Backup preserved at: {}", b.display());
108 }
109 return Err(e);
110 }
111 };
112
113 settings["mcp"]["tracedecay"] = json!({
114 "type": "local",
115 "command": [tracedecay_bin, "serve"],
116 "enabled": true
117 });
118
119 safe_write_json_file(config_path, &settings, backup.as_deref())?;
120 eprintln!(
121 "\x1b[32m✔\x1b[0m Added tracedecay MCP server to {}",
122 config_path.display()
123 );
124 Ok(())
125}
126
127fn uninstall_mcp_server(config_path: &Path) {
128 if !config_path.exists() {

Callers 2

installMethod · 0.70
install_localMethod · 0.70

Calls 3

backup_config_fileFunction · 0.85
load_jsonc_file_strictFunction · 0.85
safe_write_json_fileFunction · 0.85

Tested by

no test coverage detected