@@ -10,6 +10,8 @@ import (
10
10
"slices"
11
11
"strings"
12
12
13
+ "github.com/AlecAivazis/survey/v2"
14
+
13
15
"github.com/DefangLabs/defang/src/pkg/term"
14
16
"github.com/DefangLabs/defang/src/pkg/track"
15
17
)
@@ -53,24 +55,18 @@ type MCPClient string
53
55
54
56
const (
55
57
MCPClientVSCode MCPClient = "vscode"
56
- MCPClientCode MCPClient = "code"
57
58
MCPClientVSCodeInsiders MCPClient = "vscode-insiders"
58
- MCPClientInsiders MCPClient = "code-insiders"
59
59
MCPClientClaudeDesktop MCPClient = "claude-desktop"
60
60
MCPClientClaudeCode MCPClient = "claude-code"
61
61
MCPClientWindsurf MCPClient = "windsurf"
62
- MCPClientCascade MCPClient = "cascade"
63
- MCPClientCodeium MCPClient = "codeium"
64
62
MCPClientCursor MCPClient = "cursor"
65
63
MCPClientKiro MCPClient = "kiro"
66
64
)
67
65
68
66
// ValidVSCodeClients is a list of supported VSCode MCP clients with shorthand names
69
67
var ValidVSCodeClients = []MCPClient {
70
68
MCPClientVSCode ,
71
- MCPClientCode ,
72
69
MCPClientVSCodeInsiders ,
73
- MCPClientInsiders ,
74
70
}
75
71
76
72
// ValidClients is a list of supported MCP clients
@@ -79,14 +75,13 @@ var ValidClients = append(
79
75
MCPClientClaudeDesktop ,
80
76
MCPClientClaudeCode ,
81
77
MCPClientWindsurf ,
82
- MCPClientCascade ,
83
- MCPClientCodeium ,
84
78
MCPClientCursor ,
85
79
MCPClientKiro ,
86
80
},
87
81
ValidVSCodeClients ... ,
88
82
)
89
83
84
+ // ParseMCPClient parses and validates the MCP client string
90
85
func ParseMCPClient (clientStr string ) (MCPClient , error ) {
91
86
clientStr = strings .ToLower (clientStr )
92
87
client := MCPClient (clientStr )
@@ -96,6 +91,29 @@ func ParseMCPClient(clientStr string) (MCPClient, error) {
96
91
return client , nil
97
92
}
98
93
94
+ // ValidClientStrings converts ValidClients to []string for survey options
95
+ func ValidClientStrings () []string {
96
+ strings := make ([]string , len (ValidClients ))
97
+ for i , client := range ValidClients {
98
+ strings [i ] = string (client )
99
+ }
100
+ return strings
101
+ }
102
+
103
+ // SelectMCPclients prompts the user to select one or more MCP clients
104
+ func SelectMCPclients () ([]string , error ) {
105
+ var clients []string
106
+ err := survey .AskOne (& survey.MultiSelect {
107
+ Message : "Choose a client(s):" ,
108
+ Options : ValidClientStrings (),
109
+ }, & clients )
110
+ if err != nil {
111
+ return nil , fmt .Errorf ("failed to select MCP client(s): %w" , err )
112
+ }
113
+
114
+ return clients , nil
115
+ }
116
+
99
117
// ClientInfo defines where each client stores its MCP configuration
100
118
type ClientInfo struct {
101
119
configFile string // Configuration file name
@@ -140,12 +158,8 @@ var kiroConfig = ClientInfo{
140
158
// clientRegistry maps client names to their configuration details
141
159
var clientRegistry = map [MCPClient ]ClientInfo {
142
160
MCPClientWindsurf : windsurfConfig ,
143
- MCPClientCascade : windsurfConfig ,
144
- MCPClientCodeium : windsurfConfig ,
145
161
MCPClientVSCode : vscodeConfig ,
146
- MCPClientCode : vscodeConfig ,
147
162
MCPClientVSCodeInsiders : codeInsidersConfig ,
148
- MCPClientInsiders : codeInsidersConfig ,
149
163
MCPClientClaudeDesktop : claudeDesktopConfig ,
150
164
MCPClientClaudeCode : claudeCodeConfig ,
151
165
MCPClientCursor : cursorConfig ,
0 commit comments