@i18n-agent/mcp-client 1.8.2 โ†’ 1.8.4

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 +85 -21
  2. package/package.json +1 -1
package/install.js CHANGED
@@ -9,6 +9,7 @@ import fs from 'fs';
9
9
  import path from 'path';
10
10
  import os from 'os';
11
11
  import { fileURLToPath } from 'url';
12
+ import { execSync } from 'child_process';
12
13
 
13
14
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
14
15
 
@@ -46,8 +47,8 @@ const IDE_CONFIGS = {
46
47
  },
47
48
  'claude-code': {
48
49
  name: 'Claude Code CLI',
49
- configPath: path.join(os.homedir(), '.claude.json'),
50
- displayPath: '~/.claude.json'
50
+ configPath: path.join(os.homedir(), '.config/claude/claude_code_config.json'),
51
+ displayPath: '~/.config/claude/claude_code_config.json'
51
52
  },
52
53
  cursor: {
53
54
  name: 'Cursor',
@@ -83,21 +84,55 @@ Features:
83
84
  `);
84
85
 
85
86
  const getMcpClientPaths = () => {
86
- const mcpClientPath = path.resolve(__dirname, 'mcp-client.js');
87
- const packageDir = path.dirname(mcpClientPath);
88
- return { mcpClientPath, packageDir };
87
+ // Instead of using ephemeral npx cache, install to stable location
88
+ const stableDir = path.join(os.homedir(), '.claude', 'mcp-servers', 'i18n-agent');
89
+ const mcpClientPath = path.join(stableDir, 'mcp-client.js');
90
+ const packageDir = stableDir;
91
+ return { mcpClientPath, packageDir, sourceFile: path.resolve(__dirname, 'mcp-client.js') };
89
92
  };
90
93
 
94
+ function copyMcpClientToStableLocation() {
95
+ const paths = getMcpClientPaths();
96
+
97
+ // Create stable directory
98
+ fs.mkdirSync(paths.packageDir, { recursive: true });
99
+
100
+ // Copy mcp-client.js to stable location
101
+ fs.copyFileSync(paths.sourceFile, paths.mcpClientPath);
102
+
103
+ // Copy package.json to stable location
104
+ const packageJsonSource = path.resolve(__dirname, 'package.json');
105
+ const packageJsonDest = path.join(paths.packageDir, 'package.json');
106
+ fs.copyFileSync(packageJsonSource, packageJsonDest);
107
+
108
+ // Install dependencies
109
+ console.log(` ๐Ÿ“ฆ Installing dependencies...`);
110
+ try {
111
+ execSync('npm install --production --silent', {
112
+ cwd: paths.packageDir,
113
+ stdio: 'pipe'
114
+ });
115
+ console.log(` โœ… Dependencies installed successfully`);
116
+ } catch (error) {
117
+ console.error(` โš ๏ธ Warning: Failed to install dependencies automatically`);
118
+ console.error(` ๐Ÿ’ก Run manually: cd ${paths.packageDir} && npm install`);
119
+ }
120
+
121
+ console.log(` ๐Ÿ“ฆ Installed MCP client to: ${paths.packageDir}`);
122
+
123
+ return paths;
124
+ }
125
+
91
126
  async function detectAvailableIDEs() {
92
127
  const available = [];
93
-
128
+
94
129
  for (const [key, config] of Object.entries(IDE_CONFIGS)) {
95
130
  const configDir = path.dirname(config.configPath);
96
131
  if (fs.existsSync(configDir)) {
97
132
  available.push({ key, ...config });
98
133
  }
99
134
  }
100
-
135
+
101
136
  return available;
102
137
  }
103
138
 
@@ -236,7 +271,12 @@ function updateGenericMCPConfig(configPath) {
236
271
  async function main() {
237
272
  try {
238
273
  console.log('๐Ÿ” Detecting available AI IDEs...\n');
239
-
274
+
275
+ // First, copy MCP client to stable location
276
+ console.log('๐Ÿ“ฆ Installing MCP client files...');
277
+ copyMcpClientToStableLocation();
278
+ console.log('');
279
+
240
280
  const availableIDEs = await detectAvailableIDEs();
241
281
 
242
282
  if (availableIDEs.length === 0) {
@@ -312,32 +352,56 @@ For manual setup instructions, visit: https://docs.i18nagent.ai/setup
312
352
 
313
353
  console.log(`๐ŸŽ‰ Installation complete! Configured ${installCount} IDE(s).
314
354
 
315
- ๐Ÿ”‘ NEXT STEP: Add your API key
316
- โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
317
- 1. Get your API key from: https://app.i18nagent.ai
355
+ ๐Ÿ”‘ CRITICAL: Add your API key (required for MCP client to work)
356
+ โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
357
+ Step 1: Get your API key
358
+ ๐Ÿ‘‰ Visit: https://app.i18nagent.ai
359
+ ๐Ÿ‘‰ Sign up or log in
360
+ ๐Ÿ‘‰ Copy your API key (starts with "i18n_")
318
361
 
319
- 2. Add it to your config file(s):
362
+ Step 2: Add API key to config file(s)
320
363
  ${configPaths}
321
364
 
322
- Open the file and add your API key to the "env" section:
323
- "env": {
324
- "MCP_SERVER_URL": "https://mcp.i18nagent.ai",
325
- "API_KEY": "your-api-key-here" โ† Add your key here
365
+ Option A - Edit config file directly (RECOMMENDED):
366
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
367
+ Open the config file and find the "env" section:
368
+
369
+ "mcpServers": {
370
+ "i18n-agent": {
371
+ "command": "...",
372
+ "env": {
373
+ "MCP_SERVER_URL": "https://mcp.i18nagent.ai",
374
+ "API_KEY": "" โ† Paste your API key here (between the quotes)
375
+ }
376
+ }
326
377
  }
327
378
 
328
- OR set as environment variable:
379
+ Example with actual key:
380
+ "API_KEY": "i18n_1234567890abcdef"
381
+
382
+ Option B - Use environment variable:
383
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
329
384
  ${envVarInstructions}
330
385
 
331
- 3. Restart your IDE to load the configuration
386
+ Step 3: Restart your IDE
387
+ Close and reopen your IDE to load the new configuration
332
388
 
333
389
  ๐Ÿงช Test the installation
390
+ โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
334
391
  Try these commands in your AI IDE:
335
- - "Translate 'Hello world' to Spanish"
336
- - "Check my translation credits"
337
- - "List supported languages"
392
+ โœ“ "Translate 'Hello world' to Spanish"
393
+ โœ“ "Check my translation credits"
394
+ โœ“ "List supported languages"
395
+
396
+ If you get "Invalid API key" errors, double-check:
397
+ - API key is correctly pasted in the config file
398
+ - No extra spaces or quotes around the key
399
+ - Config file is saved
400
+ - IDE has been restarted
338
401
 
339
402
  ๐Ÿ“š Documentation: https://docs.i18nagent.ai
340
403
  ๐Ÿ› Issues: https://github.com/i18n-agent/mcp-client/issues
404
+ ๐Ÿ’ฌ Support: support@i18nagent.ai
341
405
  `);
342
406
  } else {
343
407
  console.error('โŒ Installation failed for all IDEs. Please check the error messages above.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i18n-agent/mcp-client",
3
- "version": "1.8.2",
3
+ "version": "1.8.4",
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": {