Skip to content

Commit 2b8fe7d

Browse files
authored
chore: skip mcp on eu cloud region for now (#52)
1 parent 8a8f57b commit 2b8fe7d

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

src/mcp.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
removeMCPServerFromClientsStep,
55
} from './steps/add-mcp-server-to-clients';
66
import clack from './utils/clack';
7-
import { abort, askForCloudRegion } from './utils/clack-utils';
7+
import { abort } from './utils/clack-utils';
88
import type { CloudRegion } from './utils/types';
99
import opn from 'opn';
1010
import { getCloudUrlFromRegion } from './utils/urls';
@@ -50,11 +50,9 @@ export const runMCPRemove = async () => {
5050
};
5151

5252
export const getPersonalApiKey = async (options: {
53-
region?: CloudRegion;
53+
cloudRegion: CloudRegion;
5454
}): Promise<string> => {
55-
const cloudRegion = options.region ?? (await askForCloudRegion());
56-
57-
const cloudUrl = getCloudUrlFromRegion(cloudRegion);
55+
const cloudUrl = getCloudUrlFromRegion(options.cloudRegion);
5856

5957
const urlToOpen = `${cloudUrl}/settings/user-api-keys?preset=mcp_server`;
6058

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import type { Integration } from '../../lib/constants';
22
import { traceStep } from '../../telemetry';
33
import { analytics } from '../../utils/analytics';
44
import clack from '../../utils/clack';
5-
import { abort, abortIfCancelled } from '../../utils/clack-utils';
5+
import {
6+
abort,
7+
abortIfCancelled,
8+
askForCloudRegion,
9+
} from '../../utils/clack-utils';
610
import { MCPClient } from './MCPClient';
711
import { CursorMCPClient } from './clients/cursor';
812
import { ClaudeMCPClient } from './clients/claude';
@@ -24,6 +28,17 @@ export const addMCPServerToClientsStep = async ({
2428
cloudRegion?: CloudRegion;
2529
askPermission?: boolean;
2630
}): Promise<string[]> => {
31+
const region = cloudRegion ?? (await askForCloudRegion());
32+
33+
if (region === 'eu') {
34+
if (!askPermission) {
35+
await abort(
36+
'The MCP server is not available in the EU region. It is coming soon!',
37+
);
38+
}
39+
return [];
40+
}
41+
2742
const hasPermission = askPermission
2843
? await abortIfCancelled(
2944
clack.select({
@@ -83,7 +98,7 @@ export const addMCPServerToClientsStep = async ({
8398
clack.log.info('Removed existing installation.');
8499
}
85100

86-
const personalApiKey = await getPersonalApiKey({ region: cloudRegion });
101+
const personalApiKey = await getPersonalApiKey({ cloudRegion: region });
87102

88103
await traceStep('adding mcp servers', async () => {
89104
await addMCPServer(clients, personalApiKey);

0 commit comments

Comments
 (0)