mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
mcp: make discovery good
- There's an mcpDiscoveryRegistry that allows components to register in how they discover MCP servers. - Config discovery is one of these. Figured out all the bits for a standalone file config shebang. Duplication there that could be cleaned up but it works. - The others are remote and local filesystem discovery. I ended up making another message channel for the main process/remote server to get a couple environment variables we need since I didn't see anything generic for this already(?) 
This commit is contained in:
@@ -118,6 +118,8 @@ import { IAuxiliaryWindowsMainService } from '../../platform/auxiliaryWindow/ele
|
||||
import { AuxiliaryWindowsMainService } from '../../platform/auxiliaryWindow/electron-main/auxiliaryWindowsMainService.js';
|
||||
import { normalizeNFC } from '../../base/common/normalization.js';
|
||||
import { ICSSDevelopmentService, CSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js';
|
||||
import { NativeMcpDiscoveryHelperChannelName } from '../../platform/mcp/common/nativeMcpDiscoveryHelper.js';
|
||||
import { NativeMcpDiscoveryHelperChannel } from '../../platform/mcp/node/nativeMcpDiscoveryHelperChannel.js';
|
||||
|
||||
/**
|
||||
* The main VS Code application. There will only ever be one instance,
|
||||
@@ -1222,6 +1224,9 @@ export class CodeApplication extends Disposable {
|
||||
const externalTerminalChannel = ProxyChannel.fromService(accessor.get(IExternalTerminalMainService), disposables);
|
||||
mainProcessElectronServer.registerChannel('externalTerminal', externalTerminalChannel);
|
||||
|
||||
// MCP
|
||||
mainProcessElectronServer.registerChannel(NativeMcpDiscoveryHelperChannelName, new NativeMcpDiscoveryHelperChannel(undefined));
|
||||
|
||||
// Logger
|
||||
const loggerChannel = new LoggerChannel(accessor.get(ILoggerMainService),);
|
||||
mainProcessElectronServer.registerChannel('logger', loggerChannel);
|
||||
|
||||
Reference in New Issue
Block a user