@i18n-agent/mcp-client 1.4.3 → 1.5.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/mcp-client.js +10 -4
- 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.5.0';
|
|
9
9
|
|
|
10
10
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
11
11
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
@@ -412,10 +412,13 @@ async function handleTranslateText(args) {
|
|
|
412
412
|
}
|
|
413
413
|
|
|
414
414
|
// Check if it's actually a service unavailable error (only for real infrastructure issues)
|
|
415
|
+
if (error.response?.status === 503) {
|
|
416
|
+
throw new Error(`i18n-agent encountered unexpected problem, and we are working on it, try again later.`);
|
|
417
|
+
}
|
|
418
|
+
|
|
415
419
|
if (error.code === 'ECONNREFUSED' ||
|
|
416
420
|
error.code === 'ETIMEDOUT' ||
|
|
417
421
|
error.code === 'ENOTFOUND' ||
|
|
418
|
-
(error.response?.status === 503 && totalChars <= 50000) ||
|
|
419
422
|
error.response?.status === 502 ||
|
|
420
423
|
error.response?.status === 504) {
|
|
421
424
|
const serviceErrorDetails = error.response?.data?.result?.content?.[0]?.text ||
|
|
@@ -708,10 +711,13 @@ async function handleTranslateFile(args) {
|
|
|
708
711
|
}
|
|
709
712
|
|
|
710
713
|
// Check if it's actually a service unavailable error (only for real infrastructure issues)
|
|
714
|
+
if (error.response?.status === 503 && content.length <= 50000) {
|
|
715
|
+
throw new Error(`i18n-agent encountered unexpected problem, and we are working on it, try again later.`);
|
|
716
|
+
}
|
|
717
|
+
|
|
711
718
|
if (error.code === 'ECONNREFUSED' ||
|
|
712
719
|
error.code === 'ETIMEDOUT' ||
|
|
713
720
|
error.code === 'ENOTFOUND' ||
|
|
714
|
-
(error.response?.status === 503 && content.length <= 50000) ||
|
|
715
721
|
error.response?.status === 502 ||
|
|
716
722
|
error.response?.status === 504) {
|
|
717
723
|
const serviceErrorDetails = error.response?.data?.result?.content?.[0]?.text ||
|
|
@@ -1301,7 +1307,7 @@ async function handleCheckTranslationStatus(args) {
|
|
|
1301
1307
|
|
|
1302
1308
|
// Handle 503 service unavailable
|
|
1303
1309
|
if (error.response?.status === 503) {
|
|
1304
|
-
throw new Error(`
|
|
1310
|
+
throw new Error(`i18n-agent encountered unexpected problem, and we are working on it, try again later.`);
|
|
1305
1311
|
}
|
|
1306
1312
|
|
|
1307
1313
|
// Handle 404 not found
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@i18n-agent/mcp-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
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": {
|