File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 11package command
22
33import (
4+ "context"
45 "fmt"
56 "os"
67 "path/filepath"
8+ "time"
79
810 agentTools "github.com/DefangLabs/defang/src/pkg/agent/tools"
911 cliClient "github.com/DefangLabs/defang/src/pkg/cli/client"
@@ -55,6 +57,20 @@ var mcpServerCmd = &cobra.Command{
5557 return fmt .Errorf ("failed to create MCP server: %w" , err )
5658 }
5759
60+ go func () {
61+ time .Sleep (3 * time .Second )
62+ ctx := context .Background ()
63+ term .Debug ("Sending MCP server notification to client" )
64+ params := map [string ]any {
65+ "level" : "info" ,
66+ "message" : "Processing started" ,
67+ }
68+ err := s .SendNotificationToClient (ctx , "notifications/logging/message" , params )
69+ if err != nil {
70+ term .Warnf ("Failed to send MCP server ready notification to client: %v" , err )
71+ }
72+ }()
73+
5874 // Start the server
5975 term .Println ("Starting Defang MCP server" )
6076 if err := server .ServeStdio (s ); err != nil {
You can’t perform that action at this time.
0 commit comments