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

View File

@@ -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;

View File

@@ -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 {