@@ -48,13 +48,15 @@ const (
48
48
49
49
// mcpClientConfig represents a configuration path for a supported MCP client.
50
50
type mcpClientConfig struct {
51
- ClientType MCPClient
52
- Description string
53
- RelPath []string
54
- SettingsFile string
55
- PlatformPrefix map [string ][]string
56
- MCPServersPathPrefix string
57
- Extension Extension
51
+ ClientType MCPClient
52
+ Description string
53
+ RelPath []string
54
+ SettingsFile string
55
+ PlatformPrefix map [string ][]string
56
+ MCPServersPathPrefix string
57
+ Extension Extension
58
+ SupportedTransportTypesMap map [types.TransportType ]string
59
+ IsTransportTypeFieldSupported bool
58
60
}
59
61
60
62
var supportedClientIntegrations = []mcpClientConfig {
@@ -72,6 +74,12 @@ var supportedClientIntegrations = []mcpClientConfig{
72
74
},
73
75
MCPServersPathPrefix : "/mcpServers" ,
74
76
Extension : JSON ,
77
+ SupportedTransportTypesMap : map [types.TransportType ]string {
78
+ types .TransportTypeStdio : "stdio" ,
79
+ types .TransportTypeSSE : "sse" ,
80
+ types .TransportTypeStreamableHTTP : "http" ,
81
+ },
82
+ IsTransportTypeFieldSupported : true ,
75
83
},
76
84
{
77
85
ClientType : Cline ,
@@ -87,6 +95,11 @@ var supportedClientIntegrations = []mcpClientConfig{
87
95
},
88
96
MCPServersPathPrefix : "/mcpServers" ,
89
97
Extension : JSON ,
98
+ SupportedTransportTypesMap : map [types.TransportType ]string {
99
+ types .TransportTypeSSE : "sse" ,
100
+ types .TransportTypeStdio : "stdio" ,
101
+ },
102
+ IsTransportTypeFieldSupported : false ,
90
103
},
91
104
{
92
105
ClientType : VSCodeInsider ,
@@ -102,6 +115,12 @@ var supportedClientIntegrations = []mcpClientConfig{
102
115
},
103
116
MCPServersPathPrefix : "/mcp/servers" ,
104
117
Extension : JSON ,
118
+ SupportedTransportTypesMap : map [types.TransportType ]string {
119
+ types .TransportTypeStdio : "stdio" ,
120
+ types .TransportTypeSSE : "sse" ,
121
+ types .TransportTypeStreamableHTTP : "http" ,
122
+ },
123
+ IsTransportTypeFieldSupported : true ,
105
124
},
106
125
{
107
126
ClientType : VSCode ,
@@ -117,6 +136,12 @@ var supportedClientIntegrations = []mcpClientConfig{
117
136
"windows" : {"AppData" , "Roaming" },
118
137
},
119
138
Extension : JSON ,
139
+ SupportedTransportTypesMap : map [types.TransportType ]string {
140
+ types .TransportTypeStdio : "stdio" ,
141
+ types .TransportTypeSSE : "sse" ,
142
+ types .TransportTypeStreamableHTTP : "http" ,
143
+ },
144
+ IsTransportTypeFieldSupported : true ,
120
145
},
121
146
{
122
147
ClientType : Cursor ,
@@ -125,6 +150,14 @@ var supportedClientIntegrations = []mcpClientConfig{
125
150
MCPServersPathPrefix : "/mcpServers" ,
126
151
RelPath : []string {".cursor" },
127
152
Extension : JSON ,
153
+ SupportedTransportTypesMap : map [types.TransportType ]string {
154
+ types .TransportTypeStdio : "stdio" ,
155
+ types .TransportTypeSSE : "sse" ,
156
+ types .TransportTypeStreamableHTTP : "http" ,
157
+ },
158
+ // Adding type field is not explicitly required though, Cursor auto-detects and is able to
159
+ // connect to both sse and streamable-http types
160
+ IsTransportTypeFieldSupported : true ,
128
161
},
129
162
{
130
163
ClientType : ClaudeCode ,
@@ -133,6 +166,12 @@ var supportedClientIntegrations = []mcpClientConfig{
133
166
MCPServersPathPrefix : "/mcpServers" ,
134
167
RelPath : []string {},
135
168
Extension : JSON ,
169
+ SupportedTransportTypesMap : map [types.TransportType ]string {
170
+ types .TransportTypeStdio : "stdio" ,
171
+ types .TransportTypeSSE : "sse" ,
172
+ types .TransportTypeStreamableHTTP : "http" ,
173
+ },
174
+ IsTransportTypeFieldSupported : true ,
136
175
},
137
176
}
138
177
@@ -200,12 +239,18 @@ func FindClientConfigs() ([]ConfigFile, error) {
200
239
// for a `type` field, but Cursor and others do not. This allows us to
201
240
// build up more complex MCP server configurations for different clients
202
241
// without leaking them into the CMD layer.
203
- func Upsert (cf ConfigFile , name string , url string ) error {
204
- if cf .ClientType == VSCode || cf .ClientType == VSCodeInsider || cf .ClientType == ClaudeCode {
205
- return cf .ConfigUpdater .Upsert (name , MCPServer {Url : url , Type : "sse" })
242
+ func Upsert (cf ConfigFile , name string , url string , transportType string ) error {
243
+ for i := range supportedClientIntegrations {
244
+ if cf .ClientType != supportedClientIntegrations [i ].ClientType {
245
+ continue
246
+ }
247
+ mappedTransportType , ok := supportedClientIntegrations [i ].SupportedTransportTypesMap [types .TransportType (transportType )]
248
+ if supportedClientIntegrations [i ].IsTransportTypeFieldSupported && ok {
249
+ return cf .ConfigUpdater .Upsert (name , MCPServer {Url : url , Type : mappedTransportType })
250
+ }
251
+ return cf .ConfigUpdater .Upsert (name , MCPServer {Url : url })
206
252
}
207
-
208
- return cf .ConfigUpdater .Upsert (name , MCPServer {Url : url })
253
+ return nil
209
254
}
210
255
211
256
// GenerateMCPServerURL generates the URL for an MCP server
0 commit comments