@i18n-agent/mcp-client 1.11.0 ā 1.13.0
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/README.md +2 -1
- package/i18n-agent.js +1 -1
- package/install.js +134 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# š i18n-agent MCP Client
|
|
2
2
|
|
|
3
|
-
Professional translation service client for Claude, Cursor, VS Code, and other AI IDEs using the Model Context Protocol (MCP).
|
|
3
|
+
Professional translation service client for Claude, Cursor, VS Code, Antigravity, and other AI IDEs using the Model Context Protocol (MCP).
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@i18n-agent/mcp-client)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -77,6 +77,7 @@ Analyze "Hello world! This is a test." for translation to Spanish
|
|
|
77
77
|
| **Cursor** | ā
Auto-configured | `~/.cursor/mcp_settings.json` | `~/.cursor/mcp_settings.json` | `~/.cursor/mcp_settings.json` |
|
|
78
78
|
| **VS Code** | ā
Auto-configured | `~/.vscode/mcp_settings.json` | `~/.vscode/mcp_settings.json` | `~/.vscode/mcp_settings.json` |
|
|
79
79
|
| **Codex (OpenAI)** | ā
Auto-configured | `~/.codex/mcp_settings.json` | `~/.codex/mcp_settings.json` | `~/.codex/mcp_settings.json` |
|
|
80
|
+
| **Antigravity (Google)** | ā
Auto-configured | `~/.gemini/antigravity/mcp_config.json` | `%USERPROFILE%\.gemini\antigravity\mcp_config.json` | `~/.config/antigravity/mcp_config.json` |
|
|
80
81
|
|
|
81
82
|
**Note:** The installer automatically detects your platform and uses the correct config paths.
|
|
82
83
|
|
package/i18n-agent.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Integrates with Claude Code CLI to provide translation capabilities
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
const MCP_CLIENT_VERSION = '1.
|
|
8
|
+
const MCP_CLIENT_VERSION = '1.13.0';
|
|
9
9
|
|
|
10
10
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
11
11
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
package/install.js
CHANGED
|
@@ -37,8 +37,32 @@ function getClaudeDesktopPath() {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
function getAntigravityPath() {
|
|
41
|
+
const platform = process.platform;
|
|
42
|
+
if (platform === 'darwin') {
|
|
43
|
+
// macOS
|
|
44
|
+
return {
|
|
45
|
+
configPath: path.join(os.homedir(), '.gemini/antigravity/mcp_config.json'),
|
|
46
|
+
displayPath: '~/.gemini/antigravity/mcp_config.json'
|
|
47
|
+
};
|
|
48
|
+
} else if (platform === 'win32') {
|
|
49
|
+
// Windows
|
|
50
|
+
return {
|
|
51
|
+
configPath: path.join(os.homedir(), '.gemini/antigravity/mcp_config.json'),
|
|
52
|
+
displayPath: '%USERPROFILE%\\.gemini\\antigravity\\mcp_config.json'
|
|
53
|
+
};
|
|
54
|
+
} else {
|
|
55
|
+
// Linux
|
|
56
|
+
return {
|
|
57
|
+
configPath: path.join(os.homedir(), '.config/antigravity/mcp_config.json'),
|
|
58
|
+
displayPath: '~/.config/antigravity/mcp_config.json'
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
40
63
|
// Supported IDE configurations
|
|
41
64
|
const claudePaths = getClaudeDesktopPath();
|
|
65
|
+
const antigravityPaths = getAntigravityPath();
|
|
42
66
|
const IDE_CONFIGS = {
|
|
43
67
|
claude: {
|
|
44
68
|
name: 'Claude Desktop',
|
|
@@ -64,6 +88,11 @@ const IDE_CONFIGS = {
|
|
|
64
88
|
name: 'Codex (OpenAI)',
|
|
65
89
|
configPath: path.join(os.homedir(), '.codex/mcp_settings.json'),
|
|
66
90
|
displayPath: '~/.codex/mcp_settings.json'
|
|
91
|
+
},
|
|
92
|
+
antigravity: {
|
|
93
|
+
name: 'Antigravity (Google)',
|
|
94
|
+
configPath: antigravityPaths.configPath,
|
|
95
|
+
displayPath: antigravityPaths.displayPath
|
|
67
96
|
}
|
|
68
97
|
};
|
|
69
98
|
|
|
@@ -110,7 +139,7 @@ function copyMcpClientToStableLocation() {
|
|
|
110
139
|
// Install dependencies
|
|
111
140
|
console.log(` š¦ Installing dependencies...`);
|
|
112
141
|
try {
|
|
113
|
-
execSync('npm install --
|
|
142
|
+
execSync('npm install --omit=dev --ignore-scripts --silent', {
|
|
114
143
|
cwd: paths.packageDir,
|
|
115
144
|
stdio: 'pipe'
|
|
116
145
|
});
|
|
@@ -153,6 +182,62 @@ function checkExistingApiKey(configPath) {
|
|
|
153
182
|
}
|
|
154
183
|
}
|
|
155
184
|
|
|
185
|
+
// Extract actual API key value from a config file
|
|
186
|
+
function extractApiKeyFromConfig(configPath) {
|
|
187
|
+
if (!fs.existsSync(configPath)) {
|
|
188
|
+
return '';
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
try {
|
|
192
|
+
const content = fs.readFileSync(configPath, 'utf8');
|
|
193
|
+
const config = JSON.parse(content);
|
|
194
|
+
const apiKey = config.mcpServers?.["i18n-agent"]?.env?.API_KEY;
|
|
195
|
+
return (apiKey && apiKey.trim() !== '') ? apiKey.trim() : '';
|
|
196
|
+
} catch (error) {
|
|
197
|
+
return '';
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// Find any existing API key from all available IDEs
|
|
202
|
+
function findAnyExistingApiKey(availableIDEs, claudeCodeCLIAvailable = false, codexCLIAvailable = false) {
|
|
203
|
+
// Check Claude Code CLI first
|
|
204
|
+
if (claudeCodeCLIAvailable) {
|
|
205
|
+
const cliKey = getClaudeCodeExistingApiKey('i18n-agent');
|
|
206
|
+
if (cliKey) {
|
|
207
|
+
console.log(' š Found existing API key from Claude Code CLI');
|
|
208
|
+
return cliKey;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Check Codex CLI
|
|
213
|
+
if (codexCLIAvailable) {
|
|
214
|
+
const cliKey = getCodexExistingApiKey('i18n-agent');
|
|
215
|
+
if (cliKey) {
|
|
216
|
+
console.log(' š Found existing API key from Codex CLI');
|
|
217
|
+
return cliKey;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// Check all config files
|
|
222
|
+
for (const ide of availableIDEs) {
|
|
223
|
+
const apiKey = extractApiKeyFromConfig(ide.configPath);
|
|
224
|
+
if (apiKey) {
|
|
225
|
+
console.log(` š Found existing API key from ${ide.name}`);
|
|
226
|
+
return apiKey;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Also check ~/.claude.json specifically
|
|
231
|
+
const claudeJsonPath = path.join(os.homedir(), '.claude.json');
|
|
232
|
+
const claudeJsonKey = extractApiKeyFromConfig(claudeJsonPath);
|
|
233
|
+
if (claudeJsonKey) {
|
|
234
|
+
console.log(' š Found existing API key from ~/.claude.json');
|
|
235
|
+
return claudeJsonKey;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return '';
|
|
239
|
+
}
|
|
240
|
+
|
|
156
241
|
async function checkExistingApiKeys(availableIDEs, claudeCodeCLIAvailable = false, codexCLIAvailable = false) {
|
|
157
242
|
const withKeys = [];
|
|
158
243
|
const withoutKeys = [];
|
|
@@ -445,7 +530,7 @@ exec node "${mcpClientPath}"`;
|
|
|
445
530
|
return wrapperPath;
|
|
446
531
|
}
|
|
447
532
|
|
|
448
|
-
function updateClaudeConfig(configPath, ideKey = 'claude') {
|
|
533
|
+
function updateClaudeConfig(configPath, ideKey = 'claude', sharedApiKey = '') {
|
|
449
534
|
let config = {};
|
|
450
535
|
let existingApiKey = "";
|
|
451
536
|
let hasApiKey = false;
|
|
@@ -467,6 +552,13 @@ function updateClaudeConfig(configPath, ideKey = 'claude') {
|
|
|
467
552
|
}
|
|
468
553
|
}
|
|
469
554
|
|
|
555
|
+
// Use shared API key if no existing key found
|
|
556
|
+
if (!existingApiKey && sharedApiKey) {
|
|
557
|
+
existingApiKey = sharedApiKey;
|
|
558
|
+
hasApiKey = true;
|
|
559
|
+
console.log(' š Using shared API key from another IDE');
|
|
560
|
+
}
|
|
561
|
+
|
|
470
562
|
// Ensure mcpServers exists
|
|
471
563
|
if (!config.mcpServers) {
|
|
472
564
|
config.mcpServers = {};
|
|
@@ -528,7 +620,7 @@ function updateClaudeConfig(configPath, ideKey = 'claude') {
|
|
|
528
620
|
return { config, hasApiKey };
|
|
529
621
|
}
|
|
530
622
|
|
|
531
|
-
function updateGenericMCPConfig(configPath) {
|
|
623
|
+
function updateGenericMCPConfig(configPath, sharedApiKey = '') {
|
|
532
624
|
let config = {};
|
|
533
625
|
let existingApiKey = "";
|
|
534
626
|
let hasApiKey = false;
|
|
@@ -549,6 +641,13 @@ function updateGenericMCPConfig(configPath) {
|
|
|
549
641
|
}
|
|
550
642
|
}
|
|
551
643
|
|
|
644
|
+
// Use shared API key if no existing key found
|
|
645
|
+
if (!existingApiKey && sharedApiKey) {
|
|
646
|
+
existingApiKey = sharedApiKey;
|
|
647
|
+
hasApiKey = true;
|
|
648
|
+
console.log(' š Using shared API key from another IDE');
|
|
649
|
+
}
|
|
650
|
+
|
|
552
651
|
if (!config.mcpServers) {
|
|
553
652
|
config.mcpServers = {};
|
|
554
653
|
}
|
|
@@ -598,6 +697,7 @@ Supported IDEs:
|
|
|
598
697
|
- Cursor
|
|
599
698
|
- VS Code (with MCP extension)
|
|
600
699
|
- Codex (OpenAI)
|
|
700
|
+
- Antigravity (Google)
|
|
601
701
|
|
|
602
702
|
Manual setup:
|
|
603
703
|
1. Create the configuration file for your IDE
|
|
@@ -622,6 +722,9 @@ For manual setup instructions, visit: https://docs.i18nagent.ai/setup
|
|
|
622
722
|
// Check for existing API keys BEFORE installation
|
|
623
723
|
const { withKeys, withoutKeys } = await checkExistingApiKeys(availableIDEs, claudeCodeCLIAvailable, codexCLIAvailable);
|
|
624
724
|
|
|
725
|
+
// Find a shared API key from any IDE that has one - will be applied to all IDEs
|
|
726
|
+
const sharedApiKey = findAnyExistingApiKey(availableIDEs, claudeCodeCLIAvailable, codexCLIAvailable);
|
|
727
|
+
|
|
625
728
|
if (withKeys.length > 0 && withoutKeys.length === 0) {
|
|
626
729
|
console.log(`ā
API Keys Already Configured:`);
|
|
627
730
|
withKeys.forEach(ide => {
|
|
@@ -629,17 +732,24 @@ For manual setup instructions, visit: https://docs.i18nagent.ai/setup
|
|
|
629
732
|
});
|
|
630
733
|
console.log(`\nš Your API keys are preserved. Updating MCP client files only...\n`);
|
|
631
734
|
} else if (withKeys.length > 0 && withoutKeys.length > 0) {
|
|
632
|
-
// Mixed case: some have keys, some don't
|
|
735
|
+
// Mixed case: some have keys, some don't - we'll share the key!
|
|
633
736
|
console.log(`ā
API Keys Already Configured:`);
|
|
634
737
|
withKeys.forEach(ide => {
|
|
635
738
|
console.log(` - ${ide.name}`);
|
|
636
739
|
});
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
740
|
+
if (sharedApiKey) {
|
|
741
|
+
console.log(`\nš Will apply existing API key to:`);
|
|
742
|
+
withoutKeys.forEach(ide => {
|
|
743
|
+
console.log(` - ${ide.name}`);
|
|
744
|
+
});
|
|
745
|
+
console.log(`\nš API key will be shared across all IDEs.\n`);
|
|
746
|
+
} else {
|
|
747
|
+
console.log(`\nš API Key Setup Required:`);
|
|
748
|
+
withoutKeys.forEach(ide => {
|
|
749
|
+
console.log(` - ${ide.name}`);
|
|
750
|
+
});
|
|
751
|
+
console.log(`\nš” Get your API key at: https://app.i18nagent.ai\n`);
|
|
752
|
+
}
|
|
643
753
|
} else if (withoutKeys.length > 0) {
|
|
644
754
|
console.log(`š API Key Setup Required:`);
|
|
645
755
|
withoutKeys.forEach(ide => {
|
|
@@ -680,7 +790,7 @@ For manual setup instructions, visit: https://docs.i18nagent.ai/setup
|
|
|
680
790
|
|
|
681
791
|
// Special handling for Claude Code CLI - use native CLI if available
|
|
682
792
|
if (ide.key === 'claude-code' && claudeCodeCLIAvailable) {
|
|
683
|
-
// Get existing API key - check CLI registration first, then config file
|
|
793
|
+
// Get existing API key - check CLI registration first, then config file, then use shared key
|
|
684
794
|
let existingApiKey = getClaudeCodeExistingApiKey('i18n-agent');
|
|
685
795
|
if (!existingApiKey && fs.existsSync(ide.configPath)) {
|
|
686
796
|
try {
|
|
@@ -691,6 +801,11 @@ For manual setup instructions, visit: https://docs.i18nagent.ai/setup
|
|
|
691
801
|
// Ignore parse errors
|
|
692
802
|
}
|
|
693
803
|
}
|
|
804
|
+
// Use shared API key if no IDE-specific key found
|
|
805
|
+
if (!existingApiKey && sharedApiKey) {
|
|
806
|
+
existingApiKey = sharedApiKey;
|
|
807
|
+
console.log(' š Using shared API key from another IDE');
|
|
808
|
+
}
|
|
694
809
|
|
|
695
810
|
try {
|
|
696
811
|
installViaClaudeCodeCLI(existingApiKey);
|
|
@@ -714,7 +829,7 @@ For manual setup instructions, visit: https://docs.i18nagent.ai/setup
|
|
|
714
829
|
|
|
715
830
|
// Special handling for Codex - use native CLI if available
|
|
716
831
|
if (ide.key === 'codex' && codexCLIAvailable) {
|
|
717
|
-
// Get existing API key - check CLI registration first, then config file
|
|
832
|
+
// Get existing API key - check CLI registration first, then config file, then use shared key
|
|
718
833
|
let existingApiKey = getCodexExistingApiKey('i18n-agent');
|
|
719
834
|
if (!existingApiKey && fs.existsSync(ide.configPath)) {
|
|
720
835
|
try {
|
|
@@ -725,6 +840,11 @@ For manual setup instructions, visit: https://docs.i18nagent.ai/setup
|
|
|
725
840
|
// Ignore parse errors
|
|
726
841
|
}
|
|
727
842
|
}
|
|
843
|
+
// Use shared API key if no IDE-specific key found
|
|
844
|
+
if (!existingApiKey && sharedApiKey) {
|
|
845
|
+
existingApiKey = sharedApiKey;
|
|
846
|
+
console.log(' š Using shared API key from another IDE');
|
|
847
|
+
}
|
|
728
848
|
|
|
729
849
|
try {
|
|
730
850
|
installViaCodexCLI(existingApiKey);
|
|
@@ -747,9 +867,9 @@ For manual setup instructions, visit: https://docs.i18nagent.ai/setup
|
|
|
747
867
|
}
|
|
748
868
|
|
|
749
869
|
if (ide.key === 'claude' || ide.key === 'claude-code') {
|
|
750
|
-
result = updateClaudeConfig(ide.configPath, ide.key);
|
|
870
|
+
result = updateClaudeConfig(ide.configPath, ide.key, sharedApiKey);
|
|
751
871
|
} else {
|
|
752
|
-
result = updateGenericMCPConfig(ide.configPath);
|
|
872
|
+
result = updateGenericMCPConfig(ide.configPath, sharedApiKey);
|
|
753
873
|
}
|
|
754
874
|
|
|
755
875
|
console.log(`ā
${ide.name} configured successfully!`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@i18n-agent/mcp-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
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": "i18n-agent.js",
|
|
6
6
|
"bin": {
|