Skip to content

Commit 60a96b1

Browse files
authored
fix: supported client detection (#68)
1 parent 0cf257d commit 60a96b1

File tree

1 file changed

+13
-6
lines changed
  • src/steps/add-mcp-server-to-clients

1 file changed

+13
-6
lines changed

src/steps/add-mcp-server-to-clients/index.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,17 @@ import { ClaudeMCPClient } from './clients/claude';
1313
import { getPersonalApiKey } from '../../mcp';
1414
import type { CloudRegion } from '../../utils/types';
1515

16-
export const getSupportedClients = (): MCPClient[] => {
17-
return [new CursorMCPClient(), new ClaudeMCPClient()].filter((client) =>
18-
client.isClientSupported(),
19-
);
16+
export const getSupportedClients = async (): Promise<MCPClient[]> => {
17+
const allClients = [new CursorMCPClient(), new ClaudeMCPClient()];
18+
const supportedClients: MCPClient[] = [];
19+
20+
for (const client of allClients) {
21+
if (await client.isClientSupported()) {
22+
supportedClients.push(client);
23+
}
24+
}
25+
26+
return supportedClients;
2027
};
2128

2229
export const addMCPServerToClientsStep = async ({
@@ -57,7 +64,7 @@ export const addMCPServerToClientsStep = async ({
5764
return [];
5865
}
5966

60-
const clients = getSupportedClients();
67+
const clients = await getSupportedClients();
6168

6269
const installedClients = await getInstalledClients();
6370

@@ -182,7 +189,7 @@ export const removeMCPServerFromClientsStep = async ({
182189
};
183190

184191
export const getInstalledClients = async (): Promise<MCPClient[]> => {
185-
const clients = getSupportedClients();
192+
const clients = await getSupportedClients();
186193

187194
const installedClients: MCPClient[] = [];
188195

0 commit comments

Comments
 (0)