From 468854481fd419a816e5692a999008a5d8e3e625 Mon Sep 17 00:00:00 2001 From: Paul J Thordarson Date: Sat, 6 Sep 2025 13:44:56 -0400 Subject: [PATCH] Fix protocol issue Claude Code does not always send the `listChanged` field during the handshake. This can prevent a server built with this library to fail during startup. --- .../src/main/scala/ch/linkyard/mcp/protocol/lifecycle.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcp/protocol/src/main/scala/ch/linkyard/mcp/protocol/lifecycle.scala b/mcp/protocol/src/main/scala/ch/linkyard/mcp/protocol/lifecycle.scala index 371c965..fb2c816 100644 --- a/mcp/protocol/src/main/scala/ch/linkyard/mcp/protocol/lifecycle.scala +++ b/mcp/protocol/src/main/scala/ch/linkyard/mcp/protocol/lifecycle.scala @@ -143,7 +143,7 @@ object Initialize: } given Decoder[Changable] = Decoder.instance { c => - c.downField("listChanged").as[Boolean].map(Changable.apply) + c.downField("listChanged").as[Option[Boolean]].map(_.getOrElse(false)).map(Changable.apply) } case class Subscribable(subscribe: Boolean, listChanged: Boolean)