55 "context"
66 "fmt"
77
8+ "github.com/docker/cli/cli/command"
89 "gopkg.in/yaml.v3"
910
1011 "github.com/docker/mcp-gateway/cmd/docker-mcp/hints"
@@ -14,15 +15,15 @@ import (
1415 "github.com/docker/mcp-gateway/pkg/oauth"
1516)
1617
17- func Disable (ctx context.Context , docker docker.Client , serverNames []string , mcpOAuthDcrEnabled bool ) error {
18- 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 )
1920}
2021
21- func Enable (ctx context.Context , docker docker.Client , serverNames []string , mcpOAuthDcrEnabled bool ) error {
22- 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 )
2324}
2425
25- 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 {
2627 // Read registry.yaml that contains which servers are enabled.
2728 registryYAML , err := config .ReadRegistry (ctx , docker )
2829 if err != nil {
@@ -95,15 +96,15 @@ func update(ctx context.Context, docker docker.Client, add []string, remove []st
9596 return fmt .Errorf ("writing registry config: %w" , err )
9697 }
9798
98- if len (add ) > 0 && hints .Enabled () {
99+ if len (add ) > 0 && hints .Enabled (dockerCli ) {
99100 hints .TipCyan .Print ("Tip: " )
100101 hints .TipGreen .Print ("✓" )
101102 hints .TipCyan .Print (" Server enabled. To view all enabled servers, use " )
102103 hints .TipCyanBoldItalic .Println ("docker mcp server ls" )
103104 fmt .Println ()
104105 }
105106
106- if len (remove ) > 0 && hints .Enabled () {
107+ if len (remove ) > 0 && hints .Enabled (dockerCli ) {
107108 hints .TipCyan .Print ("Tip: " )
108109 hints .TipGreen .Print ("✓" )
109110 hints .TipCyan .Print (" Server disabled. To see remaining enabled servers, use " )
0 commit comments