mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 22:21:22 -07:00
fix(cli): display 'http' type on mcp list (#16915)
Co-authored-by: Jack Wotherspoon <jackwoth@google.com>
This commit is contained in:
committed by
GitHub
parent
2455f939a3
commit
55c2783e6a
@@ -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 () => {
|
||||
|
||||
@@ -144,7 +144,8 @@ export async function listMcpServers(): Promise<void> {
|
||||
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)`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user