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

Function doctor_check_cli_settings

src/agents/copilot.rs:515–550  ·  view source on GitHub ↗

Check Copilot CLI mcp-config.json has tracedecay MCP server registered.

(dc: &mut DoctorCounters, home: &Path)

Source from the content-addressed store, hash-verified

513
514/// Check Copilot CLI mcp-config.json has tracedecay MCP server registered.
515fn doctor_check_cli_settings(dc: &mut DoctorCounters, home: &Path) {
516 let settings_path = super::copilot_cli_dir(home).join("mcp-config.json");
517
518 if !settings_path.exists() {
519 dc.warn(&format!(
520 "{} not found — run `tracedecay install --agent copilot` if you use Copilot CLI",
521 settings_path.display()
522 ));
523 return;
524 }
525
526 let settings = load_json_file(&settings_path);
527 let server = settings.get("mcpServers").and_then(|v| v.get("tracedecay"));
528
529 let Some(server) = server.and_then(|v| v.as_object()) else {
530 dc.fail(&format!(
531 "MCP server NOT registered in {} — run `tracedecay install --agent copilot`",
532 settings_path.display()
533 ));
534 return;
535 };
536 dc.pass(&format!(
537 "MCP server registered in {}",
538 settings_path.display()
539 ));
540
541 let has_serve = server
542 .get("args")
543 .and_then(|v| v.as_array())
544 .is_some_and(|arr| arr.iter().any(|v| v.as_str() == Some("serve")));
545 if has_serve {
546 dc.pass("MCP server args include \"serve\"");
547 } else {
548 dc.fail("MCP server args missing \"serve\" — run `tracedecay install --agent copilot`");
549 }
550}

Callers 1

healthcheckMethod · 0.85

Calls 7

copilot_cli_dirFunction · 0.85
load_json_fileFunction · 0.85
existsMethod · 0.80
warnMethod · 0.80
failMethod · 0.80
passMethod · 0.80
as_strMethod · 0.45

Tested by

no test coverage detected