File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 66 "encoding/json"
77 "errors"
88 "fmt"
9+ "io"
910 "iter"
1011 "log/slog"
1112 "strings"
@@ -116,6 +117,17 @@ func (ts *Toolset) doStart(ctx context.Context) error {
116117 //
117118 // Only retry when initialization fails due to sending the initialized notification.
118119 if ! isInitNotificationSendError (err ) {
120+
121+ // EOF means the MCP server is unavailable or closed the connection.
122+ // This is not a fatal error and should not fail the agent execution.
123+ if errors .Is (err , io .EOF ) {
124+ slog .Debug (
125+ "MCP client unavailable (EOF), skipping MCP toolset" ,
126+ "server" , ts .logID ,
127+ )
128+ return nil
129+ }
130+
119131 slog .Error ("Failed to initialize MCP client" , "error" , err )
120132 return fmt .Errorf ("failed to initialize MCP client: %w" , err )
121133 }
You can’t perform that action at this time.
0 commit comments