Skip to content

Commit 4e2076a

Browse files
authored
1 parent f6d3e50 commit 4e2076a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,10 @@ export class McpWorkbenchService extends Disposable implements IMcpWorkbenchServ
544544
if (!galleryServer) {
545545
throw new Error(`MCP server '${name}' not found in gallery`);
546546
}
547-
this.open(this.instantiationService.createInstance(McpWorkbenchServer, e => this.getInstallState(e), undefined, galleryServer, undefined));
547+
const local = this.local.find(e => e.name === name && e.local?.scope !== LocalMcpServerScope.Workspace)
548+
?? this.instantiationService.createInstance(McpWorkbenchServer, e => this.getInstallState(e), undefined, undefined, { name, config, inputs });
549+
local.gallery = galleryServer;
550+
this.open(local);
548551
} else {
549552
if (config.type === undefined) {
550553
(<Mutable<IMcpServerConfiguration>>config).type = (<IMcpStdioServerConfiguration>parsed).command ? McpServerType.LOCAL : McpServerType.REMOTE;

0 commit comments

Comments
 (0)