@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.
- package/install.js +66 -21
- 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
|
-
|
|
87
|
-
const
|
|
88
|
-
|
|
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
|
-
๐
|
|
316
|
-
|
|
317
|
-
1
|
|
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
|
|
343
|
+
Step 2: Add API key to config file(s)
|
|
320
344
|
${configPaths}
|
|
321
345
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
336
|
-
|
|
337
|
-
|
|
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.
|
|
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": {
|