@better-i18n/mcp-server 0.1.5 → 0.2.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 +13 -9
- package/dist/base-tool.d.ts +43 -0
- package/dist/base-tool.d.ts.map +1 -0
- package/dist/base-tool.js +67 -0
- package/dist/base-tool.js.map +1 -0
- package/dist/helpers.d.ts +30 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +32 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.js +12 -51
- package/dist/index.js.map +1 -1
- package/dist/tools/bulkCreateKeys.d.ts +0 -1
- package/dist/tools/bulkCreateKeys.d.ts.map +1 -1
- package/dist/tools/bulkCreateKeys.js +28 -79
- package/dist/tools/bulkCreateKeys.js.map +1 -1
- package/dist/tools/bulkUpdateTranslations.d.ts +0 -1
- package/dist/tools/bulkUpdateTranslations.d.ts.map +1 -1
- package/dist/tools/bulkUpdateTranslations.js +27 -78
- package/dist/tools/bulkUpdateTranslations.js.map +1 -1
- package/dist/tools/createTranslationKey.d.ts +0 -1
- package/dist/tools/createTranslationKey.d.ts.map +1 -1
- package/dist/tools/createTranslationKey.js +25 -76
- package/dist/tools/createTranslationKey.js.map +1 -1
- package/dist/tools/getProjectInfo.d.ts +0 -1
- package/dist/tools/getProjectInfo.d.ts.map +1 -1
- package/dist/tools/getProjectInfo.js +11 -62
- package/dist/tools/getProjectInfo.js.map +1 -1
- package/dist/tools/listKeys.d.ts +0 -1
- package/dist/tools/listKeys.d.ts.map +1 -1
- package/dist/tools/listKeys.js +17 -67
- package/dist/tools/listKeys.js.map +1 -1
- package/dist/tools/updateTranslation.d.ts +0 -1
- package/dist/tools/updateTranslation.d.ts.map +1 -1
- package/dist/tools/updateTranslation.js +26 -77
- package/dist/tools/updateTranslation.js.map +1 -1
- package/dist/types/index.d.ts +1 -8
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/context.d.ts +0 -23
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js +0 -154
- package/dist/context.js.map +0 -1
package/README.md
CHANGED
|
@@ -5,10 +5,10 @@ MCP (Model Context Protocol) server for [Better i18n](https://better-i18n.com).
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- 🤖 **AI-Powered Translation** - Let AI handle your i18n workflow
|
|
8
|
+
- ⚡ **Instant Startup** - No filesystem scanning, starts immediately
|
|
8
9
|
- 📝 **Create & Update Keys** - Add new keys with source text and translations
|
|
9
10
|
- 🔄 **Bulk Operations** - Create/update multiple keys at once
|
|
10
|
-
- 🔍 **Smart Filtering** - Find keys by name, namespace, or
|
|
11
|
-
- 🌍 **Multi-language** - Manage all your target languages
|
|
11
|
+
- 🔍 **Smart Filtering** - Find keys by name, namespace, or search
|
|
12
12
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
@@ -40,6 +40,8 @@ export const i18n = createI18n({
|
|
|
40
40
|
});
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
The AI assistant will read this file to get the `project` value and include it in all tool calls.
|
|
44
|
+
|
|
43
45
|
### 3. Configure Cursor
|
|
44
46
|
|
|
45
47
|
Add to `~/.cursor/mcp.json`:
|
|
@@ -60,14 +62,16 @@ Add to `~/.cursor/mcp.json`:
|
|
|
60
62
|
|
|
61
63
|
## Available Tools
|
|
62
64
|
|
|
65
|
+
All tools require a `project` parameter in `org/project` format (e.g., `aliosman-co/personal`).
|
|
66
|
+
|
|
63
67
|
| Tool | Description |
|
|
64
68
|
|------|-------------|
|
|
65
69
|
| `getProjectInfo` | Get project overview: namespaces, languages, key count |
|
|
66
70
|
| `listKeys` | List all translation keys with filtering |
|
|
67
|
-
| `createTranslationKey` | Create a single key with
|
|
68
|
-
| `bulkCreateKeys` | Create multiple keys at once |
|
|
71
|
+
| `createTranslationKey` | Create a single key with source text |
|
|
72
|
+
| `bulkCreateKeys` | Create multiple keys at once (more efficient) |
|
|
69
73
|
| `updateTranslation` | Update a single translation |
|
|
70
|
-
| `bulkUpdateTranslations` | Update multiple translations at once |
|
|
74
|
+
| `bulkUpdateTranslations` | Update multiple translations at once (more efficient) |
|
|
71
75
|
|
|
72
76
|
## Example Prompts
|
|
73
77
|
|
|
@@ -83,9 +87,9 @@ Ask your AI assistant:
|
|
|
83
87
|
|
|
84
88
|
## How It Works
|
|
85
89
|
|
|
86
|
-
1.
|
|
87
|
-
2. AI
|
|
88
|
-
3. Changes sync to Better i18n dashboard
|
|
90
|
+
1. AI reads `project` value from your `i18n.ts` config
|
|
91
|
+
2. AI uses tools with `project` parameter for each request
|
|
92
|
+
3. Changes sync to Better i18n dashboard via API
|
|
89
93
|
4. CDN serves updated translations to your app
|
|
90
94
|
|
|
91
95
|
## Environment Variables
|
|
@@ -93,7 +97,7 @@ Ask your AI assistant:
|
|
|
93
97
|
| Variable | Required | Description |
|
|
94
98
|
|----------|----------|-------------|
|
|
95
99
|
| `BETTER_I18N_API_KEY` | Yes | Your API key |
|
|
96
|
-
| `BETTER_I18N_API_URL` | No | API URL (
|
|
100
|
+
| `BETTER_I18N_API_URL` | No | API URL (default: dash.better-i18n.com) |
|
|
97
101
|
| `BETTER_I18N_DEBUG` | No | Enable verbose logging |
|
|
98
102
|
|
|
99
103
|
## License
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base Tool Utilities
|
|
3
|
+
*
|
|
4
|
+
* Common patterns and helpers for MCP tools.
|
|
5
|
+
* All tools work with project-scoped operations.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { type ParsedProject } from "./helpers.js";
|
|
9
|
+
import type { ToolResult } from "./types/index.js";
|
|
10
|
+
/**
|
|
11
|
+
* Common project schema - all tools require this
|
|
12
|
+
*/
|
|
13
|
+
export declare const projectSchema: z.ZodObject<{
|
|
14
|
+
project: z.ZodString;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
project: string;
|
|
17
|
+
}, {
|
|
18
|
+
project: string;
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Project field definition for tool inputSchema
|
|
22
|
+
*/
|
|
23
|
+
export declare const projectInputProperty: {
|
|
24
|
+
project: {
|
|
25
|
+
type: "string";
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Creates a successful tool result
|
|
31
|
+
*/
|
|
32
|
+
export declare function success(data: Record<string, unknown>): ToolResult;
|
|
33
|
+
/**
|
|
34
|
+
* Creates an error tool result
|
|
35
|
+
*/
|
|
36
|
+
export declare function error(message: string): ToolResult;
|
|
37
|
+
/**
|
|
38
|
+
* Wraps tool execution with common error handling
|
|
39
|
+
*/
|
|
40
|
+
export declare function executeTool<T extends {
|
|
41
|
+
project: string;
|
|
42
|
+
}>(args: unknown, schema: z.ZodType<T>, handler: (input: T, parsed: ParsedProject) => Promise<ToolResult>): Promise<ToolResult>;
|
|
43
|
+
//# sourceMappingURL=base-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-tool.d.ts","sourceRoot":"","sources":["../src/base-tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;EAExB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;CAMhC,CAAC;AAEF;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,CASjE;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAUjD;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,CAAC,SAAS;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,EAC7D,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EACpB,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,UAAU,CAAC,GAChE,OAAO,CAAC,UAAU,CAAC,CAWrB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base Tool Utilities
|
|
3
|
+
*
|
|
4
|
+
* Common patterns and helpers for MCP tools.
|
|
5
|
+
* All tools work with project-scoped operations.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { parseProject } from "./helpers.js";
|
|
9
|
+
/**
|
|
10
|
+
* Common project schema - all tools require this
|
|
11
|
+
*/
|
|
12
|
+
export const projectSchema = z.object({
|
|
13
|
+
project: z.string().min(1),
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* Project field definition for tool inputSchema
|
|
17
|
+
*/
|
|
18
|
+
export const projectInputProperty = {
|
|
19
|
+
project: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Project identifier in 'org/project' format (e.g., 'aliosman-co/personal'). Get this from the project's i18n.ts config file.",
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Creates a successful tool result
|
|
26
|
+
*/
|
|
27
|
+
export function success(data) {
|
|
28
|
+
return {
|
|
29
|
+
content: [
|
|
30
|
+
{
|
|
31
|
+
type: "text",
|
|
32
|
+
text: JSON.stringify(data, null, 2),
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Creates an error tool result
|
|
39
|
+
*/
|
|
40
|
+
export function error(message) {
|
|
41
|
+
return {
|
|
42
|
+
content: [
|
|
43
|
+
{
|
|
44
|
+
type: "text",
|
|
45
|
+
text: message,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
isError: true,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Wraps tool execution with common error handling
|
|
53
|
+
*/
|
|
54
|
+
export async function executeTool(args, schema, handler) {
|
|
55
|
+
try {
|
|
56
|
+
const input = schema.parse(args);
|
|
57
|
+
const parsed = parseProject(input.project);
|
|
58
|
+
return await handler(input, parsed);
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
if (err instanceof z.ZodError) {
|
|
62
|
+
return error(`Validation error: ${err.errors.map(e => e.message).join(", ")}`);
|
|
63
|
+
}
|
|
64
|
+
return error(err instanceof Error ? err.message : String(err));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=base-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-tool.js","sourceRoot":"","sources":["../src/base-tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAsB,MAAM,cAAc,CAAC;AAGhE;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC3B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,OAAO,EAAE;QACP,IAAI,EAAE,QAAiB;QACvB,WAAW,EACT,6HAA6H;KAChI;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,IAA6B;IACnD,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;aACpC;SACF;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,KAAK,CAAC,OAAe;IACnC,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,OAAO;aACd;SACF;QACD,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAAa,EACb,MAAoB,EACpB,OAAiE;IAEjE,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjC,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,MAAM,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;YAC9B,OAAO,KAAK,CAAC,qBAAqB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjF,CAAC;QACD,OAAO,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACjE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Server Helpers
|
|
3
|
+
*
|
|
4
|
+
* Shared utility functions for MCP tools.
|
|
5
|
+
* Uses the same project format as @better-i18n/next package.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Parsed project identifier - same structure as @better-i18n/next
|
|
9
|
+
*/
|
|
10
|
+
export interface ParsedProject {
|
|
11
|
+
workspaceId: string;
|
|
12
|
+
projectSlug: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Parse project string "org/slug" into workspaceId and projectSlug.
|
|
16
|
+
* Same format used in @better-i18n/next package's i18n.ts config.
|
|
17
|
+
*
|
|
18
|
+
* @param project - Project identifier (e.g., "aliosman-co/personal")
|
|
19
|
+
* @returns Parsed project with workspaceId and projectSlug
|
|
20
|
+
* @throws Error if format is invalid
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const { workspaceId, projectSlug } = parseProject("aliosman-co/personal");
|
|
25
|
+
* // workspaceId: "aliosman-co"
|
|
26
|
+
* // projectSlug: "personal"
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseProject(project: string): ParsedProject;
|
|
30
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,CAW3D"}
|
package/dist/helpers.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Server Helpers
|
|
3
|
+
*
|
|
4
|
+
* Shared utility functions for MCP tools.
|
|
5
|
+
* Uses the same project format as @better-i18n/next package.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Parse project string "org/slug" into workspaceId and projectSlug.
|
|
9
|
+
* Same format used in @better-i18n/next package's i18n.ts config.
|
|
10
|
+
*
|
|
11
|
+
* @param project - Project identifier (e.g., "aliosman-co/personal")
|
|
12
|
+
* @returns Parsed project with workspaceId and projectSlug
|
|
13
|
+
* @throws Error if format is invalid
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const { workspaceId, projectSlug } = parseProject("aliosman-co/personal");
|
|
18
|
+
* // workspaceId: "aliosman-co"
|
|
19
|
+
* // projectSlug: "personal"
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export function parseProject(project) {
|
|
23
|
+
const parts = project.split("/");
|
|
24
|
+
if (parts.length !== 2 || !parts[0] || !parts[1]) {
|
|
25
|
+
throw new Error(`Invalid project format "${project}". Expected "org/project" (e.g., "aliosman-co/personal")`);
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
workspaceId: parts[0],
|
|
29
|
+
projectSlug: parts[1],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,KAAK,CACb,2BAA2B,OAAO,0DAA0D,CAC7F,CAAC;IACJ,CAAC;IACD,OAAO;QACL,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;QACrB,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;KACtB,CAAC;AACJ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,6 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
|
10
10
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
11
11
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
12
12
|
import { createBetterI18nClient } from "./client.js";
|
|
13
|
-
import { detectProjectContext } from "./context.js";
|
|
14
13
|
import { bulkCreateKeys } from "./tools/bulkCreateKeys.js";
|
|
15
14
|
import { bulkUpdateTranslations } from "./tools/bulkUpdateTranslations.js";
|
|
16
15
|
import { createTranslationKey } from "./tools/createTranslationKey.js";
|
|
@@ -20,76 +19,38 @@ import { updateTranslation } from "./tools/updateTranslation.js";
|
|
|
20
19
|
class BetterI18nServer {
|
|
21
20
|
server;
|
|
22
21
|
apiClient;
|
|
23
|
-
context;
|
|
24
22
|
constructor() {
|
|
25
23
|
this.server = new Server({
|
|
26
24
|
name: "better-i18n",
|
|
27
|
-
version: "0.
|
|
25
|
+
version: "0.2.0",
|
|
28
26
|
}, {
|
|
29
27
|
capabilities: {
|
|
30
28
|
tools: {},
|
|
31
29
|
},
|
|
32
30
|
});
|
|
33
|
-
// Will be initialized in init()
|
|
34
31
|
this.apiClient = null;
|
|
35
|
-
this.context = {
|
|
36
|
-
projectContext: null,
|
|
37
|
-
};
|
|
38
32
|
}
|
|
39
33
|
async init() {
|
|
40
34
|
// Auto-detect if running from source (local dev) vs npm package (production)
|
|
41
|
-
// If script path contains 'packages/mcp-server/src', we're in local development
|
|
42
35
|
const scriptPath = process.argv[1] || "";
|
|
43
36
|
const isLocalDev = scriptPath.includes("packages/mcp-server/src") ||
|
|
44
37
|
scriptPath.includes("better-i18n/packages/mcp-server");
|
|
45
|
-
// Read configuration from environment
|
|
38
|
+
// Read configuration from environment
|
|
46
39
|
const apiUrl = process.env.BETTER_I18N_API_URL ||
|
|
47
40
|
(isLocalDev ? "http://localhost:8787" : "https://dash.better-i18n.com");
|
|
48
41
|
const apiKey = process.env.BETTER_I18N_API_KEY;
|
|
49
|
-
const envOrgId = process.env.BETTER_I18N_ORG_ID;
|
|
50
42
|
const debug = process.env.BETTER_I18N_DEBUG === "true" || isLocalDev;
|
|
51
43
|
console.error(`[better-i18n] Mode: ${isLocalDev ? "LOCAL DEV" : "PRODUCTION"}`);
|
|
52
44
|
console.error(`[better-i18n] API URL: ${apiUrl}`);
|
|
53
|
-
if (debug)
|
|
54
|
-
console.error(`[better-i18n] Debug mode: enabled`);
|
|
55
45
|
if (!apiKey) {
|
|
56
46
|
console.error("[better-i18n] ERROR: BETTER_I18N_API_KEY environment variable is required");
|
|
57
|
-
console.error("[better-i18n] Get your API key from: https://better-i18n.com/settings/api-keys");
|
|
47
|
+
console.error("[better-i18n] Get your API key from: https://dash.better-i18n.com/settings/api-keys");
|
|
58
48
|
process.exit(1);
|
|
59
49
|
}
|
|
60
|
-
//
|
|
61
|
-
this.
|
|
62
|
-
// Resolve organization ID
|
|
63
|
-
let organizationId = envOrgId;
|
|
64
|
-
if (!organizationId && this.context.projectContext?.workspaceId) {
|
|
65
|
-
// Try to lookup org ID from slug using the API
|
|
66
|
-
try {
|
|
67
|
-
const authUrl = apiUrl.replace(/\/$/, "") + "/api/auth/organization/list";
|
|
68
|
-
const response = await fetch(authUrl, {
|
|
69
|
-
headers: { "x-api-key": apiKey },
|
|
70
|
-
});
|
|
71
|
-
if (response.ok) {
|
|
72
|
-
const orgs = await response.json();
|
|
73
|
-
const matchingOrg = orgs.find((org) => org.slug === this.context.projectContext?.workspaceId);
|
|
74
|
-
if (matchingOrg) {
|
|
75
|
-
organizationId = matchingOrg.id;
|
|
76
|
-
console.error(`[better-i18n] Resolved org "${matchingOrg.slug}" -> ${organizationId}`);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
catch (err) {
|
|
81
|
-
console.error("[better-i18n] Warning: Could not lookup organization ID:", err);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
// Create Better i18n API client with organization context
|
|
85
|
-
this.apiClient = createBetterI18nClient({ apiUrl, apiKey, organizationId, debug });
|
|
86
|
-
if (this.context.projectContext) {
|
|
87
|
-
console.error(`[better-i18n] Detected project: ${this.context.projectContext.workspaceId}/${this.context.projectContext.projectSlug}`);
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
console.error("[better-i18n] Warning: No i18n.config.ts found. Tools will require explicit projectSlug parameter.");
|
|
91
|
-
}
|
|
50
|
+
// Create Better i18n API client
|
|
51
|
+
this.apiClient = createBetterI18nClient({ apiUrl, apiKey, debug });
|
|
92
52
|
this.setupHandlers();
|
|
53
|
+
console.error("[better-i18n] MCP Server ready");
|
|
93
54
|
}
|
|
94
55
|
setupHandlers() {
|
|
95
56
|
// List available tools
|
|
@@ -110,22 +71,22 @@ class BetterI18nServer {
|
|
|
110
71
|
let result;
|
|
111
72
|
switch (name) {
|
|
112
73
|
case "getProjectInfo":
|
|
113
|
-
result = await getProjectInfo.execute(this.apiClient, args
|
|
74
|
+
result = await getProjectInfo.execute(this.apiClient, args);
|
|
114
75
|
break;
|
|
115
76
|
case "createTranslationKey":
|
|
116
|
-
result = await createTranslationKey.execute(this.apiClient, args
|
|
77
|
+
result = await createTranslationKey.execute(this.apiClient, args);
|
|
117
78
|
break;
|
|
118
79
|
case "updateTranslation":
|
|
119
|
-
result = await updateTranslation.execute(this.apiClient, args
|
|
80
|
+
result = await updateTranslation.execute(this.apiClient, args);
|
|
120
81
|
break;
|
|
121
82
|
case "listKeys":
|
|
122
|
-
result = await listKeys.execute(this.apiClient, args
|
|
83
|
+
result = await listKeys.execute(this.apiClient, args);
|
|
123
84
|
break;
|
|
124
85
|
case "bulkCreateKeys":
|
|
125
|
-
result = await bulkCreateKeys.execute(this.apiClient, args
|
|
86
|
+
result = await bulkCreateKeys.execute(this.apiClient, args);
|
|
126
87
|
break;
|
|
127
88
|
case "bulkUpdateTranslations":
|
|
128
|
-
result = await bulkUpdateTranslations.execute(this.apiClient, args
|
|
89
|
+
result = await bulkUpdateTranslations.execute(this.apiClient, args);
|
|
129
90
|
break;
|
|
130
91
|
default:
|
|
131
92
|
throw new Error(`Unknown tool: ${name}`);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,gBAAgB;IACZ,MAAM,CAAS;IACf,SAAS,CAAM;IAEvB;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CACtB;YACE,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,OAAO;SACjB,EACD;YACE,YAAY,EAAE;gBACZ,KAAK,EAAE,EAAE;aACV;SACF,CACF,CAAC;QAEF,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACx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BACpE,MAAM;oBACR;wBACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;gBAC7C,CAAC;gBAED,OAAO,MAAM,CAAC;YAChB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,mBAAmB,IAAI,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;yBAC3F;qBACF;oBACD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,GAAG;QACP,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC7C,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACrC,OAAO,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC7D,CAAC;CACF;AAED,mBAAmB;AACnB,MAAM,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;AACtC,MAAM,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrD,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;IACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* bulkCreateKeys MCP Tool
|
|
3
3
|
*
|
|
4
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
5
|
*/
|
|
7
6
|
import type { Tool } from "../types/index.js";
|
|
8
7
|
export declare const bulkCreateKeys: Tool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulkCreateKeys.d.ts","sourceRoot":"","sources":["../../src/tools/bulkCreateKeys.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bulkCreateKeys.d.ts","sourceRoot":"","sources":["../../src/tools/bulkCreateKeys.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAa9C,eAAO,MAAM,cAAc,EAAE,IA8D5B,CAAC"}
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
* bulkCreateKeys MCP Tool
|
|
3
3
|
*
|
|
4
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
5
|
*/
|
|
7
|
-
import { z } from
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { executeTool, projectInputProperty, projectSchema, success, } from "../base-tool.js";
|
|
8
|
+
const inputSchema = projectSchema.extend({
|
|
10
9
|
keys: z.array(z.object({
|
|
11
10
|
key: z.string(),
|
|
12
11
|
namespace: z.string().optional(),
|
|
@@ -17,14 +16,11 @@ const inputSchema = z.object({
|
|
|
17
16
|
export const bulkCreateKeys = {
|
|
18
17
|
definition: {
|
|
19
18
|
name: "bulkCreateKeys",
|
|
20
|
-
description: "Create multiple translation keys in a SINGLE efficient request. ALWAYS use this instead of calling createTranslationKey multiple times
|
|
19
|
+
description: "Create multiple translation keys in a SINGLE efficient request. ALWAYS use this instead of calling createTranslationKey multiple times when adding 2 or more keys.",
|
|
21
20
|
inputSchema: {
|
|
22
21
|
type: "object",
|
|
23
22
|
properties: {
|
|
24
|
-
|
|
25
|
-
type: "string",
|
|
26
|
-
description: "Project slug (optional if i18n.config.ts exists)",
|
|
27
|
-
},
|
|
23
|
+
...projectInputProperty,
|
|
28
24
|
keys: {
|
|
29
25
|
type: "array",
|
|
30
26
|
description: "Array of translation keys to create",
|
|
@@ -33,11 +29,11 @@ export const bulkCreateKeys = {
|
|
|
33
29
|
properties: {
|
|
34
30
|
key: {
|
|
35
31
|
type: "string",
|
|
36
|
-
description: "Translation key WITHOUT namespace prefix when namespace is provided
|
|
32
|
+
description: "Translation key WITHOUT namespace prefix when namespace is provided.",
|
|
37
33
|
},
|
|
38
34
|
namespace: {
|
|
39
35
|
type: "string",
|
|
40
|
-
description: "Namespace for the key
|
|
36
|
+
description: "Namespace for the key. Defaults to 'default'.",
|
|
41
37
|
},
|
|
42
38
|
sourceText: {
|
|
43
39
|
type: "string",
|
|
@@ -45,81 +41,34 @@ export const bulkCreateKeys = {
|
|
|
45
41
|
},
|
|
46
42
|
translations: {
|
|
47
43
|
type: "object",
|
|
48
|
-
description: "Translations for other languages. Keys are language codes
|
|
44
|
+
description: "Translations for other languages. Keys are language codes, values are translated text.",
|
|
49
45
|
},
|
|
50
46
|
},
|
|
51
47
|
required: ["key", "sourceText"],
|
|
52
48
|
},
|
|
53
49
|
},
|
|
54
50
|
},
|
|
55
|
-
required: ["keys"],
|
|
51
|
+
required: ["project", "keys"],
|
|
56
52
|
},
|
|
57
53
|
},
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
orgSlug
|
|
67
|
-
projectSlug
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
{
|
|
78
|
-
type: "text",
|
|
79
|
-
text: "Error: Project not specified. Use format 'org/project' (e.g., 'aliosman-co/personal')",
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
isError: true,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
try {
|
|
86
|
-
// Format keys with default namespace
|
|
87
|
-
const formattedKeys = input.keys.map((k) => ({
|
|
88
|
-
key: k.key,
|
|
89
|
-
namespace: k.namespace || "default",
|
|
90
|
-
sourceText: k.sourceText,
|
|
91
|
-
translations: k.translations,
|
|
92
|
-
}));
|
|
93
|
-
const result = await client.mcp.bulkCreateKeys.mutate({
|
|
94
|
-
orgSlug,
|
|
95
|
-
projectSlug,
|
|
96
|
-
keys: formattedKeys,
|
|
97
|
-
});
|
|
98
|
-
return {
|
|
99
|
-
content: [
|
|
100
|
-
{
|
|
101
|
-
type: "text",
|
|
102
|
-
text: JSON.stringify({
|
|
103
|
-
success: true,
|
|
104
|
-
project: `${orgSlug}/${projectSlug}`,
|
|
105
|
-
keysCreated: result.keysCreated,
|
|
106
|
-
keys: result.keys,
|
|
107
|
-
}, null, 2),
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
catch (error) {
|
|
113
|
-
return {
|
|
114
|
-
content: [
|
|
115
|
-
{
|
|
116
|
-
type: "text",
|
|
117
|
-
text: `Error creating translation keys: ${error instanceof Error ? error.message : String(error)}`,
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
isError: true,
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
},
|
|
54
|
+
execute: (client, args) => executeTool(args, inputSchema, async (input, { workspaceId, projectSlug }) => {
|
|
55
|
+
const formattedKeys = input.keys.map((k) => ({
|
|
56
|
+
key: k.key,
|
|
57
|
+
namespace: k.namespace || "default",
|
|
58
|
+
sourceText: k.sourceText,
|
|
59
|
+
translations: k.translations,
|
|
60
|
+
}));
|
|
61
|
+
const result = await client.mcp.bulkCreateKeys.mutate({
|
|
62
|
+
orgSlug: workspaceId,
|
|
63
|
+
projectSlug,
|
|
64
|
+
keys: formattedKeys,
|
|
65
|
+
});
|
|
66
|
+
return success({
|
|
67
|
+
success: true,
|
|
68
|
+
project: input.project,
|
|
69
|
+
keysCreated: result.keysCreated,
|
|
70
|
+
keys: result.keys,
|
|
71
|
+
});
|
|
72
|
+
}),
|
|
124
73
|
};
|
|
125
74
|
//# sourceMappingURL=bulkCreateKeys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulkCreateKeys.js","sourceRoot":"","sources":["../../src/tools/bulkCreateKeys.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bulkCreateKeys.js","sourceRoot":"","sources":["../../src/tools/bulkCreateKeys.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,OAAO,GACR,MAAM,iBAAiB,CAAC;AAGzB,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,CAAC,CAAC,KAAK,CACX,CAAC,CAAC,MAAM,CAAC;QACP,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,CACH;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAS;IAClC,UAAU,EAAE;QACV,IAAI,EAAE,gBAAgB;QACtB,WAAW,EACT,oKAAoK;QACtK,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,GAAG,oBAAoB;gBACvB,IAAI,EAAE;oBACJ,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,qCAAqC;oBAClD,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,GAAG,EAAE;gCACH,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,sEAAsE;6BACpF;4BACD,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|
*
|
|
4
4
|
* Updates translations for multiple keys in a single request.
|
|
5
|
-
* Perfect for batch updating translations across multiple languages.
|
|
6
5
|
*/
|
|
7
6
|
import type { Tool } from "../types/index.js";
|
|
8
7
|
export declare const bulkUpdateTranslations: Tool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulkUpdateTranslations.d.ts","sourceRoot":"","sources":["../../src/tools/bulkUpdateTranslations.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bulkUpdateTranslations.d.ts","sourceRoot":"","sources":["../../src/tools/bulkUpdateTranslations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAY9C,eAAO,MAAM,sBAAsB,EAAE,IAyDpC,CAAC"}
|