@i18n-agent/mcp-client 1.4.0 → 1.4.1
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 +20 -3
- 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
|
+
const MCP_CLIENT_VERSION = '1.4.1';
|
|
9
9
|
|
|
10
10
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
11
11
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
@@ -265,8 +265,8 @@ 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
|
-
if (!isAuthError && !isCreditError) {
|
|
268
|
+
// Add retry guidance for non-auth/credit errors (but not for status checking)
|
|
269
|
+
if (!isAuthError && !isCreditError && name !== 'check_translation_status') {
|
|
270
270
|
finalErrorMsg = `${error.message}. Please retry with smaller chunks or split the content into multiple requests.`;
|
|
271
271
|
}
|
|
272
272
|
|
|
@@ -1305,6 +1305,23 @@ async function handleCheckTranslationStatus(args) {
|
|
|
1305
1305
|
return response.data.result;
|
|
1306
1306
|
} catch (error) {
|
|
1307
1307
|
console.error('Check translation status error:', error);
|
|
1308
|
+
|
|
1309
|
+
// Handle 503 service unavailable
|
|
1310
|
+
if (error.response?.status === 503) {
|
|
1311
|
+
throw new Error(`Translation service is temporarily unavailable (503). Please try again in a few moments.`);
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
// Handle 404 not found
|
|
1315
|
+
if (error.response?.status === 404) {
|
|
1316
|
+
throw new Error(`Translation job ${jobId} not found. The job may have expired or the ID is incorrect.`);
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
// Handle timeout
|
|
1320
|
+
if (error.code === 'ECONNABORTED') {
|
|
1321
|
+
throw new Error(`Status check timed out. The service may be experiencing high load. Please try again.`);
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
// Generic error
|
|
1308
1325
|
throw new Error(`Unable to check translation status: ${error.message}`);
|
|
1309
1326
|
}
|
|
1310
1327
|
}
|
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.1",
|
|
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": {
|