@i18n-agent/mcp-client 1.4.1 → 1.4.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/mcp-client.js +5 -12
- 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.4.
|
|
8
|
+
const MCP_CLIENT_VERSION = '1.4.3';
|
|
9
9
|
|
|
10
10
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
11
11
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
@@ -81,7 +81,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
81
81
|
description: 'Optional additional context or instructions for the translation (e.g., "Keep technical terms in English", "Use formal tone")',
|
|
82
82
|
},
|
|
83
83
|
},
|
|
84
|
-
required: ['texts', 'targetLanguage'
|
|
84
|
+
required: ['texts', 'targetLanguage'],
|
|
85
85
|
},
|
|
86
86
|
},
|
|
87
87
|
{
|
|
@@ -265,8 +265,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
265
265
|
|
|
266
266
|
let finalErrorMsg = error.message;
|
|
267
267
|
|
|
268
|
-
// Add retry guidance for non-auth/credit errors (
|
|
269
|
-
|
|
268
|
+
// Add retry guidance for non-auth/credit errors (only for tools that send content)
|
|
269
|
+
const contentBasedTools = ['translate_text', 'translate_file'];
|
|
270
|
+
if (!isAuthError && !isCreditError && contentBasedTools.includes(name)) {
|
|
270
271
|
finalErrorMsg = `${error.message}. Please retry with smaller chunks or split the content into multiple requests.`;
|
|
271
272
|
}
|
|
272
273
|
|
|
@@ -287,14 +288,6 @@ async function handleTranslateText(args) {
|
|
|
287
288
|
if (!targetLanguage) {
|
|
288
289
|
throw new Error('targetLanguage is required');
|
|
289
290
|
}
|
|
290
|
-
|
|
291
|
-
if (!targetAudience) {
|
|
292
|
-
throw new Error('targetAudience is required');
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
if (!industry) {
|
|
296
|
-
throw new Error('industry is required');
|
|
297
|
-
}
|
|
298
291
|
|
|
299
292
|
// Check if this is a large translation request
|
|
300
293
|
const totalChars = texts.reduce((sum, text) => sum + text.length, 0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@i18n-agent/mcp-client",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "MCP client for i18n-agent translation service with async job support and enhanced progress tracking - supports Claude, Cursor, VS Code, and other AI IDEs",
|
|
5
5
|
"main": "mcp-client.js",
|
|
6
6
|
"bin": {
|