handoff-mcp-server 0.24.3 → 0.24.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Cargo.lock CHANGED
@@ -145,7 +145,7 @@ dependencies = [
145
145
 
146
146
  [[package]]
147
147
  name = "handoff-mcp"
148
- version = "0.24.3"
148
+ version = "0.24.4"
149
149
  dependencies = [
150
150
  "anyhow",
151
151
  "chrono",
package/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "handoff-mcp"
3
- version = "0.24.3"
3
+ version = "0.24.4"
4
4
  edition = "2021"
5
5
  description = "MCP server that gives AI coding agents persistent memory across sessions"
6
6
  license = "MIT"
package/README.md CHANGED
@@ -86,8 +86,8 @@ edit. Disable anytime with `/plugin disable handoff-mcp-hooks@handoff-mcp-market
86
86
  the MCP server and skills remain active.
87
87
 
88
88
  > **Important:** The hooks require a `handoff` MCP server entry in the
89
- > project's `.mcp.json`. If your project doesn't already have one (e.g. you
90
- > only use the plugin), add it:
89
+ > project's `.mcp.json`. Run `handoff-mcp setup --mcp-json` in the project
90
+ > directory to add it automatically, or add it manually:
91
91
  >
92
92
  > ```json
93
93
  > {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "handoff-mcp-server",
3
- "version": "0.24.3",
3
+ "version": "0.24.4",
4
4
  "description": "MCP server that gives AI coding agents persistent memory across sessions",
5
5
  "license": "MIT",
6
6
  "author": "AlphaElements <66808803+alphaelements@users.noreply.github.com>",
package/src/setup.rs CHANGED
@@ -229,7 +229,11 @@ pub fn run_setup_with_opts(
229
229
  return run_uninstall(&mut settings, &path);
230
230
  }
231
231
 
232
- run_install(&mut settings, &path, mcp_json, yes)
232
+ if mcp_json {
233
+ return run_mcp_json_only();
234
+ }
235
+
236
+ run_install(&mut settings, &path, yes)
233
237
  }
234
238
 
235
239
  fn run_check(settings: &Value, path: &Path) -> Result<()> {
@@ -297,7 +301,21 @@ fn prompt_yn(question: &str) -> bool {
297
301
  trimmed.is_empty() || trimmed == "y" || trimmed == "yes"
298
302
  }
299
303
 
300
- fn run_install(settings: &mut Value, path: &Path, mcp_json: bool, yes: bool) -> Result<()> {
304
+ fn run_mcp_json_only() -> Result<()> {
305
+ let mcp_path = mcp_json_path();
306
+ if has_mcp_json_entry(&mcp_path) {
307
+ println!(" .mcp.json: handoff server already configured. Nothing to do.");
308
+ return Ok(());
309
+ }
310
+ let added = ensure_mcp_json_entry(&mcp_path)?;
311
+ if added {
312
+ println!(" .mcp.json: added handoff server entry");
313
+ println!("\nRestart Claude Code for changes to take effect.");
314
+ }
315
+ Ok(())
316
+ }
317
+
318
+ fn run_install(settings: &mut Value, path: &Path, yes: bool) -> Result<()> {
301
319
  let obj = settings
302
320
  .as_object_mut()
303
321
  .context("settings.json root is not an object")?;
@@ -363,7 +381,7 @@ fn run_install(settings: &mut Value, path: &Path, mcp_json: bool, yes: bool) ->
363
381
  let needs_mcp = !has_mcp_json_entry(&mcp_path);
364
382
 
365
383
  if needs_mcp {
366
- let should_write = if mcp_json || yes {
384
+ let should_write = if yes {
367
385
  true
368
386
  } else {
369
387
  println!();
@@ -482,7 +500,7 @@ mod tests {
482
500
  let path = dir.path().join("settings.json");
483
501
 
484
502
  let mut settings = Value::Object(serde_json::Map::new());
485
- run_install(&mut settings, &path, false, false).unwrap();
503
+ run_install(&mut settings, &path, false).unwrap();
486
504
 
487
505
  let written: Value =
488
506
  serde_json::from_str(&std::fs::read_to_string(&path).unwrap()).unwrap();
@@ -505,7 +523,7 @@ mod tests {
505
523
  }
506
524
  });
507
525
 
508
- run_install(&mut settings, &path, false, false).unwrap();
526
+ run_install(&mut settings, &path, false).unwrap();
509
527
 
510
528
  let written: Value =
511
529
  serde_json::from_str(&std::fs::read_to_string(&path).unwrap()).unwrap();
@@ -520,10 +538,10 @@ mod tests {
520
538
  let path = dir.path().join("settings.json");
521
539
 
522
540
  let mut settings = Value::Object(serde_json::Map::new());
523
- run_install(&mut settings, &path, false, false).unwrap();
541
+ run_install(&mut settings, &path, false).unwrap();
524
542
 
525
543
  let mut settings2 = serde_json::from_str(&std::fs::read_to_string(&path).unwrap()).unwrap();
526
- run_install(&mut settings2, &path, false, false).unwrap();
544
+ run_install(&mut settings2, &path, false).unwrap();
527
545
 
528
546
  let written: Value =
529
547
  serde_json::from_str(&std::fs::read_to_string(&path).unwrap()).unwrap();
@@ -541,7 +559,7 @@ mod tests {
541
559
  let path = dir.path().join("settings.json");
542
560
 
543
561
  let mut settings = Value::Object(serde_json::Map::new());
544
- run_install(&mut settings, &path, false, false).unwrap();
562
+ run_install(&mut settings, &path, false).unwrap();
545
563
 
546
564
  let mut settings2: Value =
547
565
  serde_json::from_str(&std::fs::read_to_string(&path).unwrap()).unwrap();
@@ -571,7 +589,7 @@ mod tests {
571
589
  std::fs::write(&path, original).unwrap();
572
590
 
573
591
  let mut settings: Value = serde_json::from_str(original).unwrap();
574
- run_install(&mut settings, &path, false, false).unwrap();
592
+ run_install(&mut settings, &path, false).unwrap();
575
593
 
576
594
  let written = std::fs::read_to_string(&path).unwrap();
577
595
  let env_pos = written.find("\"env\"").unwrap();
@@ -612,7 +630,7 @@ mod tests {
612
630
  }
613
631
  });
614
632
 
615
- run_install(&mut settings, &path, false, false).unwrap();
633
+ run_install(&mut settings, &path, false).unwrap();
616
634
 
617
635
  let written: Value =
618
636
  serde_json::from_str(&std::fs::read_to_string(&path).unwrap()).unwrap();
@@ -639,7 +657,7 @@ mod tests {
639
657
  }
640
658
  });
641
659
 
642
- run_install(&mut settings, &path, false, false).unwrap();
660
+ run_install(&mut settings, &path, false).unwrap();
643
661
 
644
662
  let written: Value =
645
663
  serde_json::from_str(&std::fs::read_to_string(&path).unwrap()).unwrap();