diff --git a/packages/cli/src/commands/mcp/list.test.ts b/packages/cli/src/commands/mcp/list.test.ts index fed9fb6a5c..30d88af995 100644 --- a/packages/cli/src/commands/mcp/list.test.ts +++ b/packages/cli/src/commands/mcp/list.test.ts @@ -123,8 +123,13 @@ describe('mcp list command', () => { ...defaultMergedSettings, mcpServers: { 'stdio-server': { command: '/path/to/server', args: ['arg1'] }, - 'sse-server': { url: 'https://example.com/sse' }, + 'sse-server': { url: 'https://example.com/sse', type: 'sse' }, 'http-server': { httpUrl: 'https://example.com/http' }, + 'http-server-by-default': { url: 'https://example.com/http' }, + 'http-server-with-type': { + url: 'https://example.com/http', + type: 'http', + }, }, }, }); @@ -150,6 +155,16 @@ describe('mcp list command', () => { 'http-server: https://example.com/http (http) - Connected', ), ); + expect(debugLogger.log).toHaveBeenCalledWith( + expect.stringContaining( + 'http-server-by-default: https://example.com/http (http) - Connected', + ), + ); + expect(debugLogger.log).toHaveBeenCalledWith( + expect.stringContaining( + 'http-server-with-type: https://example.com/http (http) - Connected', + ), + ); }); it('should display disconnected status when connection fails', async () => { diff --git a/packages/cli/src/commands/mcp/list.ts b/packages/cli/src/commands/mcp/list.ts index 27a25fec4a..86fbbb9b1e 100644 --- a/packages/cli/src/commands/mcp/list.ts +++ b/packages/cli/src/commands/mcp/list.ts @@ -144,7 +144,8 @@ export async function listMcpServers(): Promise { if (server.httpUrl) { serverInfo += `${server.httpUrl} (http)`; } else if (server.url) { - serverInfo += `${server.url} (sse)`; + const type = server.type || 'http'; + serverInfo += `${server.url} (${type})`; } else if (server.command) { serverInfo += `${server.command} ${server.args?.join(' ') || ''} (stdio)`; }