@i18n-agent/mcp-client 1.8.8 โ 1.8.9
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/install.js +43 -42
- package/package.json +1 -1
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
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
488
|
-
|
|
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
|
-
|
|
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@i18n-agent/mcp-client",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.9",
|
|
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
6
|
"bin": {
|