@i18n-agent/mcp-client 1.8.5 → 1.8.6

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 -22
  2. package/package.json +1 -1
package/install.js CHANGED
@@ -195,7 +195,7 @@ exec node "${mcpClientPath}"`;
195
195
  return wrapperPath;
196
196
  }
197
197
 
198
- function updateClaudeConfig(configPath) {
198
+ function updateClaudeConfig(configPath, ideKey = 'claude') {
199
199
  let config = {};
200
200
  let existingApiKey = "";
201
201
 
@@ -220,29 +220,50 @@ function updateClaudeConfig(configPath) {
220
220
  config.mcpServers = {};
221
221
  }
222
222
 
223
- // Detect if we need a wrapper script (for nvm users)
224
223
  const nodeEnv = detectNodeEnvironment();
225
- const claudeDir = path.join(os.homedir(), '.claude');
226
-
227
- if (nodeEnv.isNvm) {
228
- // Create wrapper script for nvm users
229
- console.log(' 🔧 Detected nvm environment, creating wrapper script...');
230
- const wrapperPath = createWrapperScript(claudeDir);
231
-
232
- config.mcpServers["i18n-agent"] = {
233
- command: wrapperPath,
234
- env: {
235
- MCP_SERVER_URL: "https://mcp.i18nagent.ai",
236
- API_KEY: existingApiKey || ""
224
+ const { mcpClientPath } = getMcpClientPaths();
225
+
226
+ // Claude Code CLI works better with command+args format (not wrapper)
227
+ if (ideKey === 'claude-code') {
228
+ if (nodeEnv.isNvm) {
229
+ // For nvm, use absolute node path with args
230
+ console.log(' 🔧 Using direct node path for Claude Code CLI');
231
+ config.mcpServers["i18n-agent"] = {
232
+ command: nodeEnv.nodePath,
233
+ args: [mcpClientPath],
234
+ env: {
235
+ MCP_SERVER_URL: "https://mcp.i18nagent.ai",
236
+ API_KEY: existingApiKey || ""
237
+ }
238
+ };
239
+ } else {
240
+ // For system node, use 'node' with args
241
+ const baseConfig = createMCPConfig();
242
+ config.mcpServers["i18n-agent"] = baseConfig.mcpServers["i18n-agent"];
243
+ if (existingApiKey) {
244
+ config.mcpServers["i18n-agent"].env.API_KEY = existingApiKey;
237
245
  }
238
- };
246
+ }
239
247
  } else {
240
- // Standard configuration for system node
241
- const baseConfig = createMCPConfig();
242
- config.mcpServers["i18n-agent"] = baseConfig.mcpServers["i18n-agent"];
243
- // Preserve existing API key
244
- if (existingApiKey) {
245
- config.mcpServers["i18n-agent"].env.API_KEY = existingApiKey;
248
+ // Claude Desktop - use wrapper script for compatibility
249
+ if (nodeEnv.isNvm) {
250
+ const claudeDir = path.join(os.homedir(), '.claude');
251
+ console.log(' 🔧 Detected nvm environment, creating wrapper script...');
252
+ const wrapperPath = createWrapperScript(claudeDir);
253
+
254
+ config.mcpServers["i18n-agent"] = {
255
+ command: wrapperPath,
256
+ env: {
257
+ MCP_SERVER_URL: "https://mcp.i18nagent.ai",
258
+ API_KEY: existingApiKey || ""
259
+ }
260
+ };
261
+ } else {
262
+ const baseConfig = createMCPConfig();
263
+ config.mcpServers["i18n-agent"] = baseConfig.mcpServers["i18n-agent"];
264
+ if (existingApiKey) {
265
+ config.mcpServers["i18n-agent"].env.API_KEY = existingApiKey;
266
+ }
246
267
  }
247
268
  }
248
269
 
@@ -337,7 +358,7 @@ For manual setup instructions, visit: https://docs.i18nagent.ai/setup
337
358
  console.log(`⚙️ Configuring ${ide.name}...`);
338
359
 
339
360
  if (ide.key === 'claude' || ide.key === 'claude-code') {
340
- updateClaudeConfig(ide.configPath);
361
+ updateClaudeConfig(ide.configPath, ide.key);
341
362
  } else {
342
363
  updateGenericMCPConfig(ide.configPath);
343
364
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i18n-agent/mcp-client",
3
- "version": "1.8.5",
3
+ "version": "1.8.6",
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": {