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

Function install_mcp_server

src/agents/kiro.rs:367–389  ·  view source on GitHub ↗

Register MCP server in ~/.kiro/settings/mcp.json.

(path: &Path, tracedecay_bin: &str)

Source from the content-addressed store, hash-verified

365
366/// Register MCP server in ~/.kiro/settings/mcp.json.
367fn install_mcp_server(path: &Path, tracedecay_bin: &str) -> Result<()> {
368 let backup = backup_config_file(path)?;
369 let mut config = match load_json_file_strict(path) {
370 Ok(v) => v,
371 Err(e) => {
372 if let Some(ref b) = backup {
373 eprintln!(" Backup preserved at: {}", b.display());
374 }
375 return Err(e);
376 }
377 };
378
379 ensure_json_object(&config, path)?;
380 ensure_child_object(&mut config, "mcpServers", path)?;
381 config["mcpServers"]["tracedecay"] = mcp_server_entry(tracedecay_bin);
382
383 safe_write_json_file(path, &config, backup.as_deref())?;
384 eprintln!(
385 "\x1b[32m✔\x1b[0m Added tracedecay MCP server to {}",
386 path.display()
387 );
388 Ok(())
389}
390
391/// Create or refresh the tracedecay-owned Kiro agent.
392///

Callers 2

installMethod · 0.70
install_localMethod · 0.70

Calls 6

backup_config_fileFunction · 0.85
load_json_file_strictFunction · 0.85
ensure_json_objectFunction · 0.85
ensure_child_objectFunction · 0.85
mcp_server_entryFunction · 0.85
safe_write_json_fileFunction · 0.85

Tested by

no test coverage detected