@intlayer/mcp 9.5.12 → 9.6.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.
@@ -1,7 +1,7 @@
1
1
  import { dirname as dirname$1 } from "node:path";
2
2
  import { fileURLToPath } from "node:url";
3
- import { isESModule } from "@intlayer/config/utils";
4
3
  import { createMCPClient } from "@ai-sdk/mcp";
4
+ import { isESModule } from "@intlayer/config/utils";
5
5
 
6
6
  //#region src/client/client.ts
7
7
  const dirname = isESModule ? dirname$1(fileURLToPath(import.meta.url)) : __dirname;
@@ -5,9 +5,9 @@ import { loadInstallLSPTool } from "../tools/installLSP.mjs";
5
5
  import { loadInstallSkillsTool } from "../tools/installSkills.mjs";
6
6
  import { z } from "zod/mini";
7
7
  import { dirname as dirname$1, resolve } from "node:path";
8
- import { readFileSync } from "node:fs";
9
8
  import { fileURLToPath } from "node:url";
10
9
  import { isESModule } from "@intlayer/config/utils";
10
+ import { readFileSync } from "node:fs";
11
11
 
12
12
  //#region src/server/server.ts
13
13
  const dirname = isESModule ? dirname$1(fileURLToPath(import.meta.url)) : __dirname;
