@@ -5,23 +5,25 @@ import (
55 "context"
66 "fmt"
77
8+ "github.com/docker/cli/cli/command"
89 "gopkg.in/yaml.v3"
910
11+ "github.com/docker/mcp-gateway/cmd/docker-mcp/hints"
1012 "github.com/docker/mcp-gateway/pkg/catalog"
1113 "github.com/docker/mcp-gateway/pkg/config"
1214 "github.com/docker/mcp-gateway/pkg/docker"
1315 "github.com/docker/mcp-gateway/pkg/oauth"
1416)
1517
16- func Disable (ctx context.Context , docker docker.Client , serverNames []string , mcpOAuthDcrEnabled bool ) error {
17- return update (ctx , docker , nil , serverNames , mcpOAuthDcrEnabled )
18+ func Disable (ctx context.Context , docker docker.Client , dockerCli command. Cli , serverNames []string , mcpOAuthDcrEnabled bool ) error {
19+ return update (ctx , docker , dockerCli , nil , serverNames , mcpOAuthDcrEnabled )
1820}
1921
20- func Enable (ctx context.Context , docker docker.Client , serverNames []string , mcpOAuthDcrEnabled bool ) error {
21- return update (ctx , docker , serverNames , nil , mcpOAuthDcrEnabled )
22+ func Enable (ctx context.Context , docker docker.Client , dockerCli command. Cli , serverNames []string , mcpOAuthDcrEnabled bool ) error {
23+ return update (ctx , docker , dockerCli , serverNames , nil , mcpOAuthDcrEnabled )
2224}
2325
24- func update (ctx context.Context , docker docker.Client , add []string , remove []string , mcpOAuthDcrEnabled bool ) error {
26+ func update (ctx context.Context , docker docker.Client , dockerCli command. Cli , add []string , remove []string , mcpOAuthDcrEnabled bool ) error {
2527 // Read registry.yaml that contains which servers are enabled.
2628 registryYAML , err := config .ReadRegistry (ctx , docker )
2729 if err != nil {
@@ -94,5 +96,21 @@ func update(ctx context.Context, docker docker.Client, add []string, remove []st
9496 return fmt .Errorf ("writing registry config: %w" , err )
9597 }
9698
99+ if len (add ) > 0 && hints .Enabled (dockerCli ) {
100+ hints .TipCyan .Print ("Tip: " )
101+ hints .TipGreen .Print ("✓" )
102+ hints .TipCyan .Print (" Server enabled. To view all enabled servers, use " )
103+ hints .TipCyanBoldItalic .Println ("docker mcp server ls" )
104+ fmt .Println ()
105+ }
106+
107+ if len (remove ) > 0 && hints .Enabled (dockerCli ) {
108+ hints .TipCyan .Print ("Tip: " )
109+ hints .TipGreen .Print ("✓" )
110+ hints .TipCyan .Print (" Server disabled. To see remaining enabled servers, use " )
111+ hints .TipCyanBoldItalic .Println ("docker mcp server ls" )
112+ fmt .Println ()
113+ }
114+
97115 return nil
98116}
0 commit comments