@i18n-agent/mcp-client 1.8.18 → 1.8.19
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/mcp-client.js +71 -5
- package/package.json +1 -1
package/mcp-client.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.
|
|
8
|
+
const MCP_CLIENT_VERSION = '1.8.19';
|
|
9
9
|
|
|
10
10
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
11
11
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
@@ -47,7 +47,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
47
47
|
tools: [
|
|
48
48
|
{
|
|
49
49
|
name: 'translate_text',
|
|
50
|
-
description: '⚠️ CRITICAL: For multi-language translation, use targetLanguages parameter (not targetLanguage). Translate text content with cultural adaptation using AI subagents. Supports both single and multi-language translation. For large requests (>100 texts or >50,000 characters), returns a jobId for async processing. Use check_translation_status to monitor progress and download results.',
|
|
50
|
+
description: '⚠️ CRITICAL: For multi-language translation, use targetLanguages parameter (not targetLanguage). Translate text content with cultural adaptation using AI subagents. Supports both single and multi-language translation. For large requests (>100 texts or >50,000 characters), returns a jobId for async processing. Use check_translation_status to monitor progress and download results. Set pseudoTranslation=true for testing i18n implementations without AI cost.',
|
|
51
51
|
inputSchema: {
|
|
52
52
|
type: 'object',
|
|
53
53
|
properties: {
|
|
@@ -83,6 +83,36 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
83
83
|
type: 'string',
|
|
84
84
|
description: 'Optional additional context or instructions for the translation (e.g., "Keep technical terms in English", "Use formal tone")',
|
|
85
85
|
},
|
|
86
|
+
pseudoTranslation: {
|
|
87
|
+
type: 'boolean',
|
|
88
|
+
description: 'Enable pseudo-translation mode for testing i18n implementations (bypasses AI translation, no credit cost)',
|
|
89
|
+
},
|
|
90
|
+
pseudoOptions: {
|
|
91
|
+
type: 'object',
|
|
92
|
+
properties: {
|
|
93
|
+
addCJK: {
|
|
94
|
+
type: 'boolean',
|
|
95
|
+
description: 'Add CJK characters to test wide character support',
|
|
96
|
+
},
|
|
97
|
+
expansionRatio: {
|
|
98
|
+
type: 'number',
|
|
99
|
+
description: 'Length expansion ratio (1.0 = no expansion, 1.3 = 30% longer, 2.0 = double length)',
|
|
100
|
+
},
|
|
101
|
+
addSpecialChars: {
|
|
102
|
+
type: 'boolean',
|
|
103
|
+
description: 'Add special characters to test encoding/escaping',
|
|
104
|
+
},
|
|
105
|
+
addBrackets: {
|
|
106
|
+
type: 'boolean',
|
|
107
|
+
description: 'Wrap strings with brackets to identify untranslated content',
|
|
108
|
+
},
|
|
109
|
+
addAccents: {
|
|
110
|
+
type: 'boolean',
|
|
111
|
+
description: 'Replace Latin characters with accented equivalents',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
description: 'Configuration options for pseudo-translation',
|
|
115
|
+
},
|
|
86
116
|
},
|
|
87
117
|
required: ['texts', 'targetLanguages'],
|
|
88
118
|
},
|
|
@@ -103,7 +133,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
103
133
|
},
|
|
104
134
|
{
|
|
105
135
|
name: 'translate_file',
|
|
106
|
-
description: '⚠️ CRITICAL: For multi-language translation, use targetLanguages parameter (not targetLanguage). Translate file content while preserving structure and format. Supports both single and multi-language translation. Supports JSON, YAML, XML, CSV, TXT, MD, and other text files. For large files (>100KB), returns a jobId for async processing. Use check_translation_status to monitor progress and download results.',
|
|
136
|
+
description: '⚠️ CRITICAL: For multi-language translation, use targetLanguages parameter (not targetLanguage). Translate file content while preserving structure and format. Supports both single and multi-language translation. Supports JSON, YAML, XML, CSV, TXT, MD, and other text files. For large files (>100KB), returns a jobId for async processing. Use check_translation_status to monitor progress and download results. Set pseudoTranslation=true for testing i18n implementations without AI cost.',
|
|
107
137
|
inputSchema: {
|
|
108
138
|
type: 'object',
|
|
109
139
|
properties: {
|
|
@@ -160,6 +190,36 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
160
190
|
type: 'string',
|
|
161
191
|
description: 'Optional additional context or instructions for the translation (e.g., "Keep technical terms in English", "Use formal tone")',
|
|
162
192
|
},
|
|
193
|
+
pseudoTranslation: {
|
|
194
|
+
type: 'boolean',
|
|
195
|
+
description: 'Enable pseudo-translation mode for testing i18n implementations (bypasses AI translation, no credit cost)',
|
|
196
|
+
},
|
|
197
|
+
pseudoOptions: {
|
|
198
|
+
type: 'object',
|
|
199
|
+
properties: {
|
|
200
|
+
addCJK: {
|
|
201
|
+
type: 'boolean',
|
|
202
|
+
description: 'Add CJK characters to test wide character support',
|
|
203
|
+
},
|
|
204
|
+
expansionRatio: {
|
|
205
|
+
type: 'number',
|
|
206
|
+
description: 'Length expansion ratio (1.0 = no expansion, 1.3 = 30% longer, 2.0 = double length)',
|
|
207
|
+
},
|
|
208
|
+
addSpecialChars: {
|
|
209
|
+
type: 'boolean',
|
|
210
|
+
description: 'Add special characters to test encoding/escaping',
|
|
211
|
+
},
|
|
212
|
+
addBrackets: {
|
|
213
|
+
type: 'boolean',
|
|
214
|
+
description: 'Wrap strings with brackets to identify untranslated content',
|
|
215
|
+
},
|
|
216
|
+
addAccents: {
|
|
217
|
+
type: 'boolean',
|
|
218
|
+
description: 'Replace Latin characters with accented equivalents',
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
description: 'Configuration options for pseudo-translation',
|
|
222
|
+
},
|
|
163
223
|
},
|
|
164
224
|
required: ['targetLanguages'],
|
|
165
225
|
},
|
|
@@ -376,7 +436,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
376
436
|
});
|
|
377
437
|
|
|
378
438
|
async function handleTranslateText(args) {
|
|
379
|
-
const { texts, targetLanguages: rawTargetLanguages, sourceLanguage, targetAudience = 'general', industry = 'technology', region, context } = args;
|
|
439
|
+
const { texts, targetLanguages: rawTargetLanguages, sourceLanguage, targetAudience = 'general', industry = 'technology', region, context, pseudoTranslation, pseudoOptions } = args;
|
|
380
440
|
|
|
381
441
|
if (!texts || !Array.isArray(texts) || texts.length === 0) {
|
|
382
442
|
throw new Error('texts must be a non-empty array');
|
|
@@ -420,6 +480,8 @@ async function handleTranslateText(args) {
|
|
|
420
480
|
industry: industry,
|
|
421
481
|
region: region,
|
|
422
482
|
context: context,
|
|
483
|
+
pseudoTranslation: pseudoTranslation,
|
|
484
|
+
pseudoOptions: pseudoOptions,
|
|
423
485
|
}
|
|
424
486
|
}
|
|
425
487
|
};
|
|
@@ -684,7 +746,9 @@ async function handleTranslateFile(args) {
|
|
|
684
746
|
outputFormat = 'same',
|
|
685
747
|
sourceLanguage,
|
|
686
748
|
region,
|
|
687
|
-
context
|
|
749
|
+
context,
|
|
750
|
+
pseudoTranslation,
|
|
751
|
+
pseudoOptions
|
|
688
752
|
} = args;
|
|
689
753
|
|
|
690
754
|
if (!filePath && !fileContent) {
|
|
@@ -740,6 +804,8 @@ async function handleTranslateFile(args) {
|
|
|
740
804
|
if (targetLanguages !== undefined) requestArgs.targetLanguages = targetLanguages;
|
|
741
805
|
if (region !== undefined) requestArgs.region = region;
|
|
742
806
|
if (context !== undefined) requestArgs.context = context;
|
|
807
|
+
if (pseudoTranslation !== undefined) requestArgs.pseudoTranslation = pseudoTranslation;
|
|
808
|
+
if (pseudoOptions !== undefined) requestArgs.pseudoOptions = pseudoOptions;
|
|
743
809
|
|
|
744
810
|
// Use MCP JSON-RPC protocol for translate_file
|
|
745
811
|
const mcpRequest = {
|
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.19",
|
|
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": {
|