@i18n-agent/mcp-client 1.8.8 โ†’ 1.8.10

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 (2) hide show
  1. package/install.js +43 -42
  2. package/package.json +2 -4
package/install.js CHANGED
@@ -198,6 +198,7 @@ exec node "${mcpClientPath}"`;
198
198
  function updateClaudeConfig(configPath, ideKey = 'claude') {
199
199
  let config = {};
200
200
  let existingApiKey = "";
201
+ let hasApiKey = false;
201
202
 
202
203
  // Read existing config if it exists
203
204
  if (fs.existsSync(configPath)) {
@@ -208,6 +209,7 @@ function updateClaudeConfig(configPath, ideKey = 'claude') {
208
209
  // Preserve existing API key if present
209
210
  if (config.mcpServers?.["i18n-agent"]?.env?.API_KEY) {
210
211
  existingApiKey = config.mcpServers["i18n-agent"].env.API_KEY;
212
+ hasApiKey = !!existingApiKey;
211
213
  console.log(' ๐Ÿ”‘ Preserving existing API key');
212
214
  }
213
215
  } catch (error) {
@@ -271,12 +273,13 @@ function updateClaudeConfig(configPath, ideKey = 'claude') {
271
273
  fs.mkdirSync(path.dirname(configPath), { recursive: true });
272
274
  fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
273
275
 
274
- return config;
276
+ return { config, hasApiKey };
275
277
  }
276
278
 
277
279
  function updateGenericMCPConfig(configPath) {
278
280
  let config = {};
279
281
  let existingApiKey = "";
282
+ let hasApiKey = false;
280
283
 
281
284
  if (fs.existsSync(configPath)) {
282
285
  try {
@@ -286,6 +289,7 @@ function updateGenericMCPConfig(configPath) {
286
289
  // Preserve existing API key if present
287
290
  if (config.mcpServers?.["i18n-agent"]?.env?.API_KEY) {
288
291
  existingApiKey = config.mcpServers["i18n-agent"].env.API_KEY;
292
+ hasApiKey = !!existingApiKey;
289
293
  console.log(' ๐Ÿ”‘ Preserving existing API key');
290
294
  }
291
295
  } catch (error) {
@@ -324,7 +328,7 @@ function updateGenericMCPConfig(configPath) {
324
328
  fs.mkdirSync(path.dirname(configPath), { recursive: true });
325
329
  fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
326
330
 
327
- return config;
331
+ return { config, hasApiKey };
328
332
  }
329
333
 
330
334
  function updateClaudeJsonConfig(configPath) {
@@ -424,13 +428,16 @@ For manual setup instructions, visit: https://docs.i18nagent.ai/setup
424
428
 
425
429
  let installCount = 0;
426
430
  const installedIDEs = [];
431
+ const idesWithApiKey = [];
432
+ const idesNeedingApiKey = [];
427
433
 
428
434
  for (const ide of availableIDEs) {
429
435
  try {
430
436
  console.log(`โš™๏ธ Configuring ${ide.name}...`);
431
437
 
438
+ let result;
432
439
  if (ide.key === 'claude' || ide.key === 'claude-code') {
433
- updateClaudeConfig(ide.configPath, ide.key);
440
+ result = updateClaudeConfig(ide.configPath, ide.key);
434
441
 
435
442
  // Claude Code CLI also needs ~/.claude.json updated (source of truth)
436
443
  if (ide.key === 'claude-code') {
@@ -441,7 +448,7 @@ For manual setup instructions, visit: https://docs.i18nagent.ai/setup
441
448
  }
442
449
  }
443
450
  } else {
444
- updateGenericMCPConfig(ide.configPath);
451
+ result = updateGenericMCPConfig(ide.configPath);
445
452
  }
446
453
 
447
454
  console.log(`โœ… ${ide.name} configured successfully!`);
@@ -449,47 +456,47 @@ For manual setup instructions, visit: https://docs.i18nagent.ai/setup
449
456
  installCount++;
450
457
  installedIDEs.push(ide);
451
458
 
459
+ // Track API key status
460
+ if (result && result.hasApiKey) {
461
+ idesWithApiKey.push(ide);
462
+ } else {
463
+ idesNeedingApiKey.push(ide);
464
+ }
465
+
452
466
  } catch (error) {
453
467
  console.error(`โŒ Failed to configure ${ide.name}: ${error.message}\n`);
454
468
  }
455
469
  }
456
470
 
457
471
  if (installCount > 0) {
458
- // Show config file paths for ONLY installed IDEs
459
- const configPaths = installedIDEs.map(ide => ` - ${ide.name}: ${ide.displayPath}`).join('\n');
460
-
461
- // Platform-specific environment variable instructions
462
- const isWindows = process.platform === 'win32';
463
- const envVarInstructions = isWindows
464
- ? ` Windows PowerShell:
465
- $env:API_KEY="your-api-key-here"
466
-
467
- Or set permanently via System Environment Variables:
468
- 1. Search "Environment Variables" in Windows
469
- 2. Click "New" under User variables
470
- 3. Variable name: API_KEY
471
- 4. Variable value: your-api-key-here`
472
- : ` macOS/Linux:
473
- export API_KEY=your-api-key-here
474
-
475
- Add to shell profile for persistence (~/.bashrc, ~/.zshrc):
476
- echo 'export API_KEY=your-api-key-here' >> ~/.zshrc`;
472
+ console.log(`๐ŸŽ‰ Installation complete! Configured ${installCount} IDE(s).\n`);
473
+
474
+ // Show API key status
475
+ if (idesWithApiKey.length > 0) {
476
+ console.log(`โœ… API Key Already Configured:`);
477
+ idesWithApiKey.forEach(ide => {
478
+ console.log(` - ${ide.name}`);
479
+ });
480
+ console.log('');
481
+ }
477
482
 
478
- console.log(`๐ŸŽ‰ Installation complete! Configured ${installCount} IDE(s).
483
+ if (idesNeedingApiKey.length > 0) {
484
+ console.log(`โš ๏ธ API Key Required For:`);
485
+ idesNeedingApiKey.forEach(ide => {
486
+ console.log(` - ${ide.name} (${ide.displayPath})`);
487
+ });
488
+ console.log('');
479
489
 
480
- ๐Ÿ”‘ CRITICAL: Add your API key (required for MCP client to work)
490
+ // Show setup instructions only for IDEs that need them
491
+ console.log(`๐Ÿ”‘ Setup Instructions
481
492
  โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
482
493
  Step 1: Get your API key
483
494
  ๐Ÿ‘‰ Visit: https://app.i18nagent.ai
484
495
  ๐Ÿ‘‰ Sign up or log in
485
496
  ๐Ÿ‘‰ Copy your API key (starts with "i18n_")
486
497
 
487
- Step 2: Add API key to config file(s)
488
- ${configPaths}
489
-
490
- Option A - Edit config file directly (RECOMMENDED):
491
- โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
492
- Open the config file and find the "env" section:
498
+ Step 2: Add API key to the config file
499
+ Open the config file and edit the "API_KEY" field:
493
500
 
494
501
  "mcpServers": {
495
502
  "i18n-agent": {
@@ -504,26 +511,20 @@ ${configPaths}
504
511
  Example with actual key:
505
512
  "API_KEY": "i18n_1234567890abcdef"
506
513
 
507
- Option B - Use environment variable:
508
- โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
509
- ${envVarInstructions}
510
-
511
514
  Step 3: Restart your IDE
512
515
  Close and reopen your IDE to load the new configuration
516
+ `);
517
+ }
513
518
 
