@vibescope/mcp-server 0.2.7 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/setup.js +52 -22
  2. package/package.json +2 -3
  3. package/src/setup.ts +54 -21
package/dist/setup.js CHANGED
@@ -10,7 +10,7 @@ import { homedir, platform } from 'node:os';
10
10
  import { join, dirname } from 'node:path';
11
11
  import { exec } from 'node:child_process';
12
12
  const VIBESCOPE_SETTINGS_URL = 'https://vibescope.dev/dashboard/settings';
13
- const DEFAULT_SUPABASE_URL = 'https://uuneucmuubpgswvfijwd.supabase.co';
13
+ const VIBESCOPE_API_URL = 'https://vibescope.dev';
14
14
  // ============================================================================
15
15
  // Config Path Helpers
16
16
  // ============================================================================
@@ -134,18 +134,21 @@ function openBrowser(url) {
134
134
  }
135
135
  export async function validateApiKey(apiKey) {
136
136
  try {
137
- const response = await fetch(DEFAULT_SUPABASE_URL + '/rest/v1/api_keys?key=eq.' + apiKey + '&select=id', {
137
+ const response = await fetch(VIBESCOPE_API_URL + '/api/mcp/auth/validate', {
138
+ method: 'POST',
138
139
  headers: {
139
- 'apikey': apiKey,
140
- 'Authorization': 'Bearer ' + apiKey,
140
+ 'Content-Type': 'application/json',
141
+ 'X-API-Key': apiKey,
141
142
  },
143
+ body: JSON.stringify({ api_key: apiKey }),
142
144
  });
143
145
  if (response.ok) {
144
- return { valid: true, message: 'API key validated successfully!' };
145
- }
146
- else {
147
- return { valid: false, message: 'API key appears to be invalid.' };
146
+ const data = await response.json();
147
+ if (data.valid) {
148
+ return { valid: true, message: 'API key validated successfully!' };
149
+ }
148
150
  }
151
+ return { valid: false, message: 'API key appears to be invalid.' };
149
152
  }
150
153
  catch {
151
154
  return { valid: true, message: 'Could not validate API key (network issue), but proceeding.' };
@@ -239,23 +242,43 @@ export async function runSetup() {
239
242
  }
240
243
  }
241
244
  }
242
- // Step 4: Get API key
245
+ // Step 4: Get API key (with retry logic)
243
246
  console.log('\n--- Step 1: Get your API key ---\n');
244
247
  console.log('Opening Vibescope settings page in your browser...');
245
248
  console.log("Create an API key if you don't have one, then copy it.\n");
246
249
  await openBrowser(VIBESCOPE_SETTINGS_URL);
247
- const apiKey = await prompt('Paste your Vibescope API key: ');
248
- if (!apiKey) {
249
- console.error('\nError: API key is required.');
250
- process.exit(1);
251
- }
252
- // Validate API key
253
- console.log('\nValidating API key...');
254
- const validation = await validateApiKey(apiKey);
255
- console.log(validation.message);
256
- if (!validation.valid) {
257
- const proceed = await prompt('Proceed anyway? (y/N): ');
258
- if (proceed.toLowerCase() !== 'y') {
250
+ const MAX_ATTEMPTS = 3;
251
+ let apiKey = '';
252
+ let attempts = 0;
253
+ while (attempts < MAX_ATTEMPTS) {
254
+ attempts++;
255
+ const attemptsRemaining = MAX_ATTEMPTS - attempts;
256
+ apiKey = await prompt('Paste your Vibescope API key: ');
257
+ if (!apiKey) {
258
+ if (attemptsRemaining > 0) {
259
+ console.log('\nAPI key is required. Please try again. (' + attemptsRemaining + ' attempt' + (attemptsRemaining === 1 ? '' : 's') + ' remaining)\n');
260
+ continue;
261
+ }
262
+ else {
263
+ console.error('\nError: API key is required. Setup cancelled.');
264
+ process.exit(1);
265
+ }
266
+ }
267
+ // Validate API key
268
+ console.log('\nValidating API key...');
269
+ const validation = await validateApiKey(apiKey);
270
+ console.log(validation.message);
271
+ if (validation.valid) {
272
+ break; // Success - exit the retry loop
273
+ }
274
+ // Invalid key
275
+ if (attemptsRemaining > 0) {
276
+ console.log('\nPlease check your API key and try again. (' + attemptsRemaining + ' attempt' + (attemptsRemaining === 1 ? '' : 's') + ' remaining)\n');
277
+ }
278
+ else {
279
+ console.error('\nMaximum attempts reached. Please verify your API key at:');
280
+ console.error(' ' + VIBESCOPE_SETTINGS_URL);
281
+ console.error('\nSetup cancelled.');
259
282
  process.exit(1);
260
283
  }
261
284
  }
@@ -302,7 +325,14 @@ export async function runSetup() {
302
325
  console.log('Next steps:');
303
326
  console.log(' 1. Restart Gemini CLI');
304
327
  console.log(' 2. Verify connection: gemini mcp list');
305
- console.log(' 3. Start using Vibescope in your conversation');
328
+ console.log(' 3. In your conversation, call the MCP tool: start_work_session(git_url: "...", agent_type: "gemini")');
329
+ console.log('');
330
+ console.log('IMPORTANT: Vibescope tools are MCP tool calls, NOT CLI commands.');
331
+ console.log('Do NOT run "vibescope-cli start_work_session" - that command does not exist.');
332
+ console.log('');
333
+ console.log('NOTE: If you manually edit the config later, do NOT use $VAR_NAME syntax');
334
+ console.log('for environment variables - Gemini CLI has a bug where this does not work.');
335
+ console.log('Always hardcode API keys directly or use ~/.gemini/.env instead.');
306
336
  break;
307
337
  default:
308
338
  console.log('Next steps:');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibescope/mcp-server",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "MCP server for Vibescope - AI project tracking tools",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -46,7 +46,6 @@
46
46
  "vitest": "^4.0.17"
47
47
  },
48
48
  "dependencies": {
49
- "@modelcontextprotocol/sdk": "^1.25.2",
50
- "zod": "^3.25.0"
49
+ "@modelcontextprotocol/sdk": "^1.25.2"
51
50
  }
52
51
  }
package/src/setup.ts CHANGED
@@ -12,7 +12,7 @@ import { join, dirname } from 'node:path';
12
12
  import { exec } from 'node:child_process';
13
13
 
14
14
  const VIBESCOPE_SETTINGS_URL = 'https://vibescope.dev/dashboard/settings';
15
- const DEFAULT_SUPABASE_URL = 'https://uuneucmuubpgswvfijwd.supabase.co';
15
+ const VIBESCOPE_API_URL = 'https://vibescope.dev';
16
16
 
17
17
  // ============================================================================
18
18
  // Types
@@ -163,18 +163,23 @@ function openBrowser(url: string): Promise<void> {
163
163
 
164
164
  export async function validateApiKey(apiKey: string): Promise<{ valid: boolean; message: string }> {
165
165
  try {
166
- const response = await fetch(DEFAULT_SUPABASE_URL + '/rest/v1/api_keys?key=eq.' + apiKey + '&select=id', {
166
+ const response = await fetch(VIBESCOPE_API_URL + '/api/mcp/auth/validate', {
167
+ method: 'POST',
167
168
  headers: {
168
- 'apikey': apiKey,
169
- 'Authorization': 'Bearer ' + apiKey,
169
+ 'Content-Type': 'application/json',
170
+ 'X-API-Key': apiKey,
170
171
  },
172
+ body: JSON.stringify({ api_key: apiKey }),
171
173
  });
172
174
 
173
175
  if (response.ok) {
174
- return { valid: true, message: 'API key validated successfully!' };
175
- } else {
176
- return { valid: false, message: 'API key appears to be invalid.' };
176
+ const data = await response.json();
177
+ if (data.valid) {
178
+ return { valid: true, message: 'API key validated successfully!' };
179
+ }
177
180
  }
181
+
182
+ return { valid: false, message: 'API key appears to be invalid.' };
178
183
  } catch {
179
184
  return { valid: true, message: 'Could not validate API key (network issue), but proceeding.' };
180
185
  }
@@ -282,28 +287,49 @@ export async function runSetup(): Promise<void> {
282
287
  }
283
288
  }
284
289
 
285
- // Step 4: Get API key
290
+ // Step 4: Get API key (with retry logic)
286
291
  console.log('\n--- Step 1: Get your API key ---\n');
287
292
  console.log('Opening Vibescope settings page in your browser...');
288
293
  console.log("Create an API key if you don't have one, then copy it.\n");
289
294
 
290
295
  await openBrowser(VIBESCOPE_SETTINGS_URL);
291
296
 
292
- const apiKey = await prompt('Paste your Vibescope API key: ');
297
+ const MAX_ATTEMPTS = 3;
298
+ let apiKey = '';
299
+ let attempts = 0;
293
300
 
294
- if (!apiKey) {
295
- console.error('\nError: API key is required.');
296
- process.exit(1);
297
- }
301
+ while (attempts < MAX_ATTEMPTS) {
302
+ attempts++;
303
+ const attemptsRemaining = MAX_ATTEMPTS - attempts;
304
+
305
+ apiKey = await prompt('Paste your Vibescope API key: ');
306
+
307
+ if (!apiKey) {
308
+ if (attemptsRemaining > 0) {
309
+ console.log('\nAPI key is required. Please try again. (' + attemptsRemaining + ' attempt' + (attemptsRemaining === 1 ? '' : 's') + ' remaining)\n');
310
+ continue;
311
+ } else {
312
+ console.error('\nError: API key is required. Setup cancelled.');
313
+ process.exit(1);
314
+ }
315
+ }
316
+
317
+ // Validate API key
318
+ console.log('\nValidating API key...');
319
+ const validation = await validateApiKey(apiKey);
320
+ console.log(validation.message);
298
321
 
299
- // Validate API key
300
- console.log('\nValidating API key...');
301
- const validation = await validateApiKey(apiKey);
302
- console.log(validation.message);
322
+ if (validation.valid) {
323
+ break; // Success - exit the retry loop
324
+ }
303
325
 
304
- if (!validation.valid) {
305
- const proceed = await prompt('Proceed anyway? (y/N): ');
306
- if (proceed.toLowerCase() !== 'y') {
326
+ // Invalid key
327
+ if (attemptsRemaining > 0) {
328
+ console.log('\nPlease check your API key and try again. (' + attemptsRemaining + ' attempt' + (attemptsRemaining === 1 ? '' : 's') + ' remaining)\n');
329
+ } else {
330
+ console.error('\nMaximum attempts reached. Please verify your API key at:');
331
+ console.error(' ' + VIBESCOPE_SETTINGS_URL);
332
+ console.error('\nSetup cancelled.');
307
333
  process.exit(1);
308
334
  }
309
335
  }
@@ -358,7 +384,14 @@ export async function runSetup(): Promise<void> {
358
384
  console.log('Next steps:');
359
385
  console.log(' 1. Restart Gemini CLI');
360
386
  console.log(' 2. Verify connection: gemini mcp list');
361
- console.log(' 3. Start using Vibescope in your conversation');
387
+ console.log(' 3. In your conversation, call the MCP tool: start_work_session(git_url: "...", agent_type: "gemini")');
388
+ console.log('');
389
+ console.log('IMPORTANT: Vibescope tools are MCP tool calls, NOT CLI commands.');
390
+ console.log('Do NOT run "vibescope-cli start_work_session" - that command does not exist.');
391
+ console.log('');
392
+ console.log('NOTE: If you manually edit the config later, do NOT use $VAR_NAME syntax');
393
+ console.log('for environment variables - Gemini CLI has a bug where this does not work.');
394
+ console.log('Always hardcode API keys directly or use ~/.gemini/.env instead.');
362
395
  break;
363
396
  default:
364
397
  console.log('Next steps:');