@l4yercak3/cli 1.2.11 → 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 +33 -28
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,14 +255,29 @@ 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
|
|
@@ -286,7 +302,7 @@ module.exports = {
|
|
|
286
302
|
});
|
|
287
303
|
|
|
288
304
|
clientChoices.push({
|
|
289
|
-
name: 'VS Code
|
|
305
|
+
name: 'VS Code',
|
|
290
306
|
value: 'vscode'
|
|
291
307
|
});
|
|
292
308
|
|
|
@@ -485,40 +501,29 @@ function showClaudeDesktopManualInstructions() {
|
|
|
485
501
|
}
|
|
486
502
|
|
|
487
503
|
/**
|
|
488
|
-
* Show VS Code setup instructions
|
|
504
|
+
* Show VS Code setup instructions
|
|
489
505
|
*/
|
|
490
506
|
function showVSCodeInstructions() {
|
|
491
507
|
console.log(chalk.bold('🔧 VS Code MCP Setup\n'));
|
|
492
508
|
|
|
493
|
-
|
|
509
|
+
const cmdConfig = getClaudeDesktopCommand();
|
|
494
510
|
|
|
495
|
-
console.log(chalk.
|
|
496
|
-
console.log(chalk.gray(' 1. Install "Continue" extension from VS Code marketplace'));
|
|
497
|
-
console.log(chalk.gray(' 2. Open Continue settings (gear icon in Continue panel)'));
|
|
498
|
-
console.log(chalk.gray(' 3. Add to your config.json:\n'));
|
|
511
|
+
console.log(chalk.white(' VS Code supports MCP through various extensions.\n'));
|
|
499
512
|
|
|
500
|
-
|
|
501
|
-
console.log(chalk.cyan(' "experimental": {'));
|
|
502
|
-
console.log(chalk.cyan(' "modelContextProtocolServers": ['));
|
|
503
|
-
console.log(chalk.cyan(' {'));
|
|
504
|
-
console.log(chalk.cyan(' "name": "l4yercak3",'));
|
|
505
|
-
console.log(chalk.cyan(` "command": "${cmdConfig.command}",`));
|
|
506
|
-
console.log(chalk.cyan(` "args": ${JSON.stringify(cmdConfig.args)}`));
|
|
507
|
-
console.log(chalk.cyan(' }'));
|
|
508
|
-
console.log(chalk.cyan(' ]'));
|
|
509
|
-
console.log(chalk.cyan(' }'));
|
|
513
|
+
console.log(chalk.gray(' Add this MCP server configuration to your extension:'));
|
|
510
514
|
console.log('');
|
|
511
|
-
|
|
512
|
-
console.log(chalk.
|
|
513
|
-
console.log(chalk.
|
|
514
|
-
console.log(chalk.
|
|
515
|
-
console.log(chalk.
|
|
516
|
-
console.log(chalk.
|
|
517
|
-
console.log(chalk.cyan(
|
|
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(' }'));
|
|
518
523
|
console.log('');
|
|
519
524
|
|
|
520
|
-
console.log(chalk.gray('
|
|
521
|
-
console.log(chalk.gray(`
|
|
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}`));
|
|
522
527
|
console.log('');
|
|
523
528
|
}
|
|
524
529
|
|