Skip to content

Commit 370bf16

Browse files
authored
🐛 fix: slove the descktop use offical endpoint mcp not use stdio (#11813)
fix: slove the descktop use offical endpoint mcp not use stdio
1 parent d638a24 commit 370bf16

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

src/store/tool/slices/mcpStore/action.ts

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -293,17 +293,14 @@ export const createMCPPluginStoreSlice: StateCreator<
293293
(!option?.connection?.type && !option?.connection?.url),
294294
);
295295

296-
const hasNonHttpDeployment = deploymentOptions.some((option) => {
297-
const type = option?.connection?.type;
298-
if (!type && option?.connection?.url) return false;
296+
// Check if cloudEndPoint is available: stdio type + haveCloudEndpoint exists
297+
// Both desktop and web should use cloud endpoint if available
298+
const hasCloudEndpoint = stdioOption && haveCloudEndpoint;
299299

300-
return type && type !== 'http';
301-
});
302-
303-
// Check if cloudEndPoint is available: web + stdio type + haveCloudEndpoint exists
304-
const hasCloudEndpoint = !isDesktop && stdioOption && haveCloudEndpoint;
305-
306-
let shouldUseHttpDeployment = !!httpOption && (!hasNonHttpDeployment || !isDesktop);
300+
// Prioritize endpoint (http/cloud) over stdio in all environments
301+
// Desktop: endpoint > stdio
302+
// Web: endpoint only (stdio not supported)
303+
let shouldUseHttpDeployment = !!httpOption;
307304

308305
if (hasCloudEndpoint) {
309306
// Use cloudEndPoint, create cloud type connection
@@ -664,10 +661,10 @@ export const createMCPPluginStoreSlice: StateCreator<
664661
errorLog,
665662
params: connection
666663
? {
667-
args: connection.args,
668-
command: connection.command,
669-
type: connection.type,
670-
}
664+
args: connection.args,
665+
command: connection.command,
666+
type: connection.type,
667+
}
671668
: undefined,
672669
step: 'installation_error',
673670
timestamp: Date.now(),

0 commit comments

Comments
 (0)