mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-05 02:40:55 -07:00
Extensions MCP refactor (#12413)
This commit is contained in:
@@ -159,8 +159,10 @@ describe('McpPromptLoader', () => {
|
||||
|
||||
describe('loadCommands', () => {
|
||||
const mockConfigWithPrompts = {
|
||||
getMcpServers: () => ({
|
||||
'test-server': { httpUrl: 'https://test-server.com' },
|
||||
getMcpClientManager: () => ({
|
||||
getMcpServers: () => ({
|
||||
'test-server': { httpUrl: 'https://test-server.com' },
|
||||
}),
|
||||
}),
|
||||
} as unknown as Config;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ export class McpPromptLoader implements ICommandLoader {
|
||||
if (!this.config) {
|
||||
return Promise.resolve([]);
|
||||
}
|
||||
const mcpServers = this.config.getMcpServers() || {};
|
||||
const mcpServers = this.config.getMcpClientManager()?.getMcpServers() || {};
|
||||
for (const serverName in mcpServers) {
|
||||
const prompts = getMCPServerPrompts(this.config, serverName) || [];
|
||||
for (const prompt of prompts) {
|
||||
@@ -101,7 +101,8 @@ export class McpPromptLoader implements ICommandLoader {
|
||||
}
|
||||
|
||||
try {
|
||||
const mcpServers = this.config.getMcpServers() || {};
|
||||
const mcpServers =
|
||||
this.config.getMcpClientManager()?.getMcpServers() || {};
|
||||
const mcpServerConfig = mcpServers[serverName];
|
||||
if (!mcpServerConfig) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user