514
- ๐Ÿงช Test the installation
519
+ // Show test instructions (for all IDEs)
520
+ console.log(`
521
+ ๐Ÿงช Test the Installation
515
522
  โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
516
523
  Try these commands in your AI IDE:
517
524
  โœ“ "Translate 'Hello world' to Spanish"
518
525
  โœ“ "Check my translation credits"
519
526
  โœ“ "List supported languages"
520
527
 
521
- If you get "Invalid API key" errors, double-check:
522
- - API key is correctly pasted in the config file
523
- - No extra spaces or quotes around the key
524
- - Config file is saved
525
- - IDE has been restarted
526
-
527
528
  ๐Ÿ“š Documentation: https://docs.i18nagent.ai
528
529
  ๐Ÿ› Issues: https://github.com/i18n-agent/mcp-client/issues
529
530
  ๐Ÿ’ฌ Support: support@i18nagent.ai
package/package.json CHANGED
@@ -1,11 +1,9 @@
1
1
  {
2
2
  "name": "@i18n-agent/mcp-client",
3
- "version": "1.8.8",
3
+ "version": "1.8.10",
4
4
  "description": "๐ŸŒ i18n-agent MCP Client - 48 languages, AI-powered translation for Claude, Claude Code, Cursor, VS Code, Codex. Get API key at https://app.i18nagent.ai",
5
5
  "main": "mcp-client.js",
6
- "bin": {
7
- "i18n-agent-install": "install.js"
8
- },
6
+ "bin": "install.js",
9
7
  "type": "module",
10
8
  "scripts": {
11
9
  "install": "node install.js",