@l4yercak3/cli 1.2.10 → 1.2.12
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/package.json +1 -1
- package/src/commands/mcp-setup.js +179 -3
package/package.json
CHANGED
|
@@ -14,6 +14,7 @@ const { execSync } = require('child_process');
|
|
|
14
14
|
const chalk = require('chalk');
|
|
15
15
|
const inquirer = require('inquirer');
|
|
16
16
|
const configManager = require('../config/config-manager');
|
|
17
|
+
const backendClient = require('../api/backend-client');
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Check if Claude CLI is installed
|
|
@@ -254,19 +255,33 @@ module.exports = {
|
|
|
254
255
|
|
|
255
256
|
// Check if logged in
|
|
256
257
|
const session = configManager.getSession();
|
|
257
|
-
if (!session) {
|
|
258
|
+
if (!session || !session.token) {
|
|
258
259
|
console.log(chalk.yellow('⚠️ Not logged in to L4YERCAK3'));
|
|
259
260
|
console.log(chalk.gray(' Run `l4yercak3 login` first to authenticate.\n'));
|
|
260
261
|
console.log(chalk.gray(' The MCP server needs your session to access L4YERCAK3 features.'));
|
|
261
262
|
process.exit(1);
|
|
262
263
|
}
|
|
263
264
|
|
|
264
|
-
|
|
265
|
+
// Validate session and get user info
|
|
266
|
+
let userEmail = session.email;
|
|
267
|
+
if (!userEmail) {
|
|
268
|
+
try {
|
|
269
|
+
const userInfo = await backendClient.validateSession();
|
|
270
|
+
if (userInfo && userInfo.email) {
|
|
271
|
+
userEmail = userInfo.email;
|
|
272
|
+
// Update stored session with email for future use
|
|
273
|
+
configManager.saveSession({ ...session, email: userEmail, userId: userInfo.userId });
|
|
274
|
+
}
|
|
275
|
+
} catch {
|
|
276
|
+
// Validation failed, continue without email display
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
console.log(chalk.green('✓ Logged in') + (userEmail ? chalk.gray(` as ${userEmail}`) : ''));
|
|
265
281
|
console.log('');
|
|
266
282
|
|
|
267
283
|
// Detect available clients
|
|
268
284
|
const hasClaudeCli = isClaudeInstalled();
|
|
269
|
-
const hasClaudeDesktop = hasClaudeDesktopConfig() || fs.existsSync(path.dirname(getClaudeDesktopConfigPath()));
|
|
270
285
|
|
|
271
286
|
// Build client choices
|
|
272
287
|
const clientChoices = [];
|
|
@@ -286,6 +301,26 @@ module.exports = {
|
|
|
286
301
|
configured: isClaudeDesktopConfigured()
|
|
287
302
|
});
|
|
288
303
|
|
|
304
|
+
clientChoices.push({
|
|
305
|
+
name: 'VS Code',
|
|
306
|
+
value: 'vscode'
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
clientChoices.push({
|
|
310
|
+
name: 'Cursor',
|
|
311
|
+
value: 'cursor'
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
clientChoices.push({
|
|
315
|
+
name: 'Windsurf',
|
|
316
|
+
value: 'windsurf'
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
clientChoices.push({
|
|
320
|
+
name: 'Zed',
|
|
321
|
+
value: 'zed'
|
|
322
|
+
});
|
|
323
|
+
|
|
289
324
|
clientChoices.push({
|
|
290
325
|
name: 'Other MCP client (show manual instructions)',
|
|
291
326
|
value: 'other'
|
|
@@ -307,6 +342,14 @@ module.exports = {
|
|
|
307
342
|
await setupClaudeCode();
|
|
308
343
|
} else if (client === 'claude-desktop') {
|
|
309
344
|
await setupClaudeDesktop();
|
|
345
|
+
} else if (client === 'vscode') {
|
|
346
|
+
showVSCodeInstructions();
|
|
347
|
+
} else if (client === 'cursor') {
|
|
348
|
+
showCursorInstructions();
|
|
349
|
+
} else if (client === 'windsurf') {
|
|
350
|
+
showWindsurfInstructions();
|
|
351
|
+
} else if (client === 'zed') {
|
|
352
|
+
showZedInstructions();
|
|
310
353
|
} else {
|
|
311
354
|
showOtherClientInstructions();
|
|
312
355
|
}
|
|
@@ -457,6 +500,139 @@ function showClaudeDesktopManualInstructions() {
|
|
|
457
500
|
console.log('');
|
|
458
501
|
}
|
|
459
502
|
|
|
503
|
+
/**
|
|
504
|
+
* Show VS Code setup instructions
|
|
505
|
+
*/
|
|
506
|
+
function showVSCodeInstructions() {
|
|
507
|
+
console.log(chalk.bold('🔧 VS Code MCP Setup\n'));
|
|
508
|
+
|
|
509
|
+
const cmdConfig = getClaudeDesktopCommand();
|
|
510
|
+
|
|
511
|
+
console.log(chalk.white(' VS Code supports MCP through various extensions.\n'));
|
|
512
|
+
|
|
513
|
+
console.log(chalk.gray(' Add this MCP server configuration to your extension:'));
|
|
514
|
+
console.log('');
|
|
515
|
+
console.log(chalk.cyan(' {'));
|
|
516
|
+
console.log(chalk.cyan(' "mcpServers": {'));
|
|
517
|
+
console.log(chalk.cyan(' "l4yercak3": {'));
|
|
518
|
+
console.log(chalk.cyan(` "command": "${cmdConfig.command}",`));
|
|
519
|
+
console.log(chalk.cyan(` "args": ${JSON.stringify(cmdConfig.args)}`));
|
|
520
|
+
console.log(chalk.cyan(' }'));
|
|
521
|
+
console.log(chalk.cyan(' }'));
|
|
522
|
+
console.log(chalk.cyan(' }'));
|
|
523
|
+
console.log('');
|
|
524
|
+
|
|
525
|
+
console.log(chalk.gray(' Check your extension\'s docs for where to add MCP servers.'));
|
|
526
|
+
console.log(chalk.gray(` Server command: ${cmdConfig.description}`));
|
|
527
|
+
console.log('');
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Show Cursor setup instructions
|
|
532
|
+
*/
|
|
533
|
+
function showCursorInstructions() {
|
|
534
|
+
console.log(chalk.bold('🔧 Cursor MCP Setup\n'));
|
|
535
|
+
|
|
536
|
+
console.log(chalk.white(' Cursor supports MCP servers through its settings.\n'));
|
|
537
|
+
|
|
538
|
+
const cmdConfig = getClaudeDesktopCommand();
|
|
539
|
+
const configPath = os.platform() === 'darwin'
|
|
540
|
+
? '~/.cursor/mcp.json'
|
|
541
|
+
: os.platform() === 'win32'
|
|
542
|
+
? '%APPDATA%\\Cursor\\mcp.json'
|
|
543
|
+
: '~/.config/cursor/mcp.json';
|
|
544
|
+
|
|
545
|
+
console.log(chalk.gray(` 1. Create or edit: ${configPath}`));
|
|
546
|
+
console.log(chalk.gray(' 2. Add the following configuration:\n'));
|
|
547
|
+
|
|
548
|
+
console.log(chalk.cyan(' {'));
|
|
549
|
+
console.log(chalk.cyan(' "mcpServers": {'));
|
|
550
|
+
console.log(chalk.cyan(' "l4yercak3": {'));
|
|
551
|
+
console.log(chalk.cyan(` "command": "${cmdConfig.command}",`));
|
|
552
|
+
console.log(chalk.cyan(` "args": ${JSON.stringify(cmdConfig.args)}`));
|
|
553
|
+
console.log(chalk.cyan(' }'));
|
|
554
|
+
console.log(chalk.cyan(' }'));
|
|
555
|
+
console.log(chalk.cyan(' }'));
|
|
556
|
+
console.log('');
|
|
557
|
+
|
|
558
|
+
console.log(chalk.gray(' 3. Restart Cursor for changes to take effect'));
|
|
559
|
+
console.log('');
|
|
560
|
+
|
|
561
|
+
console.log(chalk.yellow(' Note: Cursor\'s MCP support may vary by version.'));
|
|
562
|
+
console.log(chalk.gray(' Check Cursor documentation for the latest setup process.'));
|
|
563
|
+
console.log('');
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Show Windsurf setup instructions
|
|
568
|
+
*/
|
|
569
|
+
function showWindsurfInstructions() {
|
|
570
|
+
console.log(chalk.bold('🔧 Windsurf (Codeium) MCP Setup\n'));
|
|
571
|
+
|
|
572
|
+
console.log(chalk.white(' Windsurf supports MCP through Cascade.\n'));
|
|
573
|
+
|
|
574
|
+
const cmdConfig = getClaudeDesktopCommand();
|
|
575
|
+
const configPath = os.platform() === 'darwin'
|
|
576
|
+
? '~/.codeium/windsurf/mcp_config.json'
|
|
577
|
+
: os.platform() === 'win32'
|
|
578
|
+
? '%APPDATA%\\Codeium\\windsurf\\mcp_config.json'
|
|
579
|
+
: '~/.config/codeium/windsurf/mcp_config.json';
|
|
580
|
+
|
|
581
|
+
console.log(chalk.gray(` 1. Create or edit: ${configPath}`));
|
|
582
|
+
console.log(chalk.gray(' 2. Add the following configuration:\n'));
|
|
583
|
+
|
|
584
|
+
console.log(chalk.cyan(' {'));
|
|
585
|
+
console.log(chalk.cyan(' "mcpServers": {'));
|
|
586
|
+
console.log(chalk.cyan(' "l4yercak3": {'));
|
|
587
|
+
console.log(chalk.cyan(` "command": "${cmdConfig.command}",`));
|
|
588
|
+
console.log(chalk.cyan(` "args": ${JSON.stringify(cmdConfig.args)}`));
|
|
589
|
+
console.log(chalk.cyan(' }'));
|
|
590
|
+
console.log(chalk.cyan(' }'));
|
|
591
|
+
console.log(chalk.cyan(' }'));
|
|
592
|
+
console.log('');
|
|
593
|
+
|
|
594
|
+
console.log(chalk.gray(' 3. Restart Windsurf for changes to take effect'));
|
|
595
|
+
console.log('');
|
|
596
|
+
|
|
597
|
+
console.log(chalk.gray(' Once configured, you can use L4YERCAK3 tools through Cascade.'));
|
|
598
|
+
console.log('');
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Show Zed setup instructions
|
|
603
|
+
*/
|
|
604
|
+
function showZedInstructions() {
|
|
605
|
+
console.log(chalk.bold('🔧 Zed MCP Setup\n'));
|
|
606
|
+
|
|
607
|
+
console.log(chalk.white(' Zed supports MCP servers through its settings.\n'));
|
|
608
|
+
|
|
609
|
+
const cmdConfig = getClaudeDesktopCommand();
|
|
610
|
+
const configPath = os.platform() === 'darwin'
|
|
611
|
+
? '~/.config/zed/settings.json'
|
|
612
|
+
: '~/.config/zed/settings.json';
|
|
613
|
+
|
|
614
|
+
console.log(chalk.gray(` 1. Open Zed settings: ${configPath}`));
|
|
615
|
+
console.log(chalk.gray(' 2. Add or update the context_servers section:\n'));
|
|
616
|
+
|
|
617
|
+
console.log(chalk.cyan(' {'));
|
|
618
|
+
console.log(chalk.cyan(' "context_servers": {'));
|
|
619
|
+
console.log(chalk.cyan(' "l4yercak3": {'));
|
|
620
|
+
console.log(chalk.cyan(` "command": {`));
|
|
621
|
+
console.log(chalk.cyan(` "path": "${cmdConfig.command}",`));
|
|
622
|
+
console.log(chalk.cyan(` "args": ${JSON.stringify(cmdConfig.args)}`));
|
|
623
|
+
console.log(chalk.cyan(' }'));
|
|
624
|
+
console.log(chalk.cyan(' }'));
|
|
625
|
+
console.log(chalk.cyan(' }'));
|
|
626
|
+
console.log(chalk.cyan(' }'));
|
|
627
|
+
console.log('');
|
|
628
|
+
|
|
629
|
+
console.log(chalk.gray(' 3. Restart Zed or reload the configuration'));
|
|
630
|
+
console.log('');
|
|
631
|
+
|
|
632
|
+
console.log(chalk.gray(' See https://zed.dev/docs/context-servers for more details.'));
|
|
633
|
+
console.log('');
|
|
634
|
+
}
|
|
635
|
+
|
|
460
636
|
/**
|
|
461
637
|
* Show instructions for other MCP clients
|
|
462
638
|
*/
|