Extensions MCP refactor (#12413)

This commit is contained in:
Jacob MacDonald
2025-11-04 07:51:18 -08:00
committed by GitHub
parent 2b77c1ded4
commit da4fa5ad75
28 changed files with 877 additions and 478 deletions
+10 -5
View File
@@ -192,11 +192,9 @@ describe('loggers', () => {
getFileFilteringRespectGitIgnore: () => true,
getFileFilteringAllowBuildArtifacts: () => false,
getDebugMode: () => true,
getMcpServers: () => ({
'test-server': {
command: 'test-command',
},
}),
getMcpServers: () => {
throw new Error('Should not call');
},
getQuestion: () => 'test-question',
getTargetDir: () => 'target-dir',
getProxy: () => 'http://test.proxy.com:8080',
@@ -206,6 +204,13 @@ describe('loggers', () => {
{ name: 'ext-one', id: 'id-one' },
{ name: 'ext-two', id: 'id-two' },
] as GeminiCLIExtension[],
getMcpClientManager: () => ({
getMcpServers: () => ({
'test-server': {
command: 'test-command',
},
}),
}),
} as unknown as Config;
const startSessionEvent = new StartSessionEvent(mockConfig);
+2 -1
View File
@@ -74,7 +74,8 @@ export class StartSessionEvent implements BaseTelemetryEvent {
constructor(config: Config, toolRegistry?: ToolRegistry) {
const generatorConfig = config.getContentGeneratorConfig();
const mcpServers = config.getMcpServers();
const mcpServers =
config.getMcpClientManager()?.getMcpServers() ?? config.getMcpServers();
let useGemini = false;
let useVertex = false;