@intlayer/mcp 8.12.0 → 8.12.2
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/dist/esm/server/server.mjs +5 -5
- package/dist/esm/tools/api.mjs +98 -0
- package/dist/esm/tools/api.mjs.map +1 -1
- package/dist/esm/tools/cli.mjs +2 -2
- package/dist/esm/tools/index.mjs +3 -3
- package/dist/esm/tools/installLSP.mjs +1 -1
- package/dist/esm/tools/installSkills.mjs +2 -2
- package/package.json +9 -9
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { loadInstallLSPTool } from "../tools/installLSP.mjs";
|
|
2
|
-
import { loadCLITools } from "../tools/cli.mjs";
|
|
3
1
|
import { loadAPITools } from "../tools/api.mjs";
|
|
4
|
-
import {
|
|
2
|
+
import { loadCLITools } from "../tools/cli.mjs";
|
|
5
3
|
import { loadDocsTools } from "../tools/docs.mjs";
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
4
|
+
import { loadInstallLSPTool } from "../tools/installLSP.mjs";
|
|
5
|
+
import { loadInstallSkillsTool } from "../tools/installSkills.mjs";
|
|
8
6
|
import { readFileSync } from "node:fs";
|
|
7
|
+
import { dirname as dirname$1, resolve } from "node:path";
|
|
9
8
|
import { fileURLToPath } from "node:url";
|
|
10
9
|
import { isESModule } from "@intlayer/config/utils";
|
|
10
|
+
import z from "zod";
|
|
11
11
|
|
|
12
12
|
//#region src/server/server.ts
|
|
13
13
|
const dirname = isESModule ? dirname$1(fileURLToPath(import.meta.url)) : __dirname;
|
package/dist/esm/tools/api.mjs
CHANGED
|
@@ -330,6 +330,104 @@ const loadAPITools = (server) => {
|
|
|
330
330
|
return fail("Update CMS project", error);
|
|
331
331
|
}
|
|
332
332
|
});
|
|
333
|
+
server.registerTool("intlayer-cms-environment-select", {
|
|
334
|
+
title: "Select CMS Environment",
|
|
335
|
+
description: "Select a CMS environment as the current active environment. Required before accessing environment-specific dictionaries.",
|
|
336
|
+
inputSchema: {
|
|
337
|
+
...authSchema,
|
|
338
|
+
environmentId: z.string().describe("Environment ID to select")
|
|
339
|
+
},
|
|
340
|
+
annotations: { destructiveHint: false }
|
|
341
|
+
}, async ({ clientId, clientSecret, environmentId }) => {
|
|
342
|
+
try {
|
|
343
|
+
return ok(await (await getAPI(clientId, clientSecret)).environment.selectEnvironment(environmentId));
|
|
344
|
+
} catch (error) {
|
|
345
|
+
return fail("Select CMS environment", error);
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
server.registerTool("intlayer-cms-environment-reset", {
|
|
349
|
+
title: "Reset CMS Environment to Production",
|
|
350
|
+
description: "Reset the current active environment to the default production environment.",
|
|
351
|
+
inputSchema: { ...authSchema },
|
|
352
|
+
annotations: { destructiveHint: false }
|
|
353
|
+
}, async ({ clientId, clientSecret }) => {
|
|
354
|
+
try {
|
|
355
|
+
return ok(await (await getAPI(clientId, clientSecret)).environment.resetToProductionEnvironment());
|
|
356
|
+
} catch (error) {
|
|
357
|
+
return fail("Reset CMS environment", error);
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
server.registerTool("intlayer-cms-environment-create", {
|
|
361
|
+
title: "Create CMS Environment",
|
|
362
|
+
description: "Create a new CMS environment in the selected project.",
|
|
363
|
+
inputSchema: {
|
|
364
|
+
...authSchema,
|
|
365
|
+
name: z.string().describe("Environment name")
|
|
366
|
+
},
|
|
367
|
+
annotations: { destructiveHint: false }
|
|
368
|
+
}, async ({ clientId, clientSecret, name }) => {
|
|
369
|
+
try {
|
|
370
|
+
return ok(await (await getAPI(clientId, clientSecret)).environment.addEnvironment({ name }));
|
|
371
|
+
} catch (error) {
|
|
372
|
+
return fail("Create CMS environment", error);
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
server.registerTool("intlayer-cms-environment-update", {
|
|
376
|
+
title: "Update CMS Environment",
|
|
377
|
+
description: "Update the selected CMS environment settings.",
|
|
378
|
+
inputSchema: {
|
|
379
|
+
...authSchema,
|
|
380
|
+
environmentId: z.string().describe("Environment ID to update"),
|
|
381
|
+
name: z.string().optional().describe("New environment name")
|
|
382
|
+
},
|
|
383
|
+
annotations: { destructiveHint: true }
|
|
384
|
+
}, async ({ clientId, clientSecret, environmentId, name }) => {
|
|
385
|
+
try {
|
|
386
|
+
return ok(await (await getAPI(clientId, clientSecret)).environment.updateEnvironment(environmentId, { name }));
|
|
387
|
+
} catch (error) {
|
|
388
|
+
return fail("Update CMS environment", error);
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
server.registerTool("intlayer-cms-environment-delete", {
|
|
392
|
+
title: "Delete CMS Environment",
|
|
393
|
+
description: "Delete a CMS environment by its ID.",
|
|
394
|
+
inputSchema: {
|
|
395
|
+
...authSchema,
|
|
396
|
+
environmentId: z.string().describe("Environment ID to delete")
|
|
397
|
+
},
|
|
398
|
+
annotations: { destructiveHint: true }
|
|
399
|
+
}, async ({ clientId, clientSecret, environmentId }) => {
|
|
400
|
+
try {
|
|
401
|
+
return ok(await (await getAPI(clientId, clientSecret)).environment.deleteEnvironment(environmentId));
|
|
402
|
+
} catch (error) {
|
|
403
|
+
return fail("Delete CMS environment", error);
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
server.registerTool("intlayer-cms-environment-migrate", {
|
|
407
|
+
title: "Migrate CMS Environment",
|
|
408
|
+
description: "Migrate dictionaries and configuration from one environment to another.",
|
|
409
|
+
inputSchema: {
|
|
410
|
+
...authSchema,
|
|
411
|
+
sourceEnvironmentId: z.string().describe("Source environment ID"),
|
|
412
|
+
targetEnvironmentId: z.string().describe("Target environment ID"),
|
|
413
|
+
strategy: z.enum(["overwrite", "fill-missing"]).describe("Migration strategy: overwrite existing or only fill missing"),
|
|
414
|
+
migrateContent: z.boolean().optional().describe("Whether to migrate content (dictionaries)"),
|
|
415
|
+
migrateConfiguration: z.boolean().optional().describe("Whether to migrate environment configuration")
|
|
416
|
+
},
|
|
417
|
+
annotations: { destructiveHint: true }
|
|
418
|
+
}, async ({ clientId, clientSecret, sourceEnvironmentId, targetEnvironmentId, strategy, migrateContent, migrateConfiguration }) => {
|
|
419
|
+
try {
|
|
420
|
+
return ok(await (await getAPI(clientId, clientSecret)).environment.migrateEnvironment({
|
|
421
|
+
sourceEnvironmentId,
|
|
422
|
+
targetEnvironmentId,
|
|
423
|
+
strategy,
|
|
424
|
+
migrateContent,
|
|
425
|
+
migrateConfiguration
|
|
426
|
+
}));
|
|
427
|
+
} catch (error) {
|
|
428
|
+
return fail("Migrate CMS environment", error);
|
|
429
|
+
}
|
|
430
|
+
});
|
|
333
431
|
};
|
|
334
432
|
|
|
335
433
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.mjs","names":[],"sources":["../../../src/tools/api.ts"],"sourcesContent":["import { getIntlayerAPI } from '@intlayer/api';\nimport { editor } from '@intlayer/config/built';\nimport z from 'zod';\nimport type { McpServer } from './docs';\n\ntype LoadAPITools = (server: McpServer) => void;\n\nconst authSchema = {\n clientId: z\n .string()\n .optional()\n .describe(\n 'Intlayer OAuth2 client ID (access key). Falls back to INTLAYER_CLIENT_ID env var.'\n ),\n clientSecret: z\n .string()\n .optional()\n .describe(\n 'Intlayer OAuth2 client secret. Falls back to INTLAYER_CLIENT_SECRET env var.'\n ),\n};\n\nconst getAPI = async (clientId?: string, clientSecret?: string) => {\n const resolvedClientId = clientId ?? editor.clientId;\n const resolvedClientSecret = clientSecret ?? editor.clientSecret;\n\n if (!resolvedClientId || !resolvedClientSecret) {\n throw new Error(\n 'Intlayer credentials not found. Provide clientId/clientSecret or set INTLAYER_CLIENT_ID/INTLAYER_CLIENT_SECRET.'\n );\n }\n\n const configWithCreds = {\n editor: {\n ...editor,\n clientId: resolvedClientId,\n clientSecret: resolvedClientSecret,\n },\n };\n\n const tempAPI = getIntlayerAPI({}, configWithCreds);\n const tokenResult = await tempAPI.oAuth.getOAuth2AccessToken();\n const token = (tokenResult as any)?.data?.access_token as string | undefined;\n\n if (!token) {\n throw new Error(\n 'Failed to obtain OAuth2 access token. Check your credentials.'\n );\n }\n\n return getIntlayerAPI(\n { headers: { Authorization: `Bearer ${token}` } },\n { editor }\n );\n};\n\nconst ok = (data: unknown) => ({\n content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],\n});\n\nconst fail = (label: string, error: unknown) => ({\n content: [\n {\n type: 'text' as const,\n text: `${label} failed: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true as const,\n});\n\nexport const loadAPITools: LoadAPITools = (server) => {\n // ── Dictionaries ──────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-dictionaries-list',\n {\n title: 'List Dictionaries',\n description:\n 'List all dictionaries for the selected project. Returns keys, IDs, and metadata.',\n inputSchema: {\n ...authSchema,\n page: z.number().optional().describe('Page number (1-based)'),\n pageSize: z.number().optional().describe('Items per page'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, page, pageSize }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.getDictionaries({\n page,\n pageSize,\n });\n return ok(result);\n } catch (error) {\n return fail('List dictionaries', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-dictionary-get',\n {\n title: 'Get Dictionary',\n description: 'Get a dictionary by its key, including its full content.',\n inputSchema: {\n ...authSchema,\n dictionaryKey: z.string().describe('The dictionary key'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, dictionaryKey }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.getDictionary(dictionaryKey);\n return ok(result);\n } catch (error) {\n return fail('Get dictionary', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-dictionary-create',\n {\n title: 'Create Dictionary',\n description: 'Create a new dictionary in the selected project.',\n inputSchema: {\n ...authSchema,\n key: z.string().describe('Unique key for the dictionary'),\n title: z.string().optional().describe('Human-readable title'),\n description: z\n .string()\n .optional()\n .describe('Description of the dictionary'),\n content: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Initial content as JSON object'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, key, title, description, content }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.addDictionary({\n key,\n title,\n description,\n content,\n });\n return ok(result);\n } catch (error) {\n return fail('Create dictionary', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-dictionary-update',\n {\n title: 'Update Dictionary',\n description: 'Update an existing dictionary content or metadata.',\n inputSchema: {\n ...authSchema,\n id: z.string().describe('Dictionary ID'),\n key: z.string().optional().describe('New key for the dictionary'),\n title: z.string().optional().describe('New title'),\n description: z.string().optional().describe('New description'),\n content: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Updated content as JSON object'),\n },\n annotations: { destructiveHint: true },\n },\n async ({\n clientId,\n clientSecret,\n id,\n key,\n title,\n description,\n content,\n }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.updateDictionary({\n id,\n key,\n title,\n description,\n content,\n });\n return ok(result);\n } catch (error) {\n return fail('Update dictionary', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-dictionary-delete',\n {\n title: 'Delete Dictionary',\n description:\n 'Delete a dictionary by its ID. This action is irreversible.',\n inputSchema: {\n ...authSchema,\n dictionaryId: z.string().describe('Dictionary ID to delete'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, dictionaryId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.deleteDictionary(dictionaryId);\n return ok(result);\n } catch (error) {\n return fail('Delete dictionary', error);\n }\n }\n );\n\n // ── Tags ──────────────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-tags-list',\n {\n title: 'List Tags',\n description: 'List all tags for the selected organization.',\n inputSchema: {\n ...authSchema,\n page: z.number().optional().describe('Page number (1-based)'),\n pageSize: z.number().optional().describe('Items per page'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, page, pageSize }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.tag.getTags({ page, pageSize });\n return ok(result);\n } catch (error) {\n return fail('List tags', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-tag-create',\n {\n title: 'Create Tag',\n description:\n 'Create a new tag in the organization. Tags can be used to group dictionaries and provide AI context.',\n inputSchema: {\n ...authSchema,\n key: z.string().describe('Unique tag key'),\n name: z.string().optional().describe('Display name for the tag'),\n description: z.string().optional().describe('Description of the tag'),\n color: z.string().optional().describe('Tag color (hex code)'),\n instructions: z\n .string()\n .optional()\n .describe('AI instructions to apply when this tag is used'),\n },\n annotations: { destructiveHint: false },\n },\n async ({\n clientId,\n clientSecret,\n key,\n name,\n description,\n color,\n instructions,\n }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.tag.addTag({\n key,\n name,\n description,\n color,\n instructions,\n });\n return ok(result);\n } catch (error) {\n return fail('Create tag', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-tag-update',\n {\n title: 'Update Tag',\n description: 'Update an existing tag.',\n inputSchema: {\n ...authSchema,\n tagId: z.string().describe('Tag ID to update'),\n key: z.string().optional().describe('New key'),\n name: z.string().optional().describe('New display name'),\n description: z.string().optional().describe('New description'),\n color: z.string().optional().describe('New color (hex code)'),\n instructions: z.string().optional().describe('New AI instructions'),\n },\n annotations: { destructiveHint: true },\n },\n async ({\n clientId,\n clientSecret,\n tagId,\n key,\n name,\n description,\n color,\n instructions,\n }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.tag.updateTag(tagId, {\n key,\n name,\n description,\n color,\n instructions,\n });\n return ok(result);\n } catch (error) {\n return fail('Update tag', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-tag-delete',\n {\n title: 'Delete Tag',\n description: 'Delete a tag by its ID.',\n inputSchema: {\n ...authSchema,\n tagId: z.string().describe('Tag ID to delete'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, tagId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.tag.deleteTag(tagId);\n return ok(result);\n } catch (error) {\n return fail('Delete tag', error);\n }\n }\n );\n\n // ── Organizations ─────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-organizations-list',\n {\n title: 'List Organizations',\n description: 'List all organizations the authenticated user belongs to.',\n inputSchema: {\n ...authSchema,\n page: z.number().optional().describe('Page number (1-based)'),\n pageSize: z.number().optional().describe('Items per page'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, page, pageSize }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.organization.getOrganizations({\n page,\n pageSize,\n });\n return ok(result);\n } catch (error) {\n return fail('List organizations', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-organization-select',\n {\n title: 'Select Organization',\n description:\n 'Select an organization as the current active organization. Required before accessing organization-specific resources.',\n inputSchema: {\n ...authSchema,\n organizationId: z.string().describe('Organization ID to select'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, organizationId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result =\n await api.organization.selectOrganization(organizationId);\n return ok(result);\n } catch (error) {\n return fail('Select organization', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-organization-update',\n {\n title: 'Update Organization',\n description: 'Update the selected organization name or settings.',\n inputSchema: {\n ...authSchema,\n name: z.string().optional().describe('New organization name'),\n customInstructions: z\n .string()\n .optional()\n .describe('Custom AI instructions for this organization'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, name, customInstructions }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.organization.updateOrganization({\n name,\n customInstructions,\n });\n return ok(result);\n } catch (error) {\n return fail('Update organization', error);\n }\n }\n );\n\n // ── Projects ──────────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-cms-projects-list',\n {\n title: 'List CMS Projects',\n description:\n 'List all Intlayer CMS projects for the selected organization. These are server-side projects, not local project directories.',\n inputSchema: {\n ...authSchema,\n page: z.number().optional().describe('Page number (1-based)'),\n pageSize: z.number().optional().describe('Items per page'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, page, pageSize }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.project.getProjects({ page, pageSize });\n return ok(result);\n } catch (error) {\n return fail('List CMS projects', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-project-select',\n {\n title: 'Select CMS Project',\n description:\n 'Select a CMS project as the current active project. Required before accessing project-specific dictionaries.',\n inputSchema: {\n ...authSchema,\n projectId: z.string().describe('Project ID to select'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, projectId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.project.selectProject(projectId);\n return ok(result);\n } catch (error) {\n return fail('Select CMS project', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-project-create',\n {\n title: 'Create CMS Project',\n description: 'Create a new CMS project in the selected organization.',\n inputSchema: {\n ...authSchema,\n name: z.string().describe('Project name'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, name }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.project.addProject({ name });\n return ok(result);\n } catch (error) {\n return fail('Create CMS project', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-project-update',\n {\n title: 'Update CMS Project',\n description: 'Update the selected CMS project settings.',\n inputSchema: {\n ...authSchema,\n name: z.string().optional().describe('New project name'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, name }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.project.updateProject({ name });\n return ok(result);\n } catch (error) {\n return fail('Update CMS project', error);\n }\n }\n );\n};\n"],"mappings":";;;;;AAOA,MAAM,aAAa;CACjB,UAAU,EACP,OAAO,EACP,SAAS,EACT,SACC,mFACF;CACF,cAAc,EACX,OAAO,EACP,SAAS,EACT,SACC,8EACF;AACJ;AAEA,MA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,UAAU,YAAY,GACtB,QAAQ,WAAW,EAAE,KAAK,CAAC,CACpC;EAClB,SAAS,OAAO;GACd,OAAO,KAAK,sBAAsB,KAAK;EACzC;CACF,CACF;CAEA,OAAO,aACL,+BACA;EACE,OAAO;EACP,aAAa;EACb,aAAa;GACX,GAAG;GACH,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,kBAAkB;EACzD;EACA,aAAa,EAAE,iBAAiB,KAAK;CACvC,GACA,OAAO,EAAE,UAAU,cAAc,WAAW;EAC1C,IAAI;GAGF,OAAO,GAAG,OADW,MADH,OAAO,UAAU,YAAY,GACtB,QAAQ,cAAc,EAAE,KAAK,CAAC,CACvC;EAClB,SAAS,OAAO;GACd,OAAO,KAAK,sBAAsB,KAAK;EACzC;CACF,CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"api.mjs","names":[],"sources":["../../../src/tools/api.ts"],"sourcesContent":["import { getIntlayerAPI } from '@intlayer/api';\nimport { editor } from '@intlayer/config/built';\nimport z from 'zod';\nimport type { McpServer } from './docs';\n\ntype LoadAPITools = (server: McpServer) => void;\n\nconst authSchema = {\n clientId: z\n .string()\n .optional()\n .describe(\n 'Intlayer OAuth2 client ID (access key). Falls back to INTLAYER_CLIENT_ID env var.'\n ),\n clientSecret: z\n .string()\n .optional()\n .describe(\n 'Intlayer OAuth2 client secret. Falls back to INTLAYER_CLIENT_SECRET env var.'\n ),\n};\n\nconst getAPI = async (clientId?: string, clientSecret?: string) => {\n const resolvedClientId = clientId ?? editor.clientId;\n const resolvedClientSecret = clientSecret ?? editor.clientSecret;\n\n if (!resolvedClientId || !resolvedClientSecret) {\n throw new Error(\n 'Intlayer credentials not found. Provide clientId/clientSecret or set INTLAYER_CLIENT_ID/INTLAYER_CLIENT_SECRET.'\n );\n }\n\n const configWithCreds = {\n editor: {\n ...editor,\n clientId: resolvedClientId,\n clientSecret: resolvedClientSecret,\n },\n };\n\n const tempAPI = getIntlayerAPI({}, configWithCreds);\n const tokenResult = await tempAPI.oAuth.getOAuth2AccessToken();\n const token = (tokenResult as any)?.data?.access_token as string | undefined;\n\n if (!token) {\n throw new Error(\n 'Failed to obtain OAuth2 access token. Check your credentials.'\n );\n }\n\n return getIntlayerAPI(\n { headers: { Authorization: `Bearer ${token}` } },\n { editor }\n );\n};\n\nconst ok = (data: unknown) => ({\n content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],\n});\n\nconst fail = (label: string, error: unknown) => ({\n content: [\n {\n type: 'text' as const,\n text: `${label} failed: ${error instanceof Error ? error.message : String(error)}`,\n },\n ],\n isError: true as const,\n});\n\nexport const loadAPITools: LoadAPITools = (server) => {\n // ── Dictionaries ──────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-dictionaries-list',\n {\n title: 'List Dictionaries',\n description:\n 'List all dictionaries for the selected project. Returns keys, IDs, and metadata.',\n inputSchema: {\n ...authSchema,\n page: z.number().optional().describe('Page number (1-based)'),\n pageSize: z.number().optional().describe('Items per page'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, page, pageSize }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.getDictionaries({\n page,\n pageSize,\n });\n return ok(result);\n } catch (error) {\n return fail('List dictionaries', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-dictionary-get',\n {\n title: 'Get Dictionary',\n description: 'Get a dictionary by its key, including its full content.',\n inputSchema: {\n ...authSchema,\n dictionaryKey: z.string().describe('The dictionary key'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, dictionaryKey }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.getDictionary(dictionaryKey);\n return ok(result);\n } catch (error) {\n return fail('Get dictionary', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-dictionary-create',\n {\n title: 'Create Dictionary',\n description: 'Create a new dictionary in the selected project.',\n inputSchema: {\n ...authSchema,\n key: z.string().describe('Unique key for the dictionary'),\n title: z.string().optional().describe('Human-readable title'),\n description: z\n .string()\n .optional()\n .describe('Description of the dictionary'),\n content: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Initial content as JSON object'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, key, title, description, content }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.addDictionary({\n key,\n title,\n description,\n content,\n });\n return ok(result);\n } catch (error) {\n return fail('Create dictionary', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-dictionary-update',\n {\n title: 'Update Dictionary',\n description: 'Update an existing dictionary content or metadata.',\n inputSchema: {\n ...authSchema,\n id: z.string().describe('Dictionary ID'),\n key: z.string().optional().describe('New key for the dictionary'),\n title: z.string().optional().describe('New title'),\n description: z.string().optional().describe('New description'),\n content: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Updated content as JSON object'),\n },\n annotations: { destructiveHint: true },\n },\n async ({\n clientId,\n clientSecret,\n id,\n key,\n title,\n description,\n content,\n }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.updateDictionary({\n id,\n key,\n title,\n description,\n content,\n });\n return ok(result);\n } catch (error) {\n return fail('Update dictionary', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-dictionary-delete',\n {\n title: 'Delete Dictionary',\n description:\n 'Delete a dictionary by its ID. This action is irreversible.',\n inputSchema: {\n ...authSchema,\n dictionaryId: z.string().describe('Dictionary ID to delete'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, dictionaryId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.deleteDictionary(dictionaryId);\n return ok(result);\n } catch (error) {\n return fail('Delete dictionary', error);\n }\n }\n );\n\n // ── Tags ──────────────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-tags-list',\n {\n title: 'List Tags',\n description: 'List all tags for the selected organization.',\n inputSchema: {\n ...authSchema,\n page: z.number().optional().describe('Page number (1-based)'),\n pageSize: z.number().optional().describe('Items per page'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, page, pageSize }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.tag.getTags({ page, pageSize });\n return ok(result);\n } catch (error) {\n return fail('List tags', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-tag-create',\n {\n title: 'Create Tag',\n description:\n 'Create a new tag in the organization. Tags can be used to group dictionaries and provide AI context.',\n inputSchema: {\n ...authSchema,\n key: z.string().describe('Unique tag key'),\n name: z.string().optional().describe('Display name for the tag'),\n description: z.string().optional().describe('Description of the tag'),\n color: z.string().optional().describe('Tag color (hex code)'),\n instructions: z\n .string()\n .optional()\n .describe('AI instructions to apply when this tag is used'),\n },\n annotations: { destructiveHint: false },\n },\n async ({\n clientId,\n clientSecret,\n key,\n name,\n description,\n color,\n instructions,\n }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.tag.addTag({\n key,\n name,\n description,\n color,\n instructions,\n });\n return ok(result);\n } catch (error) {\n return fail('Create tag', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-tag-update',\n {\n title: 'Update Tag',\n description: 'Update an existing tag.',\n inputSchema: {\n ...authSchema,\n tagId: z.string().describe('Tag ID to update'),\n key: z.string().optional().describe('New key'),\n name: z.string().optional().describe('New display name'),\n description: z.string().optional().describe('New description'),\n color: z.string().optional().describe('New color (hex code)'),\n instructions: z.string().optional().describe('New AI instructions'),\n },\n annotations: { destructiveHint: true },\n },\n async ({\n clientId,\n clientSecret,\n tagId,\n key,\n name,\n description,\n color,\n instructions,\n }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.tag.updateTag(tagId, {\n key,\n name,\n description,\n color,\n instructions,\n });\n return ok(result);\n } catch (error) {\n return fail('Update tag', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-tag-delete',\n {\n title: 'Delete Tag',\n description: 'Delete a tag by its ID.',\n inputSchema: {\n ...authSchema,\n tagId: z.string().describe('Tag ID to delete'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, tagId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.tag.deleteTag(tagId);\n return ok(result);\n } catch (error) {\n return fail('Delete tag', error);\n }\n }\n );\n\n // ── Organizations ─────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-organizations-list',\n {\n title: 'List Organizations',\n description: 'List all organizations the authenticated user belongs to.',\n inputSchema: {\n ...authSchema,\n page: z.number().optional().describe('Page number (1-based)'),\n pageSize: z.number().optional().describe('Items per page'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, page, pageSize }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.organization.getOrganizations({\n page,\n pageSize,\n });\n return ok(result);\n } catch (error) {\n return fail('List organizations', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-organization-select',\n {\n title: 'Select Organization',\n description:\n 'Select an organization as the current active organization. Required before accessing organization-specific resources.',\n inputSchema: {\n ...authSchema,\n organizationId: z.string().describe('Organization ID to select'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, organizationId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result =\n await api.organization.selectOrganization(organizationId);\n return ok(result);\n } catch (error) {\n return fail('Select organization', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-organization-update',\n {\n title: 'Update Organization',\n description: 'Update the selected organization name or settings.',\n inputSchema: {\n ...authSchema,\n name: z.string().optional().describe('New organization name'),\n customInstructions: z\n .string()\n .optional()\n .describe('Custom AI instructions for this organization'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, name, customInstructions }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.organization.updateOrganization({\n name,\n customInstructions,\n });\n return ok(result);\n } catch (error) {\n return fail('Update organization', error);\n }\n }\n );\n\n // ── Projects ──────────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-cms-projects-list',\n {\n title: 'List CMS Projects',\n description:\n 'List all Intlayer CMS projects for the selected organization. These are server-side projects, not local project directories.',\n inputSchema: {\n ...authSchema,\n page: z.number().optional().describe('Page number (1-based)'),\n pageSize: z.number().optional().describe('Items per page'),\n },\n annotations: { readOnlyHint: true },\n },\n async ({ clientId, clientSecret, page, pageSize }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.project.getProjects({ page, pageSize });\n return ok(result);\n } catch (error) {\n return fail('List CMS projects', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-project-select',\n {\n title: 'Select CMS Project',\n description:\n 'Select a CMS project as the current active project. Required before accessing project-specific dictionaries.',\n inputSchema: {\n ...authSchema,\n projectId: z.string().describe('Project ID to select'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, projectId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.project.selectProject(projectId);\n return ok(result);\n } catch (error) {\n return fail('Select CMS project', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-project-create',\n {\n title: 'Create CMS Project',\n description: 'Create a new CMS project in the selected organization.',\n inputSchema: {\n ...authSchema,\n name: z.string().describe('Project name'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, name }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.project.addProject({ name });\n return ok(result);\n } catch (error) {\n return fail('Create CMS project', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-project-update',\n {\n title: 'Update CMS Project',\n description: 'Update the selected CMS project settings.',\n inputSchema: {\n ...authSchema,\n name: z.string().optional().describe('New project name'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, name }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.project.updateProject({ name });\n return ok(result);\n } catch (error) {\n return fail('Update CMS project', error);\n }\n }\n );\n\n // ── Environments ──────────────────────────────────────────────────────────\n\n server.registerTool(\n 'intlayer-cms-environment-select',\n {\n title: 'Select CMS Environment',\n description:\n 'Select a CMS environment as the current active environment. Required before accessing environment-specific dictionaries.',\n inputSchema: {\n ...authSchema,\n environmentId: z.string().describe('Environment ID to select'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, environmentId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.environment.selectEnvironment(environmentId);\n return ok(result);\n } catch (error) {\n return fail('Select CMS environment', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-environment-reset',\n {\n title: 'Reset CMS Environment to Production',\n description:\n 'Reset the current active environment to the default production environment.',\n inputSchema: {\n ...authSchema,\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.environment.resetToProductionEnvironment();\n return ok(result);\n } catch (error) {\n return fail('Reset CMS environment', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-environment-create',\n {\n title: 'Create CMS Environment',\n description: 'Create a new CMS environment in the selected project.',\n inputSchema: {\n ...authSchema,\n name: z.string().describe('Environment name'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, name }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.environment.addEnvironment({ name });\n return ok(result);\n } catch (error) {\n return fail('Create CMS environment', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-environment-update',\n {\n title: 'Update CMS Environment',\n description: 'Update the selected CMS environment settings.',\n inputSchema: {\n ...authSchema,\n environmentId: z.string().describe('Environment ID to update'),\n name: z.string().optional().describe('New environment name'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, environmentId, name }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.environment.updateEnvironment(environmentId, {\n name,\n });\n return ok(result);\n } catch (error) {\n return fail('Update CMS environment', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-environment-delete',\n {\n title: 'Delete CMS Environment',\n description: 'Delete a CMS environment by its ID.',\n inputSchema: {\n ...authSchema,\n environmentId: z.string().describe('Environment ID to delete'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, environmentId }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.environment.deleteEnvironment(environmentId);\n return ok(result);\n } catch (error) {\n return fail('Delete CMS environment', error);\n }\n }\n );\n\n server.registerTool(\n 'intlayer-cms-environment-migrate',\n {\n title: 'Migrate CMS Environment',\n description:\n 'Migrate dictionaries and configuration from one environment to another.',\n inputSchema: {\n ...authSchema,\n sourceEnvironmentId: z.string().describe('Source environment ID'),\n targetEnvironmentId: z.string().describe('Target environment ID'),\n strategy: z\n .enum(['overwrite', 'fill-missing'])\n .describe(\n 'Migration strategy: overwrite existing or only fill missing'\n ),\n migrateContent: z\n .boolean()\n .optional()\n .describe('Whether to migrate content (dictionaries)'),\n migrateConfiguration: z\n .boolean()\n .optional()\n .describe('Whether to migrate environment configuration'),\n },\n annotations: { destructiveHint: true },\n },\n async ({\n clientId,\n clientSecret,\n sourceEnvironmentId,\n targetEnvironmentId,\n strategy,\n migrateContent,\n migrateConfiguration,\n }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.environment.migrateEnvironment({\n sourceEnvironmentId,\n targetEnvironmentId,\n strategy,\n migrateContent,\n migrateConfiguration,\n });\n return ok(result);\n } catch (error) {\n return fail('Migrate CMS environment', error);\n }\n }\n );\n};\n"],"mappings":";;;;;AAOA,MAAM,aAAa;CACjB,UAAU,EACP,OAAO,EACP,SAAS,EACT,SACC,mFACF;CACF,cAAc,EACX,OAAO,EACP,SAAS,EACT,SACC,8EACF;AACJ;AAEA,MAAM,SAAS,OAAO,UAAmB,iBAA0B;CACjE,MAAM,mBAAmB,YAAY,OAAO;CAC5C,MAAM,uBAAuB,gBAAgB,OAAO;CAEpD,IAAI,CAAC,oBAAoB,CAAC,sBACxB,MAAM,IAAI,MACR,iHACF;CAaF,MAAM,SAAS,MAFC,eA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cACA,qBACA,qBACA,UACA,gBACA,2BACI;EACJ,IAAI;GASF,OAAO,GAAG,OAPW,MADH,OAAO,UAAU,YAAY,GACtB,YAAY,mBAAmB;IACtD;IACA;IACA;IACA;IACA;GACF,CAAC,CACe;EAClB,SAAS,OAAO;GACd,OAAO,KAAK,2BAA2B,KAAK;EAC9C;CACF,CACF;AACF"}
|
package/dist/esm/tools/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { listProjects } from "@intlayer/chokidar/cli";
|
|
2
|
-
import z from "zod";
|
|
3
1
|
import { relative } from "node:path";
|
|
2
|
+
import z from "zod";
|
|
3
|
+
import { listProjects } from "@intlayer/chokidar/cli";
|
|
4
4
|
import { build, extract, fill, init, listContentDeclarationRows, listMissingTranslations, pull, push } from "@intlayer/cli";
|
|
5
5
|
import { ALL_LOCALES } from "@intlayer/types/allLocales";
|
|
6
6
|
|
package/dist/esm/tools/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { loadInstallLSPTool } from "./installLSP.mjs";
|
|
2
|
-
import { loadCLITools } from "./cli.mjs";
|
|
3
1
|
import { loadAPITools } from "./api.mjs";
|
|
4
|
-
import {
|
|
2
|
+
import { loadCLITools } from "./cli.mjs";
|
|
5
3
|
import { loadDocsTools } from "./docs.mjs";
|
|
4
|
+
import { loadInstallLSPTool } from "./installLSP.mjs";
|
|
5
|
+
import { loadInstallSkillsTool } from "./installSkills.mjs";
|
|
6
6
|
|
|
7
7
|
export { loadAPITools, loadCLITools, loadDocsTools, loadInstallLSPTool, loadInstallSkillsTool };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PLATFORMS, SKILLS, installSkills } from "@intlayer/chokidar/cli";
|
|
2
|
-
import z from "zod";
|
|
3
1
|
import * as readline from "node:readline";
|
|
2
|
+
import z from "zod";
|
|
3
|
+
import { PLATFORMS, SKILLS, installSkills } from "@intlayer/chokidar/cli";
|
|
4
4
|
|
|
5
5
|
//#region src/tools/installSkills.ts
|
|
6
6
|
const loadInstallSkillsTool = (server) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/mcp",
|
|
3
|
-
"version": "8.12.
|
|
3
|
+
"version": "8.12.2",
|
|
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": [
|
|
@@ -111,21 +111,21 @@
|
|
|
111
111
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
112
112
|
},
|
|
113
113
|
"dependencies": {
|
|
114
|
-
"@ai-sdk/mcp": "
|
|
114
|
+
"@ai-sdk/mcp": "1.0.44",
|
|
115
115
|
"@fastify/cors": "11.2.0",
|
|
116
116
|
"@fastify/helmet": "13.0.2",
|
|
117
|
-
"@intlayer/api": "8.12.
|
|
118
|
-
"@intlayer/chokidar": "8.12.
|
|
119
|
-
"@intlayer/cli": "8.12.
|
|
120
|
-
"@intlayer/config": "8.12.
|
|
121
|
-
"@intlayer/docs": "8.12.
|
|
122
|
-
"@intlayer/types": "8.12.
|
|
117
|
+
"@intlayer/api": "8.12.2",
|
|
118
|
+
"@intlayer/chokidar": "8.12.2",
|
|
119
|
+
"@intlayer/cli": "8.12.2",
|
|
120
|
+
"@intlayer/config": "8.12.2",
|
|
121
|
+
"@intlayer/docs": "8.12.1",
|
|
122
|
+
"@intlayer/types": "8.12.2",
|
|
123
123
|
"dotenv": "17.4.2",
|
|
124
124
|
"fastify": "5.8.5",
|
|
125
125
|
"zod": "4.4.3"
|
|
126
126
|
},
|
|
127
127
|
"devDependencies": {
|
|
128
|
-
"@intlayer/types": "8.12.
|
|
128
|
+
"@intlayer/types": "8.12.2",
|
|
129
129
|
"@types/node": "25.9.1",
|
|
130
130
|
"@utils/ts-config": "1.0.4",
|
|
131
131
|
"@utils/ts-config-types": "1.0.4",
|