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

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 +66 -21
  2. package/package.json +1 -1
package/install.js CHANGED
@@ -46,8 +46,8 @@ const IDE_CONFIGS = {
46
46
  },
47
47
  'claude-code': {
48
48
  name: 'Claude Code CLI',
49
- configPath: path.join(os.homedir(), '.claude.json'),
50
- displayPath: '~/.claude.json'
49
+ configPath: path.join(os.homedir(), '.config/claude/claude_code_config.json'),
50
+ displayPath: '~/.config/claude/claude_code_config.json'
51
51
  },
52
52
  cursor: {
53
53
  name: 'Cursor',
@@ -83,21 +83,37 @@ Features:
83
83
  `);
84
84
 
85
85
  const getMcpClientPaths = () => {
86
- const mcpClientPath = path.resolve(__dirname, 'mcp-client.js');
87
- const packageDir = path.dirname(mcpClientPath);
88
- return { mcpClientPath, packageDir };
86
+ // Instead of using ephemeral npx cache, install to stable location
87
+ const stableDir = path.join(os.homedir(), '.claude', 'mcp-servers', 'i18n-agent');
88
+ const mcpClientPath = path.join(stableDir, 'mcp-client.js');
89
+ const packageDir = stableDir;
90
+ return { mcpClientPath, packageDir, sourceFile: path.resolve(__dirname, 'mcp-client.js') };
89
91
  };
90
92
 
93
+ function copyMcpClientToStableLocation() {
94
+ const paths = getMcpClientPaths();
95
+
96
+ // Create stable directory
97
+ fs.mkdirSync(paths.packageDir, { recursive: true });
98
+
99
+ // Copy mcp-client.js to stable location
100
+ fs.copyFileSync(paths.sourceFile, paths.mcpClientPath);
101
+
102
+ console.log(` ๐Ÿ“ฆ Installed MCP client to: ${paths.packageDir}`);
103
+
104
+ return paths;
105
+ }
106
+
91
107
  async function detectAvailableIDEs() {
92
108
  const available = [];
93
-
109
+
94
110
  for (const [key, config] of Object.entries(IDE_CONFIGS)) {
95
111
  const configDir = path.dirname(config.configPath);
96
112
  if (fs.existsSync(configDir)) {
97
113
  available.push({ key, ...config });
98
114
  }
99
115
  }
100
-
116
+
101
117
  return available;
102
118
  }
103
119
 
@@ -236,7 +252,12 @@ function updateGenericMCPConfig(configPath) {
236
252
  async function main() {
237
253
  try {
238
254
  console.log('๐Ÿ” Detecting available AI IDEs...\n');
239
-
255
+
256
+ // First, copy MCP client to stable location
257
+ console.log('๐Ÿ“ฆ Installing MCP client files...');
258
+ copyMcpClientToStableLocation();
259
+ console.log('');
260
+
240
261
  const availableIDEs = await detectAvailableIDEs();
241
262
 
242
263
  if (availableIDEs.length === 0) {
@@ -312,32 +333,56 @@ For manual setup instructions, visit: https://docs.i18nagent.ai/setup
312
333
 
313
334
  console.log(`๐ŸŽ‰ Installation complete! Configured ${installCount} IDE(s).
314
335
 
315
- ๐Ÿ”‘ NEXT STEP: Add your API key
316
- โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
317
- 1. Get your API key from: https://app.i18nagent.ai
336
+ ๐Ÿ”‘ CRITICAL: Add your API key (required for MCP client to work)
337
+ โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
338
+ Step 1: Get your API key
339
+ ๐Ÿ‘‰ Visit: https://app.i18nagent.ai
340
+ ๐Ÿ‘‰ Sign up or log in
341
+ ๐Ÿ‘‰ Copy your API key (starts with "i18n_")
318
342
 
319
- 2. Add it to your config file(s):
343
+ Step 2: Add API key to config file(s)
320
344
  ${configPaths}
321
345
 
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
346
+ Option A - Edit config file directly (RECOMMENDED):
347
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
348
+ Open the config file and find the "env" section:
349
+
350
+ "mcpServers": {
351
+ "i18n-agent": {
352
+ "command": "...",
353
+ "env": {
354
+ "MCP_SERVER_URL": "https://mcp.i18nagent.ai",
355
+ "API_KEY": "" โ† Paste your API key here (between the quotes)
356
+ }
357
+ }
326
358
  }
327
359
 
328
- OR set as environment variable:
360
+ Example with actual key:
361
+ "API_KEY": "i18n_1234567890abcdef"
362
+
363
+ Option B - Use environment variable:
364
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
329
365
  ${envVarInstructions}
330
366
 
331
- 3. Restart your IDE to load the configuration
367
+ Step 3: Restart your IDE
368
+ Close and reopen your IDE to load the new configuration
332
369
 
333
370
  ๐Ÿงช Test the installation
371
+ โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
334
372
  Try these commands in your AI IDE:
335
- - "Translate 'Hello world' to Spanish"
336
- - "Check my translation credits"
337
- - "List supported languages"
373
+ โœ“ "Translate 'Hello world' to Spanish"
374
+ โœ“ "Check my translation credits"
375
+ โœ“ "List supported languages"
376
+
377
+ If you get "Invalid API key" errors, double-check:
378
+ - API key is correctly pasted in the config file
379
+ - No extra spaces or quotes around the key
380
+ - Config file is saved
381
+ - IDE has been restarted
338
382
 
339
383
  ๐Ÿ“š Documentation: https://docs.i18nagent.ai
340
384
  ๐Ÿ› Issues: https://github.com/i18n-agent/mcp-client/issues
385
+ ๐Ÿ’ฌ Support: support@i18nagent.ai
341
386
  `);
342
387
  } else {
343
388
  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.3",
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": {