@rvry/mcp 0.4.2 → 0.4.3
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.
- package/dist/setup.js +77 -1
- package/package.json +1 -1
package/dist/setup.js
CHANGED
|
@@ -346,6 +346,32 @@ function configureTomlMcp(configPath, token) {
|
|
|
346
346
|
return 'error';
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
+
function isGeminiCLIAvailable() {
|
|
350
|
+
try {
|
|
351
|
+
const cmd = platform() === 'win32' ? 'where gemini' : 'which gemini';
|
|
352
|
+
execSync(cmd, { stdio: 'pipe' });
|
|
353
|
+
return true;
|
|
354
|
+
}
|
|
355
|
+
catch { /* not on PATH */ }
|
|
356
|
+
if (existsSync(join(homedir(), '.gemini', 'settings.json')))
|
|
357
|
+
return true;
|
|
358
|
+
return false;
|
|
359
|
+
}
|
|
360
|
+
function registerGeminiCLI(token) {
|
|
361
|
+
try {
|
|
362
|
+
// Remove existing entry first (silent fail if not registered)
|
|
363
|
+
try {
|
|
364
|
+
execSync('gemini mcp remove rvry', { stdio: 'pipe' });
|
|
365
|
+
}
|
|
366
|
+
catch { /* not registered */ }
|
|
367
|
+
execSync(`gemini mcp add rvry -e RVRY_TOKEN="${token}" --scope user npx -y @rvry/mcp`, { stdio: 'inherit' });
|
|
368
|
+
return 'ok';
|
|
369
|
+
}
|
|
370
|
+
catch {
|
|
371
|
+
// Fallback: write settings.json directly
|
|
372
|
+
return configureJsonMcp(join(homedir(), '.gemini', 'settings.json'), token);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
349
375
|
function isCodexAvailable() {
|
|
350
376
|
try {
|
|
351
377
|
const cmd = platform() === 'win32' ? 'where codex' : 'which codex';
|
|
@@ -377,6 +403,7 @@ const CLIENT_REGISTRY = [
|
|
|
377
403
|
{
|
|
378
404
|
name: 'Anti-Gravity',
|
|
379
405
|
id: 'antigravity',
|
|
406
|
+
defaultSelected: false,
|
|
380
407
|
detect: () => {
|
|
381
408
|
// OR-logic: binary (agy or antigravity), config dir, or macOS app bundle
|
|
382
409
|
try {
|
|
@@ -401,9 +428,58 @@ const CLIENT_REGISTRY = [
|
|
|
401
428
|
configure: (token) => configureJsonMcp(join(homedir(), '.gemini', 'antigravity', 'mcp_config.json'), token),
|
|
402
429
|
notInstalledHint: 'Not installed (https://antigravity.google)',
|
|
403
430
|
},
|
|
431
|
+
{
|
|
432
|
+
name: 'Cursor',
|
|
433
|
+
id: 'cursor',
|
|
434
|
+
defaultSelected: false,
|
|
435
|
+
detect: () => {
|
|
436
|
+
if (platform() === 'darwin' && existsSync('/Applications/Cursor.app'))
|
|
437
|
+
return true;
|
|
438
|
+
if (existsSync(join(homedir(), '.cursor', 'mcp.json')))
|
|
439
|
+
return true;
|
|
440
|
+
try {
|
|
441
|
+
const cmd = platform() === 'win32' ? 'where cursor' : 'which cursor';
|
|
442
|
+
execSync(cmd, { stdio: 'pipe' });
|
|
443
|
+
return true;
|
|
444
|
+
}
|
|
445
|
+
catch { /* not on PATH */ }
|
|
446
|
+
return false;
|
|
447
|
+
},
|
|
448
|
+
configure: (token) => configureJsonMcp(join(homedir(), '.cursor', 'mcp.json'), token),
|
|
449
|
+
notInstalledHint: 'Not installed (https://cursor.com)',
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
name: 'Gemini CLI',
|
|
453
|
+
id: 'gemini',
|
|
454
|
+
defaultSelected: false,
|
|
455
|
+
detect: isGeminiCLIAvailable,
|
|
456
|
+
configure: registerGeminiCLI,
|
|
457
|
+
notInstalledHint: 'Not installed (https://github.com/google-gemini/gemini-cli)',
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
name: 'Windsurf',
|
|
461
|
+
id: 'windsurf',
|
|
462
|
+
defaultSelected: false,
|
|
463
|
+
detect: () => {
|
|
464
|
+
if (platform() === 'darwin' && existsSync('/Applications/Windsurf.app'))
|
|
465
|
+
return true;
|
|
466
|
+
if (existsSync(join(homedir(), '.codeium', 'windsurf', 'mcp_config.json')))
|
|
467
|
+
return true;
|
|
468
|
+
try {
|
|
469
|
+
const cmd = platform() === 'win32' ? 'where windsurf' : 'which windsurf';
|
|
470
|
+
execSync(cmd, { stdio: 'pipe' });
|
|
471
|
+
return true;
|
|
472
|
+
}
|
|
473
|
+
catch { /* not on PATH */ }
|
|
474
|
+
return false;
|
|
475
|
+
},
|
|
476
|
+
configure: (token) => configureJsonMcp(join(homedir(), '.codeium', 'windsurf', 'mcp_config.json'), token),
|
|
477
|
+
notInstalledHint: 'Not installed (https://windsurf.com)',
|
|
478
|
+
},
|
|
404
479
|
{
|
|
405
480
|
name: 'Codex',
|
|
406
481
|
id: 'codex',
|
|
482
|
+
defaultSelected: false,
|
|
407
483
|
detect: isCodexAvailable,
|
|
408
484
|
configure: (token) => configureTomlMcp(join(homedir(), '.codex', 'config.toml'), token),
|
|
409
485
|
notInstalledHint: 'Not installed (https://openai.com/codex)',
|
|
@@ -838,7 +914,7 @@ export async function runSetup() {
|
|
|
838
914
|
console.log('');
|
|
839
915
|
const pickerItems = detected.map((d) => ({
|
|
840
916
|
label: d.client.name,
|
|
841
|
-
selected: d.available
|
|
917
|
+
selected: d.available && (d.client.defaultSelected !== false),
|
|
842
918
|
available: d.available,
|
|
843
919
|
hint: d.available ? undefined : d.client.notInstalledHint,
|
|
844
920
|
}));
|