@better-i18n/mcp-server 0.1.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 +158 -0
- package/dist/client.d.ts +17 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +34 -0
- package/dist/client.js.map +1 -0
- package/dist/context.d.ts +23 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +142 -0
- package/dist/context.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +149 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/bulkCreateKeys.d.ts +9 -0
- package/dist/tools/bulkCreateKeys.d.ts.map +1 -0
- package/dist/tools/bulkCreateKeys.js +113 -0
- package/dist/tools/bulkCreateKeys.js.map +1 -0
- package/dist/tools/bulkUpdateTranslations.d.ts +9 -0
- package/dist/tools/bulkUpdateTranslations.d.ts.map +1 -0
- package/dist/tools/bulkUpdateTranslations.js +107 -0
- package/dist/tools/bulkUpdateTranslations.js.map +1 -0
- package/dist/tools/createTranslationKey.d.ts +9 -0
- package/dist/tools/createTranslationKey.d.ts.map +1 -0
- package/dist/tools/createTranslationKey.js +95 -0
- package/dist/tools/createTranslationKey.js.map +1 -0
- package/dist/tools/getProjectInfo.d.ts +9 -0
- package/dist/tools/getProjectInfo.d.ts.map +1 -0
- package/dist/tools/getProjectInfo.js +67 -0
- package/dist/tools/getProjectInfo.js.map +1 -0
- package/dist/tools/listKeys.d.ts +9 -0
- package/dist/tools/listKeys.d.ts.map +1 -0
- package/dist/tools/listKeys.js +113 -0
- package/dist/tools/listKeys.js.map +1 -0
- package/dist/tools/updateTranslation.d.ts +9 -0
- package/dist/tools/updateTranslation.d.ts.map +1 -0
- package/dist/tools/updateTranslation.js +101 -0
- package/dist/tools/updateTranslation.js.map +1 -0
- package/dist/types/index.d.ts +44 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bulkCreateKeys MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Creates multiple translation keys with all translations in a single request.
|
|
5
|
+
* Perfect for adding entire components or pages worth of translations at once.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
const inputSchema = z.object({
|
|
9
|
+
projectSlug: z.string().optional(),
|
|
10
|
+
keys: z.array(z.object({
|
|
11
|
+
key: z.string(),
|
|
12
|
+
namespace: z.string().optional(),
|
|
13
|
+
sourceText: z.string(),
|
|
14
|
+
translations: z.record(z.string(), z.string()).optional(),
|
|
15
|
+
})),
|
|
16
|
+
});
|
|
17
|
+
export const bulkCreateKeys = {
|
|
18
|
+
definition: {
|
|
19
|
+
name: "bulkCreateKeys",
|
|
20
|
+
description: "Create multiple translation keys with their translations in a single request. Use this when adding translations for an entire component or page. Each key can have sourceText (English) and translations for other languages.",
|
|
21
|
+
inputSchema: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
projectSlug: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: "Project slug (optional if i18n.config.ts exists)",
|
|
27
|
+
},
|
|
28
|
+
keys: {
|
|
29
|
+
type: "array",
|
|
30
|
+
description: "Array of translation keys to create",
|
|
31
|
+
items: {
|
|
32
|
+
type: "object",
|
|
33
|
+
properties: {
|
|
34
|
+
key: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "Translation key (e.g., 'nav.features')",
|
|
37
|
+
},
|
|
38
|
+
namespace: {
|
|
39
|
+
type: "string",
|
|
40
|
+
description: "Namespace (e.g., 'nav', 'home'). Defaults to 'default'",
|
|
41
|
+
},
|
|
42
|
+
sourceText: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "English source text",
|
|
45
|
+
},
|
|
46
|
+
translations: {
|
|
47
|
+
type: "object",
|
|
48
|
+
description: "Translations for other languages. Keys are language codes (tr, de, fr), values are translated text",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
required: ["key", "sourceText"],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
required: ["keys"],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
async execute(client, args, context) {
|
|
59
|
+
const input = inputSchema.parse(args);
|
|
60
|
+
const projectSlug = input.projectSlug || context.projectContext?.projectSlug;
|
|
61
|
+
const orgSlug = context.projectContext?.workspaceId;
|
|
62
|
+
if (!projectSlug || !orgSlug) {
|
|
63
|
+
return {
|
|
64
|
+
content: [
|
|
65
|
+
{
|
|
66
|
+
type: "text",
|
|
67
|
+
text: "Error: Project not specified and no i18n.config.ts found in workspace",
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
isError: true,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
// Format keys with default namespace
|
|
75
|
+
const formattedKeys = input.keys.map(k => ({
|
|
76
|
+
key: k.key,
|
|
77
|
+
namespace: k.namespace || "default",
|
|
78
|
+
sourceText: k.sourceText,
|
|
79
|
+
translations: k.translations,
|
|
80
|
+
}));
|
|
81
|
+
const result = await client.mcp.bulkCreateKeys.mutate({
|
|
82
|
+
orgSlug,
|
|
83
|
+
projectSlug,
|
|
84
|
+
keys: formattedKeys,
|
|
85
|
+
});
|
|
86
|
+
return {
|
|
87
|
+
content: [
|
|
88
|
+
{
|
|
89
|
+
type: "text",
|
|
90
|
+
text: JSON.stringify({
|
|
91
|
+
success: true,
|
|
92
|
+
project: `${orgSlug}/${projectSlug}`,
|
|
93
|
+
keysCreated: result.keysCreated,
|
|
94
|
+
keys: result.keys,
|
|
95
|
+
}, null, 2),
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
return {
|
|
102
|
+
content: [
|
|
103
|
+
{
|
|
104
|
+
type: "text",
|
|
105
|
+
text: `Error creating translation keys: ${error instanceof Error ? error.message : String(error)}`,
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
isError: true,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=bulkCreateKeys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulkCreateKeys.js","sourceRoot":"","sources":["../../src/tools/bulkCreateKeys.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QACrB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;QACf,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;KAC1D,CAAC,CAAC;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAS;IAClC,UAAU,EAAE;QACV,IAAI,EAAE,gBAAgB;QACtB,WAAW,EACT,+NAA+N;QACjO,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,kDAAkD;iBAChE;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,qCAAqC;oBAClD,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,GAAG,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AAM,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC;gBACpD,OAAO;gBACP,WAAW;gBACX,IAAI,EAAE,aAAa;aACpB,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;4BACE,OAAO,EAAE,IAAI;4BACb,OAAO,EAAE,GAAG,OAAO,IAAI,WAAW,EAAE;4BACpC,WAAW,EAAE,MAAM,CAAC,WAAW;4BAC/B,IAAI,EAAE,MAAM,CAAC,IAAI;yBAClB,EACD,IAAI,EACJ,CAAC,CACF;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,oCAAoC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBACnG;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bulkUpdateTranslations MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Updates translations for multiple keys in a single request.
|
|
5
|
+
* Perfect for batch updating translations across multiple languages.
|
|
6
|
+
*/
|
|
7
|
+
import type { Tool } from "../types/index.js";
|
|
8
|
+
export declare const bulkUpdateTranslations: Tool;
|
|
9
|
+
//# sourceMappingURL=bulkUpdateTranslations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulkUpdateTranslations.d.ts","sourceRoot":"","sources":["../../src/tools/bulkUpdateTranslations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAW9C,eAAO,MAAM,sBAAsB,EAAE,IAqGpC,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bulkUpdateTranslations MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Updates translations for multiple keys in a single request.
|
|
5
|
+
* Perfect for batch updating translations across multiple languages.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
const inputSchema = z.object({
|
|
9
|
+
projectSlug: z.string().optional(),
|
|
10
|
+
updates: z.array(z.object({
|
|
11
|
+
key: z.string(),
|
|
12
|
+
namespace: z.string().optional(),
|
|
13
|
+
translations: z.record(z.string(), z.string()),
|
|
14
|
+
})),
|
|
15
|
+
});
|
|
16
|
+
export const bulkUpdateTranslations = {
|
|
17
|
+
definition: {
|
|
18
|
+
name: "bulkUpdateTranslations",
|
|
19
|
+
description: "Update translations for multiple keys in a single request. Use this when adding or updating translations for several keys at once. Each update specifies the key and translations for target languages.",
|
|
20
|
+
inputSchema: {
|
|
21
|
+
type: "object",
|
|
22
|
+
properties: {
|
|
23
|
+
projectSlug: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "Project slug (optional if i18n.config.ts exists)",
|
|
26
|
+
},
|
|
27
|
+
updates: {
|
|
28
|
+
type: "array",
|
|
29
|
+
description: "Array of translation updates",
|
|
30
|
+
items: {
|
|
31
|
+
type: "object",
|
|
32
|
+
properties: {
|
|
33
|
+
key: {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "Translation key to update",
|
|
36
|
+
},
|
|
37
|
+
namespace: {
|
|
38
|
+
type: "string",
|
|
39
|
+
description: "Namespace (e.g., 'nav', 'home'). Defaults to 'default'",
|
|
40
|
+
},
|
|
41
|
+
translations: {
|
|
42
|
+
type: "object",
|
|
43
|
+
description: "Translations for target languages. Keys are language codes (tr, de, fr), values are translated text",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
required: ["key", "translations"],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
required: ["updates"],
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
async execute(client, args, context) {
|
|
54
|
+
const input = inputSchema.parse(args);
|
|
55
|
+
const projectSlug = input.projectSlug || context.projectContext?.projectSlug;
|
|
56
|
+
const orgSlug = context.projectContext?.workspaceId;
|
|
57
|
+
if (!projectSlug || !orgSlug) {
|
|
58
|
+
return {
|
|
59
|
+
content: [
|
|
60
|
+
{
|
|
61
|
+
type: "text",
|
|
62
|
+
text: "Error: Project not specified and no i18n.config.ts found in workspace",
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
isError: true,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
// Format updates with default namespace
|
|
70
|
+
const formattedUpdates = input.updates.map(u => ({
|
|
71
|
+
key: u.key,
|
|
72
|
+
namespace: u.namespace || "default",
|
|
73
|
+
translations: u.translations,
|
|
74
|
+
}));
|
|
75
|
+
const result = await client.mcp.bulkUpdateTranslations.mutate({
|
|
76
|
+
orgSlug,
|
|
77
|
+
projectSlug,
|
|
78
|
+
updates: formattedUpdates,
|
|
79
|
+
});
|
|
80
|
+
return {
|
|
81
|
+
content: [
|
|
82
|
+
{
|
|
83
|
+
type: "text",
|
|
84
|
+
text: JSON.stringify({
|
|
85
|
+
success: true,
|
|
86
|
+
project: `${orgSlug}/${projectSlug}`,
|
|
87
|
+
keysUpdated: result.keysUpdated,
|
|
88
|
+
updates: result.updates,
|
|
89
|
+
}, null, 2),
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
return {
|
|
96
|
+
content: [
|
|
97
|
+
{
|
|
98
|
+
type: "text",
|
|
99
|
+
text: `Error updating translations: ${error instanceof Error ? error.message : String(error)}`,
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
isError: true,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=bulkUpdateTranslations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulkUpdateTranslations.js","sourceRoot":"","sources":["../../src/tools/bulkUpdateTranslations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QACxB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;QACf,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAChC,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;KAC/C,CAAC,CAAC;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAS;IAC1C,UAAU,EAAE;QACV,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EACT,yMAAyM;QAC3M,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,kDAAkD;iBAChE;gBACD,OAAO,EAAE;oBACP,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,8BAA8B;oBAC3C,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,GAAG,EAAE;gCACH,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,2BAA2B;6BACzC;4BACD,SAAS,EAAE;gCACT,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,wDAAwD;6BACtE;4BACD,YAAY,EAAE;gCACZ,IAA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AI,WAAW,EAAE;4BACpC,WAAW,EAAE,MAAM,CAAC,WAAW;4BAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;yBACxB,EACD,IAAI,EACJ,CAAC,CACF;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,gCAAgC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBAC/F;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createTranslationKey MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Creates a new translation key with source text in the default language.
|
|
5
|
+
* Uses the MCP-specific API that works with org/project slugs.
|
|
6
|
+
*/
|
|
7
|
+
import type { Tool } from "../types/index.js";
|
|
8
|
+
export declare const createTranslationKey: Tool;
|
|
9
|
+
//# sourceMappingURL=createTranslationKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTranslationKey.d.ts","sourceRoot":"","sources":["../../src/tools/createTranslationKey.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAS9C,eAAO,MAAM,oBAAoB,EAAE,IA0FlC,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createTranslationKey MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Creates a new translation key with source text in the default language.
|
|
5
|
+
* Uses the MCP-specific API that works with org/project slugs.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
const inputSchema = z.object({
|
|
9
|
+
projectSlug: z.string().optional(),
|
|
10
|
+
key: z.string().min(1),
|
|
11
|
+
sourceValue: z.string().min(1),
|
|
12
|
+
namespace: z.string().optional(),
|
|
13
|
+
});
|
|
14
|
+
export const createTranslationKey = {
|
|
15
|
+
definition: {
|
|
16
|
+
name: "createTranslationKey",
|
|
17
|
+
description: "Create a new translation key with source text. Namespace is auto-extracted from the key if it contains dots (e.g., 'auth.login' → namespace: 'auth'). If projectSlug is not provided, uses the project from i18n.config.ts in the workspace.",
|
|
18
|
+
inputSchema: {
|
|
19
|
+
type: "object",
|
|
20
|
+
properties: {
|
|
21
|
+
projectSlug: {
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "Project slug (optional if i18n.config.ts exists)",
|
|
24
|
+
},
|
|
25
|
+
key: {
|
|
26
|
+
type: "string",
|
|
27
|
+
description: "Translation key (e.g., 'auth.login.title', 'home.hero.cta')",
|
|
28
|
+
},
|
|
29
|
+
sourceValue: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "Source text in default language (usually English)",
|
|
32
|
+
},
|
|
33
|
+
namespace: {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "Optional explicit namespace override",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
required: ["key", "sourceValue"],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
async execute(client, args, context) {
|
|
42
|
+
const input = inputSchema.parse(args);
|
|
43
|
+
// Get project slug from args or context
|
|
44
|
+
const projectSlug = input.projectSlug || context.projectContext?.projectSlug;
|
|
45
|
+
const orgSlug = context.projectContext?.workspaceId;
|
|
46
|
+
if (!projectSlug || !orgSlug) {
|
|
47
|
+
return {
|
|
48
|
+
content: [
|
|
49
|
+
{
|
|
50
|
+
type: "text",
|
|
51
|
+
text: "Error: Project not specified and no i18n.config.ts found in workspace. Please provide projectSlug or run from a directory with i18n.config.ts",
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
isError: true,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
// Use MCP-specific endpoint with slug-based lookup
|
|
59
|
+
const result = await client.mcp.createKey.mutate({
|
|
60
|
+
orgSlug,
|
|
61
|
+
projectSlug,
|
|
62
|
+
key: input.key,
|
|
63
|
+
namespace: input.namespace || "default",
|
|
64
|
+
sourceText: input.sourceValue,
|
|
65
|
+
});
|
|
66
|
+
return {
|
|
67
|
+
content: [
|
|
68
|
+
{
|
|
69
|
+
type: "text",
|
|
70
|
+
text: JSON.stringify({
|
|
71
|
+
success: true,
|
|
72
|
+
keyId: result.keyId,
|
|
73
|
+
key: input.key,
|
|
74
|
+
namespace: input.namespace || "default",
|
|
75
|
+
sourceText: input.sourceValue,
|
|
76
|
+
project: `${orgSlug}/${projectSlug}`,
|
|
77
|
+
}, null, 2),
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
return {
|
|
84
|
+
content: [
|
|
85
|
+
{
|
|
86
|
+
type: "text",
|
|
87
|
+
text: `Error creating translation key: ${error instanceof Error ? error.message : String(error)}`,
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
isError: true,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=createTranslationKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTranslationKey.js","sourceRoot":"","sources":["../../src/tools/createTranslationKey.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,C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AAC,MAAM,CAAC;gBAC/C,OAAO;gBACP,WAAW;gBACX,GAAG,EAAE,KAAK,CAAC,GAAG;gBACd,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,SAAS;gBACvC,UAAU,EAAE,KAAK,CAAC,WAAW;aAC9B,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;4BACE,OAAO,EAAE,IAAI;4BACb,KAAK,EAAE,MAAM,CAAC,KAAK;4BACnB,GAAG,EAAE,KAAK,CAAC,GAAG;4BACd,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,SAAS;4BACvC,UAAU,EAAE,KAAK,CAAC,WAAW;4BAC7B,OAAO,EAAE,GAAG,OAAO,IAAI,WAAW,EAAE;yBACrC,EACD,IAAI,EACJ,CAAC,CACF;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,mCAAmC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBAClG;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* getProjectInfo MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Gets project information including available namespaces, languages, and stats.
|
|
5
|
+
* Useful for understanding the project structure before adding translations.
|
|
6
|
+
*/
|
|
7
|
+
import type { Tool } from "../types/index.js";
|
|
8
|
+
export declare const getProjectInfo: Tool;
|
|
9
|
+
//# sourceMappingURL=getProjectInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getProjectInfo.d.ts","sourceRoot":"","sources":["../../src/tools/getProjectInfo.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAM9C,eAAO,MAAM,cAAc,EAAE,IA6D5B,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* getProjectInfo MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Gets project information including available namespaces, languages, and stats.
|
|
5
|
+
* Useful for understanding the project structure before adding translations.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
const inputSchema = z.object({
|
|
9
|
+
projectSlug: z.string().optional(),
|
|
10
|
+
});
|
|
11
|
+
export const getProjectInfo = {
|
|
12
|
+
definition: {
|
|
13
|
+
name: "getProjectInfo",
|
|
14
|
+
description: "Get project information including available namespaces, languages, and key count. Use this to understand the project structure before adding or updating translations.",
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: "object",
|
|
17
|
+
properties: {
|
|
18
|
+
projectSlug: {
|
|
19
|
+
type: "string",
|
|
20
|
+
description: "Project slug (optional if i18n.config.ts exists)",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
async execute(client, args, context) {
|
|
26
|
+
const input = inputSchema.parse(args);
|
|
27
|
+
const projectSlug = input.projectSlug || context.projectContext?.projectSlug;
|
|
28
|
+
const orgSlug = context.projectContext?.workspaceId;
|
|
29
|
+
if (!projectSlug || !orgSlug) {
|
|
30
|
+
return {
|
|
31
|
+
content: [
|
|
32
|
+
{
|
|
33
|
+
type: "text",
|
|
34
|
+
text: "Error: Project not specified and no i18n.config.ts found in workspace",
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
isError: true,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
const result = await client.mcp.getProjectInfo.query({
|
|
42
|
+
orgSlug,
|
|
43
|
+
projectSlug,
|
|
44
|
+
});
|
|
45
|
+
return {
|
|
46
|
+
content: [
|
|
47
|
+
{
|
|
48
|
+
type: "text",
|
|
49
|
+
text: JSON.stringify(result, null, 2),
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
return {
|
|
56
|
+
content: [
|
|
57
|
+
{
|
|
58
|
+
type: "text",
|
|
59
|
+
text: `Error getting project info: ${error instanceof Error ? error.message : String(error)}`,
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
isError: true,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=getProjectInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getProjectInfo.js","sourceRoot":"","sources":["../../src/tools/getProjectInfo.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAS;IAClC,UAAU,EAAE;QACV,IAAI,EAAE,gBAAgB;QACtB,WAAW,EACT,wKAAwK;QAC1K,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,kDAAkD;iBAChE;aACF;SACF;KACF;IAED,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO;QACjC,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEtC,MAAM,WAAW,GACf,KAAK,CAAC,WAAW,IAAI,OAAO,CAAC,cAAc,EAAE,WAAW,CAAC;QAC3D,MAAM,OAAO,GAAG,OAAO,CAAC,cAAc,EAAE,WAAW,CAAC;QAEpD,IAAI,CAAC,WAAW,IAAI,CAAC,OAAO,EAAE,CAAC;YAC7B,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,uEAAuE;qBAC9E;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC;gBACnD,OAAO;gBACP,WAAW;aACZ,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;qBACtC;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,+BAA+B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBAC9F;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* listKeys MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Lists translation keys in a project with optional filtering.
|
|
5
|
+
* Uses the MCP-specific API that works with org/project slugs.
|
|
6
|
+
*/
|
|
7
|
+
import type { Tool } from "../types/index.js";
|
|
8
|
+
export declare const listKeys: Tool;
|
|
9
|
+
//# sourceMappingURL=listKeys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listKeys.d.ts","sourceRoot":"","sources":["../../src/tools/listKeys.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAW9C,eAAO,MAAM,QAAQ,EAAE,IA2GtB,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* listKeys MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Lists translation keys in a project with optional filtering.
|
|
5
|
+
* Uses the MCP-specific API that works with org/project slugs.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
const inputSchema = z.object({
|
|
9
|
+
projectSlug: z.string().optional(),
|
|
10
|
+
search: z.string().optional(),
|
|
11
|
+
namespaces: z.array(z.string()).optional(),
|
|
12
|
+
missingLanguage: z.string().optional(),
|
|
13
|
+
page: z.number().min(1).default(1),
|
|
14
|
+
limit: z.number().min(1).max(100).default(50),
|
|
15
|
+
});
|
|
16
|
+
export const listKeys = {
|
|
17
|
+
definition: {
|
|
18
|
+
name: "listKeys",
|
|
19
|
+
description: "List translation keys with optional search, namespace filter, and missing translation filter. Each key includes sourceText and all translations with their language codes.",
|
|
20
|
+
inputSchema: {
|
|
21
|
+
type: "object",
|
|
22
|
+
properties: {
|
|
23
|
+
projectSlug: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "Project slug (optional if i18n.config.ts exists)",
|
|
26
|
+
},
|
|
27
|
+
search: {
|
|
28
|
+
type: "string",
|
|
29
|
+
description: "Search query for keys (e.g., 'nav' to find nav.home, nav.features)",
|
|
30
|
+
},
|
|
31
|
+
namespaces: {
|
|
32
|
+
type: "array",
|
|
33
|
+
items: { type: "string" },
|
|
34
|
+
description: "Filter by specific namespaces (e.g., ['nav', 'home'])",
|
|
35
|
+
},
|
|
36
|
+
missingLanguage: {
|
|
37
|
+
type: "string",
|
|
38
|
+
description: "Find keys that don't have a translation for this language code (e.g., 'tr' to find keys missing Turkish)",
|
|
39
|
+
},
|
|
40
|
+
page: {
|
|
41
|
+
type: "number",
|
|
42
|
+
description: "Page number (default: 1)",
|
|
43
|
+
},
|
|
44
|
+
limit: {
|
|
45
|
+
type: "number",
|
|
46
|
+
description: "Results per page (default: 50, max: 100)",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
async execute(client, args, context) {
|
|
52
|
+
const input = inputSchema.parse(args);
|
|
53
|
+
// Get project slug from args or context
|
|
54
|
+
const projectSlug = input.projectSlug || context.projectContext?.projectSlug;
|
|
55
|
+
const orgSlug = context.projectContext?.workspaceId;
|
|
56
|
+
if (!projectSlug || !orgSlug) {
|
|
57
|
+
return {
|
|
58
|
+
content: [
|
|
59
|
+
{
|
|
60
|
+
type: "text",
|
|
61
|
+
text: "Error: Project not specified and no i18n.config.ts found in workspace",
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
isError: true,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
// Use MCP-specific endpoint with slug-based lookup
|
|
69
|
+
const result = await client.mcp.listKeys.query({
|
|
70
|
+
orgSlug,
|
|
71
|
+
projectSlug,
|
|
72
|
+
search: input.search,
|
|
73
|
+
namespaces: input.namespaces,
|
|
74
|
+
missingLanguage: input.missingLanguage,
|
|
75
|
+
page: input.page,
|
|
76
|
+
limit: input.limit,
|
|
77
|
+
});
|
|
78
|
+
// Format the response
|
|
79
|
+
const summary = {
|
|
80
|
+
project: `${orgSlug}/${projectSlug}`,
|
|
81
|
+
page: input.page,
|
|
82
|
+
limit: input.limit,
|
|
83
|
+
total: result.total,
|
|
84
|
+
totalPages: Math.ceil(result.total / input.limit),
|
|
85
|
+
keysCount: result.keys.length,
|
|
86
|
+
...(input.missingLanguage && { missingLanguage: input.missingLanguage }),
|
|
87
|
+
};
|
|
88
|
+
return {
|
|
89
|
+
content: [
|
|
90
|
+
{
|
|
91
|
+
type: "text",
|
|
92
|
+
text: JSON.stringify({
|
|
93
|
+
summary,
|
|
94
|
+
keys: result.keys,
|
|
95
|
+
}, null, 2),
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
return {
|
|
102
|
+
content: [
|
|
103
|
+
{
|
|
104
|
+
type: "text",
|
|
105
|
+
text: `Error listing keys: ${error instanceof Error ? error.message : String(error)}`,
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
isError: true,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=listKeys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listKeys.js","sourceRoot":"","sources":["../../src/tools/listKeys.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC1C,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAClC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CAC9C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAS;IAC5B,UAAU,EAAE;QACV,IAAI,EAAE,UAAU;QAChB,WAAW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MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Updates or creates a translation for a specific language.
|
|
5
|
+
* Uses the MCP-specific API that works with org/project slugs.
|
|
6
|
+
*/
|
|
7
|
+
import type { Tool } from "../types/index.js";
|
|
8
|
+
export declare const updateTranslation: Tool;
|
|
9
|
+
//# sourceMappingURL=updateTranslation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateTranslation.d.ts","sourceRoot":"","sources":["../../src/tools/updateTranslation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAU9C,eAAO,MAAM,iBAAiB,EAAE,IA+F/B,CAAC"}
|