@@ -33,7 +33,7 @@ const configOptionsSchema = z.optional(z.object({
33
33
  const loadCLITools = async (server) => {
34
34
  server.registerTool("intlayer-init", {
35
35
  title: "Initialize Intlayer",
36
- description: "Initialize Intlayer in the project",
36
+ description: "Initialize Intlayer in the project: install the Intlayer packages and set up the framework (config, bundler plugin, middleware, providers). Other setup steps run through the `intlayer init <step>` CLI commands (github-actions, skills, mcp, vscode-extension, lsp, eslint)",
37
37
  inputSchema: { projectRoot: z.string().register(z.globalRegistry, { description: "Project root directory" }) },
38
38
  annotations: { destructiveHint: true }
39
39
  }, async ({ projectRoot }) => {
@@ -124,11 +124,22 @@ const loadCLITools = async (server) => {
124
124
  mode
125
125
  };
126
126
  }
127
- await fill(fillOptions);
128
- return { content: [{
129
- type: "text",
130
- text: "Fill successful."
131
- }] };
127
+ const fillResult = await fill(fillOptions);
128
+ if (fillResult.status !== "completed") return {
129
+ content: [{
130
+ type: "text",
131
+ text: fillResult.status === "no-ai-access" ? `Fill skipped: no AI access. ${fillResult.error ?? "Run \"intlayer login\" or configure an AI API key."}` : "Fill skipped: no dictionary matched the filters."
132
+ }],
133
+ isError: true
134
+ };
135
+ const failedCount = fillResult.taskCount - fillResult.writtenCount;
136
+ return {
137
+ content: [{
138
+ type: "text",
139
+ text: `Fill completed for ${fillResult.dictionaryKeys.join(", ")}: ${fillResult.writtenCount}/${fillResult.taskCount} translation(s) written${failedCount > 0 ? `, ${failedCount} failed` : ""}.`
140
+ }],
141
+ isError: failedCount > 0
142
+ };
132
143
  } catch (error) {
133
144
  return { content: [{
134
145
  type: "text",
@@ -1 +1 @@
1
- {"version":3,"file":"cli.mjs","names":[],"sources":["../../../src/tools/cli.ts"],"sourcesContent":["import { relative } from 'node:path';\nimport {\n build,\n extract,\n fill,\n init,\n listContentDeclarationRows,\n listMissingTranslations,\n pull,\n push,\n} from '@intlayer/cli';\nimport { listProjects } from '@intlayer/engine/cli';\nimport { scanWebsite } from '@intlayer/engine/scan';\nimport { ALL_LOCALES } from '@intlayer/types/allLocales';\nimport { z } from 'zod/mini';\nimport type { McpServer } from './docs';\n\nconst configOptionsSchema = z\n .optional(\n z.object({\n baseDir: z.optional(z.string()).register(z.globalRegistry, {\n description: 'Base directory for the project',\n }),\n env: z\n .optional(z.string())\n .register(z.globalRegistry, { description: 'Environment name' }),\n envFile: z.optional(z.string()).register(z.globalRegistry, {\n description: 'Path to the environment file',\n }),\n override: z\n .optional(\n z.object({\n editor: z.optional(\n z.object({\n clientId: z.optional(z.string()).register(z.globalRegistry, {\n description: 'Intlayer CMS client ID',\n }),\n clientSecret: z\n .optional(z.string())\n .register(z.globalRegistry, {\n description: 'Intlayer CMS client secret',\n }),\n backendURL: z.optional(z.string()).register(z.globalRegistry, {\n description: 'Intlayer CMS backend URL',\n }),\n })\n ),\n internationalization: z.optional(\n z.object({\n locales: z\n .optional(z.array(z.enum(ALL_LOCALES)))\n .register(z.globalRegistry, {\n description: 'Available locales',\n }),\n defaultLocale: z\n .optional(z.enum(ALL_LOCALES))\n .register(z.globalRegistry, {\n description: 'Default locale',\n }),\n })\n ),\n log: z.optional(\n z.object({\n mode: z\n .optional(z.enum(['default', 'verbose', 'disabled']))\n .register(z.globalRegistry, { description: 'Log mode' }),\n prefix: z\n .optional(z.string())\n .register(z.globalRegistry, { description: 'Log prefix' }),\n })\n ),\n })\n )\n .register(z.globalRegistry, {\n description:\n 'Config override - use when running remotely or without a local config file',\n }),\n })\n )\n .register(z.globalRegistry, {\n description:\n 'Configuration options. Required when running remotely or when no intlayer config file is present',\n });\n\ntype LoadCLITools = (server: McpServer) => Promise<void>;\n\nexport const loadCLITools: LoadCLITools = async (server) => {\n server.registerTool(\n 'intlayer-init',\n {\n title: 'Initialize Intlayer',\n description: 'Initialize Intlayer in the project',\n inputSchema: {\n projectRoot: z.string().register(z.globalRegistry, {\n description: 'Project root directory',\n }),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async ({ projectRoot }) => {\n try {\n await init(projectRoot);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Initialization successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Initialization failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-build',\n {\n title: 'Build Dictionaries',\n description:\n 'Build the dictionaries. List all content declarations files `.content.{ts,tsx,js,json,...}` to update the content callable using the `useIntlayer` hook.',\n inputSchema: {\n watch: z\n .optional(z.boolean())\n .register(z.globalRegistry, { description: 'Watch for changes' }),\n configOptions: configOptionsSchema,\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async ({ watch, configOptions }) => {\n try {\n await build({ watch, configOptions });\n\n return {\n content: [\n {\n type: 'text',\n text: 'Build successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Build failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-fill',\n {\n title: 'Fill Translations',\n description:\n 'Fill the dictionaries with missing translations / review translations using Intlayer servers',\n inputSchema: {\n sourceLocale: z\n .optional(z.enum(ALL_LOCALES))\n .register(z.globalRegistry, { description: 'Source locale' }),\n outputLocales: z\n .optional(\n z.union([z.enum(ALL_LOCALES), z.array(z.enum(ALL_LOCALES))])\n )\n .register(z.globalRegistry, { description: 'Output locales' }),\n file: z\n .optional(z.union([z.string(), z.array(z.string())]))\n .register(z.globalRegistry, { description: 'File path' }),\n mode: z\n .optional(z.enum(['complete', 'review']))\n .register(z.globalRegistry, { description: 'Fill mode' }),\n keys: z\n .optional(z.union([z.string(), z.array(z.string())]))\n .register(z.globalRegistry, { description: 'Keys to include' }),\n excludedKeys: z\n .optional(z.union([z.string(), z.array(z.string())]))\n .register(z.globalRegistry, { description: 'Keys to exclude' }),\n pathFilter: z\n .optional(z.union([z.string(), z.array(z.string())]))\n .register(z.globalRegistry, { description: 'Path filter' }),\n gitOptions: z\n .optional(\n z.object({\n gitDiff: z.optional(z.boolean()),\n gitDiffBase: z.optional(z.string()),\n gitDiffCurrent: z.optional(z.string()),\n uncommitted: z.optional(z.boolean()),\n unpushed: z.optional(z.boolean()),\n untracked: z.optional(z.boolean()),\n })\n )\n .register(z.globalRegistry, { description: 'Git options' }),\n aiOptions: z\n .optional(\n z.object({\n provider: z.optional(z.string()),\n temperature: z.optional(z.number()),\n model: z.optional(z.string()),\n apiKey: z.optional(z.string()),\n customPrompt: z.optional(z.string()),\n applicationContext: z.optional(z.string()),\n })\n )\n .register(z.globalRegistry, { description: 'AI options' }),\n configOptions: configOptionsSchema,\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n const { gitOptions, ...rest } = props;\n const fillOptions: any = { ...rest, gitOptions: undefined };\n\n if (gitOptions) {\n const { gitDiff, uncommitted, unpushed, untracked, ...restGit } =\n gitOptions;\n const mode = [];\n if (gitDiff) mode.push('gitDiff');\n if (uncommitted) mode.push('uncommitted');\n if (unpushed) mode.push('unpushed');\n if (untracked) mode.push('untracked');\n\n fillOptions.gitOptions = { ...restGit, mode };\n }\n\n await fill(fillOptions);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Fill successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Fill failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-push',\n {\n title: 'Push Dictionaries',\n description: 'Push local dictionaries to the server',\n inputSchema: {\n deleteLocaleDictionary: z\n .optional(z.boolean())\n .register(z.globalRegistry, {\n description: 'Delete local dictionary after push',\n }),\n keepLocaleDictionary: z\n .optional(z.boolean())\n .register(z.globalRegistry, {\n description: 'Keep local dictionary after push',\n }),\n dictionaries: z\n .optional(z.array(z.string()))\n .register(z.globalRegistry, {\n description: 'List of dictionaries to push',\n }),\n gitOptions: z\n .optional(\n z.object({\n gitDiff: z.optional(z.boolean()),\n gitDiffBase: z.optional(z.string()),\n gitDiffCurrent: z.optional(z.string()),\n uncommitted: z.optional(z.boolean()),\n unpushed: z.optional(z.boolean()),\n untracked: z.optional(z.boolean()),\n })\n )\n .register(z.globalRegistry, { description: 'Git options' }),\n configOptions: configOptionsSchema,\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n const { gitOptions, ...rest } = props;\n const pushOptions: any = { ...rest, gitOptions: undefined };\n\n if (gitOptions) {\n const { gitDiff, uncommitted, unpushed, untracked, ...restGit } =\n gitOptions;\n const mode = [];\n if (gitDiff) mode.push('gitDiff');\n if (uncommitted) mode.push('uncommitted');\n if (unpushed) mode.push('unpushed');\n if (untracked) mode.push('untracked');\n\n pushOptions.gitOptions = { ...restGit, mode };\n }\n\n await push(pushOptions);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Push successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Push failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-pull',\n {\n title: 'Pull Dictionaries',\n description: 'Pull dictionaries from the CMS',\n inputSchema: {\n dictionaries: z\n .optional(z.array(z.string()))\n .register(z.globalRegistry, {\n description: 'List of dictionaries to pull',\n }),\n newDictionariesPath: z.optional(z.string()).register(z.globalRegistry, {\n description: 'Path to save new dictionaries',\n }),\n configOptions: configOptionsSchema,\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n await pull(props);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Pull successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Pull failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-content-list',\n {\n title: 'List Content Declarations',\n description:\n 'List the content declaration (.content.{ts,tsx,js,json,...}) files present in the project. That files contain the multilingual content of the application and are used to build the dictionaries.',\n inputSchema: {\n configOptions: configOptionsSchema,\n absolute: z.optional(z.boolean()).register(z.globalRegistry, {\n description:\n 'Output the results as absolute paths instead of relative paths',\n }),\n json: z.optional(z.boolean()).register(z.globalRegistry, {\n description: 'Output the results as JSON instead of formatted text',\n }),\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async (props) => {\n try {\n const rows = listContentDeclarationRows(props);\n return {\n content: [\n {\n type: 'text',\n text: props.json\n ? JSON.stringify(rows)\n : JSON.stringify(rows, null, 2),\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Content list failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-content-test',\n {\n title: 'Test Translations',\n description:\n 'Test if there are missing translations in the content declaration files. That files contain the multilingual content of the application and are used to build the dictionaries.',\n inputSchema: {\n configOptions: configOptionsSchema,\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async (props) => {\n try {\n const missingTranslations = listMissingTranslations(\n props?.configOptions\n );\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(missingTranslations, null, 2),\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Content test failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-extract',\n {\n title: 'Extract strings from Component',\n description:\n 'Extract strings from an existing component to be placed in a .content file close to the component. Trigger this action to make an existing component multilingual. If the component does not exist, create a normal component including text in JSX, and then trigger this tool to extract it.',\n inputSchema: {\n file: z\n .optional(z.union([z.string(), z.array(z.string())]))\n .register(z.globalRegistry, {\n description: 'List of files to extract',\n }),\n outputContentDeclarations: z\n .optional(z.string())\n .register(z.globalRegistry, {\n description: 'Path to output content declaration files',\n }),\n configOptions: configOptionsSchema,\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n await extract({\n files: Array.isArray(props.file)\n ? props.file\n : props.file\n ? [props.file]\n : undefined,\n configOptions: props.configOptions,\n });\n\n return {\n content: [\n {\n type: 'text',\n text: 'Extract successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Extract failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-scan',\n {\n title: 'Scan Website',\n description:\n 'Scan a website to measure its page size and audit its i18n / SEO health (html lang/dir, canonical, hreflang, x-default, localized internal links, robots.txt, sitemap.xml, and unused bundle locale content). Returns a 0-100 score and per-check results.',\n inputSchema: {\n url: z.string().register(z.globalRegistry, {\n description: 'Absolute URL of the website to scan',\n }),\n deep: z.optional(z.boolean()).register(z.globalRegistry, {\n description:\n 'Attempt a deeper render-based scan using a locally installed puppeteer. Falls back to a basic fetch scan when puppeteer is not installed.',\n }),\n },\n annotations: {\n readOnlyHint: true,\n openWorldHint: true,\n },\n },\n async ({ url, deep }) => {\n try {\n const result = await scanWebsite(url, { deep });\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(result, null, 2),\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Scan failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-projects-list',\n {\n title: 'List Projects',\n description:\n 'List all Intlayer projects in the directory. Search for configuration files to find all Intlayer projects.',\n inputSchema: {\n baseDir: z.optional(z.string()).register(z.globalRegistry, {\n description: 'Base directory to search from',\n }),\n gitRoot: z.optional(z.boolean()).register(z.globalRegistry, {\n description:\n 'Search from the git root directory instead of the base directory',\n }),\n absolute: z.optional(z.boolean()).register(z.globalRegistry, {\n description:\n 'Output the results as absolute paths instead of relative paths',\n }),\n json: z.optional(z.boolean()).register(z.globalRegistry, {\n description: 'Output the results as JSON instead of formatted text',\n }),\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async (props) => {\n try {\n const { searchDir, projectsPath } = await listProjects({\n baseDir: props.baseDir,\n gitRoot: props.gitRoot,\n });\n\n const projectsRelativePath = projectsPath\n .map((projectPath) =>\n props.absolute ? projectPath : relative(searchDir, projectPath)\n )\n .map((projectPath) => (projectPath === '' ? '.' : projectPath));\n\n const outputPaths = props.absolute\n ? projectsPath\n : projectsRelativePath;\n\n return {\n content: [\n {\n type: 'text',\n text: props.json\n ? JSON.stringify(outputPaths)\n : JSON.stringify(\n { searchDir, projectsPath: outputPaths },\n null,\n 2\n ),\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Projects list failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n};\n"],"mappings":";;;;;;;;AAiBA,MAAM,sBAAsB,EACzB,SACC,EAAE,OAAO;CACP,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,gBAAgB,EACzD,aAAa,iCACf,CAAC;CACD,KAAK,EACF,SAAS,EAAE,OAAO,CAAC,CAAC,CACpB,SAAS,EAAE,gBAAgB,EAAE,aAAa,mBAAmB,CAAC;CACjE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,gBAAgB,EACzD,aAAa,+BACf,CAAC;CACD,UAAU,EACP,SACC,EAAE,OAAO;EACP,QAAQ,EAAE,SACR,EAAE,OAAO;GACP,UAAU,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,gBAAgB,EAC1D,aAAa,yBACf,CAAC;GACD,cAAc,EACX,SAAS,EAAE,OAAO,CAAC,CAAC,CACpB,SAAS,EAAE,gBAAgB,EAC1B,aAAa,6BACf,CAAC;GACH,YAAY,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,gBAAgB,EAC5D,aAAa,2BACf,CAAC;EACH,CAAC,CACH;EACA,sBAAsB,EAAE,SACtB,EAAE,OAAO;GACP,SAAS,EACN,SAAS,EAAE,MAAM,EAAE,KAAK,WAAW,CAAC,CAAC,CAAC,CACtC,SAAS,EAAE,gBAAgB,EAC1B,aAAa,oBACf,CAAC;GACH,eAAe,EACZ,SAAS,EAAE,KAAK,WAAW,CAAC,CAAC,CAC7B,SAAS,EAAE,gBAAgB,EAC1B,aAAa,iBACf,CAAC;EACL,CAAC,CACH;EACA,KAAK,EAAE,SACL,EAAE,OAAO;GACP,MAAM,EACH,SAAS,EAAE,KAAK;IAAC;IAAW;IAAW;GAAU,CAAC,CAAC,CAAC,CACpD,SAAS,EAAE,gBAAgB,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GACF,MAAM,EAAE,WAAW,iBAAiB,MAAM,aAAa;IACrD,SAAS,MAAM;IACf,SAAS,MAAM;GACjB,CAAC;GAED,MAAM,uBAAuB,aAC1B,KAAK,gBACJ,MAAM,WAAW,cAAc,SAAS,WAAW,WAAW,CAChE,CAAC,CACA,KAAK,gBAAiB,gBAAgB,KAAK,MAAM,WAAY;GAEhE,MAAM,cAAc,MAAM,WACtB,eACA;GAEJ,OAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,MAAM,OACR,KAAK,UAAU,WAAW,IAC1B,KAAK,UACH;KAAE;KAAW,cAAc;IAAY,GACvC,MACA,CACF;GACN,CACF,EACF;EACF,SAAS,OAAO;GAGd,OAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,yBALV,iBAAiB,QAAQ,MAAM,UAAU;GAMvC,CACF,EACF;EACF;CACF,CACF;AACF"}
1
+ {"version":3,"file":"cli.mjs","names":[],"sources":["../../../src/tools/cli.ts"],"sourcesContent":["import { relative } from 'node:path';\nimport {\n build,\n extract,\n fill,\n init,\n listContentDeclarationRows,\n listMissingTranslations,\n pull,\n push,\n} from '@intlayer/cli';\nimport { listProjects } from '@intlayer/engine/cli';\nimport { scanWebsite } from '@intlayer/engine/scan';\nimport { ALL_LOCALES } from '@intlayer/types/allLocales';\nimport { z } from 'zod/mini';\nimport type { McpServer } from './docs';\n\nconst configOptionsSchema = z\n .optional(\n z.object({\n baseDir: z.optional(z.string()).register(z.globalRegistry, {\n description: 'Base directory for the project',\n }),\n env: z\n .optional(z.string())\n .register(z.globalRegistry, { description: 'Environment name' }),\n envFile: z.optional(z.string()).register(z.globalRegistry, {\n description: 'Path to the environment file',\n }),\n override: z\n .optional(\n z.object({\n editor: z.optional(\n z.object({\n clientId: z.optional(z.string()).register(z.globalRegistry, {\n description: 'Intlayer CMS client ID',\n }),\n clientSecret: z\n .optional(z.string())\n .register(z.globalRegistry, {\n description: 'Intlayer CMS client secret',\n }),\n backendURL: z.optional(z.string()).register(z.globalRegistry, {\n description: 'Intlayer CMS backend URL',\n }),\n })\n ),\n internationalization: z.optional(\n z.object({\n locales: z\n .optional(z.array(z.enum(ALL_LOCALES)))\n .register(z.globalRegistry, {\n description: 'Available locales',\n }),\n defaultLocale: z\n .optional(z.enum(ALL_LOCALES))\n .register(z.globalRegistry, {\n description: 'Default locale',\n }),\n })\n ),\n log: z.optional(\n z.object({\n mode: z\n .optional(z.enum(['default', 'verbose', 'disabled']))\n .register(z.globalRegistry, { description: 'Log mode' }),\n prefix: z\n .optional(z.string())\n .register(z.globalRegistry, { description: 'Log prefix' }),\n })\n ),\n })\n )\n .register(z.globalRegistry, {\n description:\n 'Config override - use when running remotely or without a local config file',\n }),\n })\n )\n .register(z.globalRegistry, {\n description:\n 'Configuration options. Required when running remotely or when no intlayer config file is present',\n });\n\ntype LoadCLITools = (server: McpServer) => Promise<void>;\n\nexport const loadCLITools: LoadCLITools = async (server) => {\n server.registerTool(\n 'intlayer-init',\n {\n title: 'Initialize Intlayer',\n description:\n 'Initialize Intlayer in the project: install the Intlayer packages and set up the framework (config, bundler plugin, middleware, providers). Other setup steps run through the `intlayer init <step>` CLI commands (github-actions, skills, mcp, vscode-extension, lsp, eslint)',\n inputSchema: {\n projectRoot: z.string().register(z.globalRegistry, {\n description: 'Project root directory',\n }),\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async ({ projectRoot }) => {\n try {\n await init(projectRoot);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Initialization successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Initialization failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-build',\n {\n title: 'Build Dictionaries',\n description:\n 'Build the dictionaries. List all content declarations files `.content.{ts,tsx,js,json,...}` to update the content callable using the `useIntlayer` hook.',\n inputSchema: {\n watch: z\n .optional(z.boolean())\n .register(z.globalRegistry, { description: 'Watch for changes' }),\n configOptions: configOptionsSchema,\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async ({ watch, configOptions }) => {\n try {\n await build({ watch, configOptions });\n\n return {\n content: [\n {\n type: 'text',\n text: 'Build successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Build failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-fill',\n {\n title: 'Fill Translations',\n description:\n 'Fill the dictionaries with missing translations / review translations using Intlayer servers',\n inputSchema: {\n sourceLocale: z\n .optional(z.enum(ALL_LOCALES))\n .register(z.globalRegistry, { description: 'Source locale' }),\n outputLocales: z\n .optional(\n z.union([z.enum(ALL_LOCALES), z.array(z.enum(ALL_LOCALES))])\n )\n .register(z.globalRegistry, { description: 'Output locales' }),\n file: z\n .optional(z.union([z.string(), z.array(z.string())]))\n .register(z.globalRegistry, { description: 'File path' }),\n mode: z\n .optional(z.enum(['complete', 'review']))\n .register(z.globalRegistry, { description: 'Fill mode' }),\n keys: z\n .optional(z.union([z.string(), z.array(z.string())]))\n .register(z.globalRegistry, { description: 'Keys to include' }),\n excludedKeys: z\n .optional(z.union([z.string(), z.array(z.string())]))\n .register(z.globalRegistry, { description: 'Keys to exclude' }),\n pathFilter: z\n .optional(z.union([z.string(), z.array(z.string())]))\n .register(z.globalRegistry, { description: 'Path filter' }),\n gitOptions: z\n .optional(\n z.object({\n gitDiff: z.optional(z.boolean()),\n gitDiffBase: z.optional(z.string()),\n gitDiffCurrent: z.optional(z.string()),\n uncommitted: z.optional(z.boolean()),\n unpushed: z.optional(z.boolean()),\n untracked: z.optional(z.boolean()),\n })\n )\n .register(z.globalRegistry, { description: 'Git options' }),\n aiOptions: z\n .optional(\n z.object({\n provider: z.optional(z.string()),\n temperature: z.optional(z.number()),\n model: z.optional(z.string()),\n apiKey: z.optional(z.string()),\n customPrompt: z.optional(z.string()),\n applicationContext: z.optional(z.string()),\n })\n )\n .register(z.globalRegistry, { description: 'AI options' }),\n configOptions: configOptionsSchema,\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n const { gitOptions, ...rest } = props;\n const fillOptions: any = { ...rest, gitOptions: undefined };\n\n if (gitOptions) {\n const { gitDiff, uncommitted, unpushed, untracked, ...restGit } =\n gitOptions;\n const mode = [];\n if (gitDiff) mode.push('gitDiff');\n if (uncommitted) mode.push('uncommitted');\n if (unpushed) mode.push('unpushed');\n if (untracked) mode.push('untracked');\n\n fillOptions.gitOptions = { ...restGit, mode };\n }\n\n const fillResult = await fill(fillOptions);\n\n if (fillResult.status !== 'completed') {\n return {\n content: [\n {\n type: 'text',\n text:\n fillResult.status === 'no-ai-access'\n ? `Fill skipped: no AI access. ${fillResult.error ?? 'Run \"intlayer login\" or configure an AI API key.'}`\n : 'Fill skipped: no dictionary matched the filters.',\n },\n ],\n isError: true,\n };\n }\n\n const failedCount = fillResult.taskCount - fillResult.writtenCount;\n\n return {\n content: [\n {\n type: 'text',\n text: `Fill completed for ${fillResult.dictionaryKeys.join(', ')}: ${fillResult.writtenCount}/${fillResult.taskCount} translation(s) written${failedCount > 0 ? `, ${failedCount} failed` : ''}.`,\n },\n ],\n isError: failedCount > 0,\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Fill failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-push',\n {\n title: 'Push Dictionaries',\n description: 'Push local dictionaries to the server',\n inputSchema: {\n deleteLocaleDictionary: z\n .optional(z.boolean())\n .register(z.globalRegistry, {\n description: 'Delete local dictionary after push',\n }),\n keepLocaleDictionary: z\n .optional(z.boolean())\n .register(z.globalRegistry, {\n description: 'Keep local dictionary after push',\n }),\n dictionaries: z\n .optional(z.array(z.string()))\n .register(z.globalRegistry, {\n description: 'List of dictionaries to push',\n }),\n gitOptions: z\n .optional(\n z.object({\n gitDiff: z.optional(z.boolean()),\n gitDiffBase: z.optional(z.string()),\n gitDiffCurrent: z.optional(z.string()),\n uncommitted: z.optional(z.boolean()),\n unpushed: z.optional(z.boolean()),\n untracked: z.optional(z.boolean()),\n })\n )\n .register(z.globalRegistry, { description: 'Git options' }),\n configOptions: configOptionsSchema,\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n const { gitOptions, ...rest } = props;\n const pushOptions: any = { ...rest, gitOptions: undefined };\n\n if (gitOptions) {\n const { gitDiff, uncommitted, unpushed, untracked, ...restGit } =\n gitOptions;\n const mode = [];\n if (gitDiff) mode.push('gitDiff');\n if (uncommitted) mode.push('uncommitted');\n if (unpushed) mode.push('unpushed');\n if (untracked) mode.push('untracked');\n\n pushOptions.gitOptions = { ...restGit, mode };\n }\n\n await push(pushOptions);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Push successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Push failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-pull',\n {\n title: 'Pull Dictionaries',\n description: 'Pull dictionaries from the CMS',\n inputSchema: {\n dictionaries: z\n .optional(z.array(z.string()))\n .register(z.globalRegistry, {\n description: 'List of dictionaries to pull',\n }),\n newDictionariesPath: z.optional(z.string()).register(z.globalRegistry, {\n description: 'Path to save new dictionaries',\n }),\n configOptions: configOptionsSchema,\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n await pull(props);\n\n return {\n content: [\n {\n type: 'text',\n text: 'Pull successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Pull failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-content-list',\n {\n title: 'List Content Declarations',\n description:\n 'List the content declaration (.content.{ts,tsx,js,json,...}) files present in the project. That files contain the multilingual content of the application and are used to build the dictionaries.',\n inputSchema: {\n configOptions: configOptionsSchema,\n absolute: z.optional(z.boolean()).register(z.globalRegistry, {\n description:\n 'Output the results as absolute paths instead of relative paths',\n }),\n json: z.optional(z.boolean()).register(z.globalRegistry, {\n description: 'Output the results as JSON instead of formatted text',\n }),\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async (props) => {\n try {\n const rows = listContentDeclarationRows(props);\n return {\n content: [\n {\n type: 'text',\n text: props.json\n ? JSON.stringify(rows)\n : JSON.stringify(rows, null, 2),\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Content list failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-content-test',\n {\n title: 'Test Translations',\n description:\n 'Test if there are missing translations in the content declaration files. That files contain the multilingual content of the application and are used to build the dictionaries.',\n inputSchema: {\n configOptions: configOptionsSchema,\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async (props) => {\n try {\n const missingTranslations = listMissingTranslations(\n props?.configOptions\n );\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(missingTranslations, null, 2),\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Content test failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-extract',\n {\n title: 'Extract strings from Component',\n description:\n 'Extract strings from an existing component to be placed in a .content file close to the component. Trigger this action to make an existing component multilingual. If the component does not exist, create a normal component including text in JSX, and then trigger this tool to extract it.',\n inputSchema: {\n file: z\n .optional(z.union([z.string(), z.array(z.string())]))\n .register(z.globalRegistry, {\n description: 'List of files to extract',\n }),\n outputContentDeclarations: z\n .optional(z.string())\n .register(z.globalRegistry, {\n description: 'Path to output content declaration files',\n }),\n configOptions: configOptionsSchema,\n },\n annotations: {\n destructiveHint: true,\n },\n },\n async (props) => {\n try {\n await extract({\n files: Array.isArray(props.file)\n ? props.file\n : props.file\n ? [props.file]\n : undefined,\n configOptions: props.configOptions,\n });\n\n return {\n content: [\n {\n type: 'text',\n text: 'Extract successful.',\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Extract failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-scan',\n {\n title: 'Scan Website',\n description:\n 'Scan a website to measure its page size and audit its i18n / SEO health (html lang/dir, canonical, hreflang, x-default, localized internal links, robots.txt, sitemap.xml, and unused bundle locale content). Returns a 0-100 score and per-check results.',\n inputSchema: {\n url: z.string().register(z.globalRegistry, {\n description: 'Absolute URL of the website to scan',\n }),\n deep: z.optional(z.boolean()).register(z.globalRegistry, {\n description:\n 'Attempt a deeper render-based scan using a locally installed puppeteer. Falls back to a basic fetch scan when puppeteer is not installed.',\n }),\n },\n annotations: {\n readOnlyHint: true,\n openWorldHint: true,\n },\n },\n async ({ url, deep }) => {\n try {\n const result = await scanWebsite(url, { deep });\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(result, null, 2),\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Scan failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n\n server.registerTool(\n 'intlayer-projects-list',\n {\n title: 'List Projects',\n description:\n 'List all Intlayer projects in the directory. Search for configuration files to find all Intlayer projects.',\n inputSchema: {\n baseDir: z.optional(z.string()).register(z.globalRegistry, {\n description: 'Base directory to search from',\n }),\n gitRoot: z.optional(z.boolean()).register(z.globalRegistry, {\n description:\n 'Search from the git root directory instead of the base directory',\n }),\n absolute: z.optional(z.boolean()).register(z.globalRegistry, {\n description:\n 'Output the results as absolute paths instead of relative paths',\n }),\n json: z.optional(z.boolean()).register(z.globalRegistry, {\n description: 'Output the results as JSON instead of formatted text',\n }),\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async (props) => {\n try {\n const { searchDir, projectsPath } = await listProjects({\n baseDir: props.baseDir,\n gitRoot: props.gitRoot,\n });\n\n const projectsRelativePath = projectsPath\n .map((projectPath) =>\n props.absolute ? projectPath : relative(searchDir, projectPath)\n )\n .map((projectPath) => (projectPath === '' ? '.' : projectPath));\n\n const outputPaths = props.absolute\n ? projectsPath\n : projectsRelativePath;\n\n return {\n content: [\n {\n type: 'text',\n text: props.json\n ? JSON.stringify(outputPaths)\n : JSON.stringify(\n { searchDir, projectsPath: outputPaths },\n null,\n 2\n ),\n },\n ],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n {\n type: 'text',\n text: `Projects list failed: ${errorMessage}`,\n },\n ],\n };\n }\n }\n );\n};\n"],"mappings":";;;;;;;;AAiBA,MAAM,sBAAsB,EACzB,SACC,EAAE,OAAO;CACP,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,gBAAgB,EACzD,aAAa,iCACf,CAAC;CACD,KAAK,EACF,SAAS,EAAE,OAAO,CAAC,CAAC,CACpB,SAAS,EAAE,gBAAgB,EAAE,aAAa,mBAAmB,CAAC;CACjE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,gBAAgB,EACzD,aAAa,+BACf,CAAC;CACD,UAAU,EACP,SACC,EAAE,OAAO;EACP,QAAQ,EAAE,SACR,EAAE,OAAO;GACP,UAAU,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,gBAAgB,EAC1D,aAAa,yBACf,CAAC;GACD,cAAc,EACX,SAAS,EAAE,OAAO,CAAC,CAAC,CACpB,SAAS,EAAE,gBAAgB,EAC1B,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UACH;KAAE;KAAW,cAAc;IAAY,GACvC,MACA,CACF;GACN,CACF,EACF;EACF,SAAS,OAAO;GAGd,OAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,yBALV,iBAAiB,QAAQ,MAAM,UAAU;GAMvC,CACF,EACF;EACF;CACF,CACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/mcp",
3
- "version": "9.5.12",
3
+ "version": "9.6.0",
4
4
  "private": false,
5
5
  "description": "Intlayer MCP server. Handle MCP to help IDE to use Intlayer. It build, fill, pull, push, dictionaries",
6
6
  "keywords": [
@@ -112,21 +112,21 @@
112
112
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
113
113
  },
114
114
  "dependencies": {
115
- "@ai-sdk/mcp": "2.0.63",
115
+ "@ai-sdk/mcp": "2.0.64",
116
116
  "@fastify/cors": "11.3.0",
117
117
  "@fastify/helmet": "13.1.1",
118
- "@intlayer/api": "9.5.12",
119
- "@intlayer/cli": "9.5.12",
120
- "@intlayer/config": "9.5.12",
121
- "@intlayer/docs": "9.5.12",
122
- "@intlayer/engine": "9.5.12",
123
- "@intlayer/types": "9.5.12",
124
- "dotenv": "18.0.4",
118
+ "@intlayer/api": "9.6.0",
119
+ "@intlayer/cli": "9.6.0",
120
+ "@intlayer/config": "9.6.0",
121
+ "@intlayer/docs": "9.6.0",
122
+ "@intlayer/engine": "9.6.0",
123
+ "@intlayer/types": "9.6.0",
124
+ "dotenv": "18.0.5",
125
125
  "fastify": "5.12.5",
126
126
  "zod": "4.6.5"
127
127
  },
128
128
  "devDependencies": {
129
- "@intlayer/types": "9.5.12",
129
+ "@intlayer/types": "9.6.0",
130
130
  "@types/node": "^22",
131
131
  "@utils/ts-config": "1.0.4",
132
132
  "@utils/ts-config-types": "1.0.4",
@@ -134,7 +134,7 @@
134
134
  "rimraf": "6.1.3",
135
135
  "tsdown": "0.23.0",
136
136
  "typescript": "7.0.2",
137
- "vitest": "5.0.2"
137
+ "vitest": "5.0.3"
138
138
  },
139
139
  "engines": {
140
140
  "node": ">=14.18"