mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 21:03:05 -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,
|
...defaultMergedSettings,
|
||||||
mcpServers: {
|
mcpServers: {
|
||||||
'stdio-server': { command: '/path/to/server', args: ['arg1'] },
|
'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': { 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',
|
'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 () => {
|
it('should display disconnected status when connection fails', async () => {
|
||||||
|
|||||||
@@ -144,7 +144,8 @@ export async function listMcpServers(): Promise<void> {
|
|||||||
if (server.httpUrl) {
|
if (server.httpUrl) {
|
||||||
serverInfo += `${server.httpUrl} (http)`;
|
serverInfo += `${server.httpUrl} (http)`;
|
||||||
} else if (server.url) {
|
} else if (server.url) {
|
||||||
serverInfo += `${server.url} (sse)`;
|
const type = server.type || 'http';
|
||||||
|
serverInfo += `${server.url} (${type})`;
|
||||||
} else if (server.command) {
|
} else if (server.command) {
|
||||||
serverInfo += `${server.command} ${server.args?.join(' ') || ''} (stdio)`;
|
serverInfo += `${server.command} ${server.args?.join(' ') || ''} (stdio)`;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user