@intlayer/mcp 8.9.3 → 8.9.4-canary.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,17 +1,10 @@
1
- import { dirname as dirname$1, resolve } from "node:path";
2
- import { readFileSync } from "node:fs";
1
+ import { dirname as dirname$1 } from "node:path";
3
2
  import { fileURLToPath } from "node:url";
4
3
  import { isESModule } from "@intlayer/config/utils";
5
- import { Client } from "@modelcontextprotocol/sdk/client/index.js";
6
4
 
7
5
  //#region src/client/client.ts
8
6
  const dirname = isESModule ? dirname$1(fileURLToPath(import.meta.url)) : __dirname;
9
- const packageJson = JSON.parse(readFileSync(resolve(dirname, "../../../package.json"), "utf8"));
10
- const loadClient = () => new Client({
11
- name: `mcp-client-for-intlayer-mcp-server`,
12
- version: packageJson.version
13
- });
14
7
 
15
8
  //#endregion
16
- export { dirname, loadClient };
9
+ export { dirname };
17
10
  //# sourceMappingURL=client.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.mjs","names":["pathDirname"],"sources":["../../../src/client/client.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { dirname as pathDirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { isESModule } from '@intlayer/config/utils';\nimport { Client } from '@modelcontextprotocol/sdk/client/index.js';\n\nexport const dirname: string = isESModule\n ? pathDirname(fileURLToPath(import.meta.url))\n : __dirname;\n\nconst packageJson: Record<string, any> = JSON.parse(\n readFileSync(resolve(dirname, '../../../package.json'), 'utf8')\n);\n\ntype LoadClient = () => Client;\n\nexport const loadClient: LoadClient = () =>\n new Client({\n name: `mcp-client-for-intlayer-mcp-server`,\n version: packageJson.version,\n });\n"],"mappings":";;;;;;;AAMA,MAAa,UAAkB,aAC3BA,UAAY,cAAc,OAAO,KAAK,IAAI,CAAC,GAC3C;AAEJ,MAAM,cAAmC,KAAK,MAC5C,aAAa,QAAQ,SAAS,wBAAwB,EAAE,OAAO,CAChE;AAID,MAAa,mBACX,IAAI,OAAO;CACT,MAAM;CACN,SAAS,YAAY;CACtB,CAAC"}
1
+ {"version":3,"file":"client.mjs","names":["pathDirname"],"sources":["../../../src/client/client.ts"],"sourcesContent":["import { dirname as pathDirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { isESModule } from '@intlayer/config/utils';\n\nexport const dirname: string = isESModule\n ? pathDirname(fileURLToPath(import.meta.url))\n : __dirname;\n"],"mappings":";;;;;AAIA,MAAa,UAAkB,aAC3BA,UAAY,cAAc,OAAO,KAAK,IAAI,CAAC,GAC3C"}
@@ -1,59 +1,26 @@
1
- import { loadClient } from "./client.mjs";
2
- import { URL } from "node:url";
3
- import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
1
+ import { createMCPClient } from "@ai-sdk/mcp";
4
2
 
5
3
  //#region src/client/sse.ts
6
- var SSEClient = class {
7
- client;
8
- transport = null;
9
- isCompleted = false;
10
- constructor() {
11
- this.client = loadClient();
12
- }
13
- async connectToServer() {
14
- const mcpServerURL = process.env.MCP_SERVER_URL ?? "http://localhost:3000/";
15
- const url = new URL(mcpServerURL);
16
- try {
17
- console.info(`Connecting to server - ${mcpServerURL}`);
18
- this.transport = new StreamableHTTPClientTransport(url);
19
- await this.client.connect(this.transport);
20
- console.info("Connected to MCP server");
21
- this.setUpTransport();
22
- } catch (e) {
23
- console.error("Failed to connect to MCP server: ", e);
24
- throw e;
25
- }
26
- }
27
- setUpTransport() {
28
- if (this.transport === null) return;
29
- this.transport.onclose = () => {
30
- console.info("Transport closed.");
31
- this.isCompleted = true;
32
- };
33
- this.transport.onerror = async (error) => {
34
- console.error("Transport error: ", error);
35
- await this.cleanup();
36
- };
37
- this.transport.onmessage = (message) => {
38
- console.info("Message received: ", message);
39
- };
40
- }
41
- async waitForCompletion() {
42
- while (!this.isCompleted) await new Promise((resolve) => setTimeout(resolve, 100));
43
- }
44
- async cleanup() {
45
- if (this.transport) await this.client.close();
46
- }
47
- };
48
4
  const main = async () => {
49
- const client = new SSEClient();
5
+ const mcpServerURL = process.env.MCP_SERVER_URL ?? "http://localhost:3000/";
6
+ console.info(`Connecting to server - ${mcpServerURL}`);
7
+ let mcpClient;
50
8
  try {
51
- await client.connectToServer();
52
- await client.waitForCompletion();
9
+ mcpClient = await createMCPClient({ transport: {
10
+ type: "http",
11
+ url: mcpServerURL
12
+ } });
13
+ console.info("Connected to MCP server");
14
+ await new Promise((resolve) => {
15
+ process.once("SIGINT", resolve);
16
+ process.once("SIGTERM", resolve);
17
+ });
53
18
  } catch (error) {
54
- console.error(error);
19
+ console.error("Failed to connect to MCP server: ", error);
20
+ throw error;
55
21
  } finally {
56
- await client.cleanup();
22
+ await mcpClient?.close();
23
+ console.info("Connection closed.");
57
24
  }
58
25
  };
59
26
  main();
@@ -1 +1 @@
1
- {"version":3,"file":"sse.mjs","names":[],"sources":["../../../src/client/sse.ts"],"sourcesContent":["import { URL } from 'node:url';\nimport type { Client } from '@modelcontextprotocol/sdk/client/index.js';\nimport { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';\nimport type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';\nimport { loadClient } from './client';\n\nclass SSEClient {\n private client: Client;\n private transport: Transport | null = null;\n private isCompleted = false;\n\n constructor() {\n this.client = loadClient();\n }\n\n async connectToServer() {\n const mcpServerURL = process.env.MCP_SERVER_URL ?? 'http://localhost:3000/';\n\n const url = new URL(mcpServerURL);\n try {\n console.info(`Connecting to server - ${mcpServerURL}`);\n this.transport = new StreamableHTTPClientTransport(url);\n await this.client.connect(this.transport);\n console.info('Connected to MCP server');\n\n this.setUpTransport();\n } catch (e) {\n console.error('Failed to connect to MCP server: ', e);\n throw e;\n }\n }\n\n private setUpTransport() {\n if (this.transport === null) return;\n\n this.transport.onclose = () => {\n console.info('Transport closed.');\n this.isCompleted = true;\n };\n\n this.transport.onerror = async (error) => {\n console.error('Transport error: ', error);\n await this.cleanup();\n };\n\n this.transport.onmessage = (message) => {\n console.info('Message received: ', message);\n };\n }\n\n async waitForCompletion() {\n while (!this.isCompleted) {\n await new Promise((resolve) => setTimeout(resolve, 100));\n }\n }\n\n async cleanup() {\n if (this.transport) {\n await this.client.close();\n }\n }\n}\n\nconst main = async () => {\n const client = new SSEClient();\n try {\n await client.connectToServer();\n await client.waitForCompletion();\n } catch (error) {\n console.error(error);\n } finally {\n await client.cleanup();\n }\n};\n\nmain();\n"],"mappings":";;;;;AAMA,IAAM,YAAN,MAAgB;CACd,AAAQ;CACR,AAAQ,YAA8B;CACtC,AAAQ,cAAc;CAEtB,cAAc;EACZ,KAAK,SAAS,YAAY;;CAG5B,MAAM,kBAAkB;EACtB,MAAM,eAAe,QAAQ,IAAI,kBAAkB;EAEnD,MAAM,MAAM,IAAI,IAAI,aAAa;EACjC,IAAI;GACF,QAAQ,KAAK,0BAA0B,eAAe;GACtD,KAAK,YAAY,IAAI,8BAA8B,IAAI;GACvD,MAAM,KAAK,OAAO,QAAQ,KAAK,UAAU;GACzC,QAAQ,KAAK,0BAA0B;GAEvC,KAAK,gBAAgB;WACd,GAAG;GACV,QAAQ,MAAM,qCAAqC,EAAE;GACrD,MAAM;;;CAIV,AAAQ,iBAAiB;EACvB,IAAI,KAAK,cAAc,MAAM;EAE7B,KAAK,UAAU,gBAAgB;GAC7B,QAAQ,KAAK,oBAAoB;GACjC,KAAK,cAAc;;EAGrB,KAAK,UAAU,UAAU,OAAO,UAAU;GACxC,QAAQ,MAAM,qBAAqB,MAAM;GACzC,MAAM,KAAK,SAAS;;EAGtB,KAAK,UAAU,aAAa,YAAY;GACtC,QAAQ,KAAK,sBAAsB,QAAQ;;;CAI/C,MAAM,oBAAoB;EACxB,OAAO,CAAC,KAAK,aACX,MAAM,IAAI,SAAS,YAAY,WAAW,SAAS,IAAI,CAAC;;CAI5D,MAAM,UAAU;EACd,IAAI,KAAK,WACP,MAAM,KAAK,OAAO,OAAO;;;AAK/B,MAAM,OAAO,YAAY;CACvB,MAAM,SAAS,IAAI,WAAW;CAC9B,IAAI;EACF,MAAM,OAAO,iBAAiB;EAC9B,MAAM,OAAO,mBAAmB;UACzB,OAAO;EACd,QAAQ,MAAM,MAAM;WACZ;EACR,MAAM,OAAO,SAAS;;;AAI1B,MAAM"}
1
+ {"version":3,"file":"sse.mjs","names":[],"sources":["../../../src/client/sse.ts"],"sourcesContent":["import { createMCPClient, type MCPClient } from '@ai-sdk/mcp';\n\nconst main = async () => {\n const mcpServerURL = process.env.MCP_SERVER_URL ?? 'http://localhost:3000/';\n\n console.info(`Connecting to server - ${mcpServerURL}`);\n\n let mcpClient: MCPClient | undefined;\n try {\n mcpClient = await createMCPClient({\n transport: {\n type: 'http',\n url: mcpServerURL,\n },\n });\n console.info('Connected to MCP server');\n\n await new Promise<void>((resolve) => {\n process.once('SIGINT', resolve);\n process.once('SIGTERM', resolve);\n });\n } catch (error) {\n console.error('Failed to connect to MCP server: ', error);\n throw error;\n } finally {\n await mcpClient?.close();\n console.info('Connection closed.');\n }\n};\n\nmain();\n"],"mappings":";;;AAEA,MAAM,OAAO,YAAY;CACvB,MAAM,eAAe,QAAQ,IAAI,kBAAkB;CAEnD,QAAQ,KAAK,0BAA0B,eAAe;CAEtD,IAAI;CACJ,IAAI;EACF,YAAY,MAAM,gBAAgB,EAChC,WAAW;GACT,MAAM;GACN,KAAK;GACN,EACF,CAAC;EACF,QAAQ,KAAK,0BAA0B;EAEvC,MAAM,IAAI,SAAe,YAAY;GACnC,QAAQ,KAAK,UAAU,QAAQ;GAC/B,QAAQ,KAAK,WAAW,QAAQ;IAChC;UACK,OAAO;EACd,QAAQ,MAAM,qCAAqC,MAAM;EACzD,MAAM;WACE;EACR,MAAM,WAAW,OAAO;EACxB,QAAQ,KAAK,qBAAqB;;;AAItC,MAAM"}
@@ -1,11 +1,12 @@
1
1
  import { loadCLITools } from "../tools/cli.mjs";
2
+ import { loadAPITools } from "../tools/api.mjs";
2
3
  import { loadInstallSkillsTool } from "../tools/installSkills.mjs";
3
4
  import { loadDocsTools } from "../tools/docs.mjs";
4
5
  import { dirname as dirname$1, resolve } from "node:path";
5
- import { readFileSync } from "node:fs";
6
6
  import { fileURLToPath } from "node:url";
7
7
  import { isESModule } from "@intlayer/config/utils";
8
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
8
+ import { readFileSync } from "node:fs";
9
+ import { McpServer } from "/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/@modelcontextprotocol+sdk@1.29.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js";
9
10
 
10
11
  //#region src/server/server.ts
11
12
  const dirname = isESModule ? dirname$1(fileURLToPath(import.meta.url)) : __dirname;
@@ -26,6 +27,11 @@ const loadServer = ({ isLocal }) => {
26
27
  } catch (error) {
27
28
  console.error("Error loading docs tools:", error);
28
29
  }
30
+ try {
31
+ loadAPITools(server);
32
+ } catch (error) {
33
+ console.error("Error loading API tools:", error);
34
+ }
29
35
  return server;
30
36
  };
31
37
 
@@ -1 +1 @@
1
- {"version":3,"file":"server.mjs","names":["pathDirname"],"sources":["../../../src/server/server.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { dirname as pathDirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { isESModule } from '@intlayer/config/utils';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { loadCLITools } from '../tools/cli';\nimport { loadDocsTools } from '../tools/docs';\nimport { loadInstallSkillsTool } from '../tools/installSkills';\n\nexport const dirname: string = isESModule\n ? pathDirname(fileURLToPath(import.meta.url))\n : __dirname;\n\nconst packageJson: Record<string, any> = JSON.parse(\n readFileSync(resolve(dirname, '../../../package.json'), 'utf8')\n);\n\ntype LoadServer = (options: { isLocal: boolean }) => McpServer;\n\nexport const loadServer: LoadServer = ({ isLocal }) => {\n const server = new McpServer({\n name: 'intlayer',\n version: packageJson.version,\n });\n\n if (isLocal) {\n try {\n loadCLITools(server);\n loadInstallSkillsTool(server);\n } catch (error) {\n console.error('Error loading CLI tools:', error);\n }\n }\n\n try {\n loadDocsTools(server);\n } catch (error) {\n console.error('Error loading docs tools:', error);\n }\n\n return server;\n};\n"],"mappings":";;;;;;;;;;AASA,MAAa,UAAkB,aAC3BA,UAAY,cAAc,OAAO,KAAK,IAAI,CAAC,GAC3C;AAEJ,MAAM,cAAmC,KAAK,MAC5C,aAAa,QAAQ,SAAS,wBAAwB,EAAE,OAAO,CAChE;AAID,MAAa,cAA0B,EAAE,cAAc;CACrD,MAAM,SAAS,IAAI,UAAU;EAC3B,MAAM;EACN,SAAS,YAAY;EACtB,CAAC;CAEF,IAAI,SACF,IAAI;EACF,aAAa,OAAO;EACpB,sBAAsB,OAAO;UACtB,OAAO;EACd,QAAQ,MAAM,4BAA4B,MAAM;;CAIpD,IAAI;EACF,cAAc,OAAO;UACd,OAAO;EACd,QAAQ,MAAM,6BAA6B,MAAM;;CAGnD,OAAO"}
1
+ {"version":3,"file":"server.mjs","names":["pathDirname"],"sources":["../../../src/server/server.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { dirname as pathDirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { isESModule } from '@intlayer/config/utils';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { loadAPITools } from '../tools/api';\nimport { loadCLITools } from '../tools/cli';\nimport { loadDocsTools } from '../tools/docs';\nimport { loadInstallSkillsTool } from '../tools/installSkills';\n\nexport const dirname: string = isESModule\n ? pathDirname(fileURLToPath(import.meta.url))\n : __dirname;\n\nconst packageJson: Record<string, any> = JSON.parse(\n readFileSync(resolve(dirname, '../../../package.json'), 'utf8')\n);\n\ntype LoadServer = (options: { isLocal: boolean }) => McpServer;\n\nexport const loadServer: LoadServer = ({ isLocal }) => {\n const server = new McpServer({\n name: 'intlayer',\n version: packageJson.version,\n });\n\n if (isLocal) {\n try {\n loadCLITools(server);\n loadInstallSkillsTool(server);\n } catch (error) {\n console.error('Error loading CLI tools:', error);\n }\n }\n\n try {\n loadDocsTools(server);\n } catch (error) {\n console.error('Error loading docs tools:', error);\n }\n\n try {\n loadAPITools(server);\n } catch (error) {\n console.error('Error loading API tools:', error);\n }\n\n return server;\n};\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,UAAkB,aAC3BA,UAAY,cAAc,OAAO,KAAK,IAAI,CAAC,GAC3C;AAEJ,MAAM,cAAmC,KAAK,MAC5C,aAAa,QAAQ,SAAS,wBAAwB,EAAE,OAAO,CAChE;AAID,MAAa,cAA0B,EAAE,cAAc;CACrD,MAAM,SAAS,IAAI,UAAU;EAC3B,MAAM;EACN,SAAS,YAAY;EACtB,CAAC;CAEF,IAAI,SACF,IAAI;EACF,aAAa,OAAO;EACpB,sBAAsB,OAAO;UACtB,OAAO;EACd,QAAQ,MAAM,4BAA4B,MAAM;;CAIpD,IAAI;EACF,cAAc,OAAO;UACd,OAAO;EACd,QAAQ,MAAM,6BAA6B,MAAM;;CAGnD,IAAI;EACF,aAAa,OAAO;UACb,OAAO;EACd,QAAQ,MAAM,4BAA4B,MAAM;;CAGlD,OAAO"}
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { loadServer } from "./server.mjs";
3
3
  import { randomUUID } from "node:crypto";
4
- import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
4
+ import { StreamableHTTPServerTransport } from "/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/@modelcontextprotocol+sdk@1.29.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.js";
5
5
  import dotenv from "dotenv";
6
6
  import express from "express";
7
7
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { loadServer } from "./server.mjs";
3
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
+ import { StdioServerTransport } from "/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/@modelcontextprotocol+sdk@1.29.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js";
4
4
 
5
5
  //#region src/server/stdio.ts
6
6
  const server = loadServer({ isLocal: true });
@@ -0,0 +1,341 @@
1
+ import z from "zod";
2
+ import { getConfiguration } from "@intlayer/config";
3
+ import { getIntlayerAPI } from "@intlayer/api";
4
+
5
+ //#region src/tools/api.ts
6
+ const authSchema = {
7
+ clientId: z.string().optional().describe("Intlayer OAuth2 client ID (access key). Falls back to INTLAYER_CLIENT_ID env var."),
8
+ clientSecret: z.string().optional().describe("Intlayer OAuth2 client secret. Falls back to INTLAYER_CLIENT_SECRET env var.")
9
+ };
10
+ const getAPI = async (clientId, clientSecret) => {
11
+ const config = getConfiguration();
12
+ const resolvedClientId = clientId ?? config.editor.clientId;
13
+ const resolvedClientSecret = clientSecret ?? config.editor.clientSecret;
14
+ if (!resolvedClientId || !resolvedClientSecret) throw new Error("Intlayer credentials not found. Provide clientId/clientSecret or set INTLAYER_CLIENT_ID/INTLAYER_CLIENT_SECRET.");
15
+ const token = (await getIntlayerAPI({}, {
16
+ ...config,
17
+ editor: {
18
+ ...config.editor,
19
+ clientId: resolvedClientId,
20
+ clientSecret: resolvedClientSecret
21
+ }
22
+ }).oAuth.getOAuth2AccessToken())?.data?.access_token;
23
+ if (!token) throw new Error("Failed to obtain OAuth2 access token. Check your credentials.");
24
+ return getIntlayerAPI({ headers: { Authorization: `Bearer ${token}` } }, config);
25
+ };
26
+ const ok = (data) => ({ content: [{
27
+ type: "text",
28
+ text: JSON.stringify(data, null, 2)
29
+ }] });
30
+ const fail = (label, error) => ({
31
+ content: [{
32
+ type: "text",
33
+ text: `${label} failed: ${error instanceof Error ? error.message : String(error)}`
34
+ }],
35
+ isError: true
36
+ });
37
+ const loadAPITools = (server) => {
38
+ server.registerTool("intlayer-dictionaries-list", {
39
+ title: "List Dictionaries",
40
+ description: "List all dictionaries for the selected project. Returns keys, IDs, and metadata.",
41
+ inputSchema: {
42
+ ...authSchema,
43
+ page: z.number().optional().describe("Page number (1-based)"),
44
+ pageSize: z.number().optional().describe("Items per page")
45
+ },
46
+ annotations: { readOnlyHint: true }
47
+ }, async ({ clientId, clientSecret, page, pageSize }) => {
48
+ try {
49
+ return ok(await (await getAPI(clientId, clientSecret)).dictionary.getDictionaries({
50
+ page,
51
+ pageSize
52
+ }));
53
+ } catch (error) {
54
+ return fail("List dictionaries", error);
55
+ }
56
+ });
57
+ server.registerTool("intlayer-dictionary-get", {
58
+ title: "Get Dictionary",
59
+ description: "Get a dictionary by its key, including its full content.",
60
+ inputSchema: {
61
+ ...authSchema,
62
+ dictionaryKey: z.string().describe("The dictionary key")
63
+ },
64
+ annotations: { readOnlyHint: true }
65
+ }, async ({ clientId, clientSecret, dictionaryKey }) => {
66
+ try {
67
+ return ok(await (await getAPI(clientId, clientSecret)).dictionary.getDictionary(dictionaryKey));
68
+ } catch (error) {
69
+ return fail("Get dictionary", error);
70
+ }
71
+ });
72
+ server.registerTool("intlayer-dictionary-create", {
73
+ title: "Create Dictionary",
74
+ description: "Create a new dictionary in the selected project.",
75
+ inputSchema: {
76
+ ...authSchema,
77
+ key: z.string().describe("Unique key for the dictionary"),
78
+ title: z.string().optional().describe("Human-readable title"),
79
+ description: z.string().optional().describe("Description of the dictionary"),
80
+ content: z.record(z.unknown()).optional().describe("Initial content as JSON object")
81
+ },
82
+ annotations: { destructiveHint: false }
83
+ }, async ({ clientId, clientSecret, key, title, description, content }) => {
84
+ try {
85
+ return ok(await (await getAPI(clientId, clientSecret)).dictionary.addDictionary({
86
+ key,
87
+ title,
88
+ description,
89
+ content
90
+ }));
91
+ } catch (error) {
92
+ return fail("Create dictionary", error);
93
+ }
94
+ });
95
+ server.registerTool("intlayer-dictionary-update", {
96
+ title: "Update Dictionary",
97
+ description: "Update an existing dictionary content or metadata.",
98
+ inputSchema: {
99
+ ...authSchema,
100
+ id: z.string().describe("Dictionary ID"),
101
+ key: z.string().optional().describe("New key for the dictionary"),
102
+ title: z.string().optional().describe("New title"),
103
+ description: z.string().optional().describe("New description"),
104
+ content: z.record(z.unknown()).optional().describe("Updated content as JSON object")
105
+ },
106
+ annotations: { destructiveHint: true }
107
+ }, async ({ clientId, clientSecret, id, key, title, description, content }) => {
108
+ try {
109
+ return ok(await (await getAPI(clientId, clientSecret)).dictionary.updateDictionary({
110
+ id,
111
+ key,
112
+ title,
113
+ description,
114
+ content
115
+ }));
116
+ } catch (error) {
117
+ return fail("Update dictionary", error);
118
+ }
119
+ });
120
+ server.registerTool("intlayer-dictionary-delete", {
121
+ title: "Delete Dictionary",
122
+ description: "Delete a dictionary by its ID. This action is irreversible.",
123
+ inputSchema: {
124
+ ...authSchema,
125
+ dictionaryId: z.string().describe("Dictionary ID to delete")
126
+ },
127
+ annotations: { destructiveHint: true }
128
+ }, async ({ clientId, clientSecret, dictionaryId }) => {
129
+ try {
130
+ return ok(await (await getAPI(clientId, clientSecret)).dictionary.deleteDictionary(dictionaryId));
131
+ } catch (error) {
132
+ return fail("Delete dictionary", error);
133
+ }
134
+ });
135
+ server.registerTool("intlayer-tags-list", {
136
+ title: "List Tags",
137
+ description: "List all tags for the selected organization.",
138
+ inputSchema: {
139
+ ...authSchema,
140
+ page: z.number().optional().describe("Page number (1-based)"),
141
+ pageSize: z.number().optional().describe("Items per page")
142
+ },
143
+ annotations: { readOnlyHint: true }
144
+ }, async ({ clientId, clientSecret, page, pageSize }) => {
145
+ try {
146
+ return ok(await (await getAPI(clientId, clientSecret)).tag.getTags({
147
+ page,
148
+ pageSize
149
+ }));
150
+ } catch (error) {
151
+ return fail("List tags", error);
152
+ }
153
+ });
154
+ server.registerTool("intlayer-tag-create", {
155
+ title: "Create Tag",
156
+ description: "Create a new tag in the organization. Tags can be used to group dictionaries and provide AI context.",
157
+ inputSchema: {
158
+ ...authSchema,
159
+ key: z.string().describe("Unique tag key"),
160
+ name: z.string().optional().describe("Display name for the tag"),
161
+ description: z.string().optional().describe("Description of the tag"),
162
+ color: z.string().optional().describe("Tag color (hex code)"),
163
+ instructions: z.string().optional().describe("AI instructions to apply when this tag is used")
164
+ },
165
+ annotations: { destructiveHint: false }
166
+ }, async ({ clientId, clientSecret, key, name, description, color, instructions }) => {
167
+ try {
168
+ return ok(await (await getAPI(clientId, clientSecret)).tag.addTag({
169
+ key,
170
+ name,
171
+ description,
172
+ color,
173
+ instructions
174
+ }));
175
+ } catch (error) {
176
+ return fail("Create tag", error);
177
+ }
178
+ });
179
+ server.registerTool("intlayer-tag-update", {
180
+ title: "Update Tag",
181
+ description: "Update an existing tag.",
182
+ inputSchema: {
183
+ ...authSchema,
184
+ tagId: z.string().describe("Tag ID to update"),
185
+ key: z.string().optional().describe("New key"),
186
+ name: z.string().optional().describe("New display name"),
187
+ description: z.string().optional().describe("New description"),
188
+ color: z.string().optional().describe("New color (hex code)"),
189
+ instructions: z.string().optional().describe("New AI instructions")
190
+ },
191
+ annotations: { destructiveHint: true }
192
+ }, async ({ clientId, clientSecret, tagId, key, name, description, color, instructions }) => {
193
+ try {
194
+ return ok(await (await getAPI(clientId, clientSecret)).tag.updateTag(tagId, {
195
+ key,
196
+ name,
197
+ description,
198
+ color,
199
+ instructions
200
+ }));
201
+ } catch (error) {
202
+ return fail("Update tag", error);
203
+ }
204
+ });
205
+ server.registerTool("intlayer-tag-delete", {
206
+ title: "Delete Tag",
207
+ description: "Delete a tag by its ID.",
208
+ inputSchema: {
209
+ ...authSchema,
210
+ tagId: z.string().describe("Tag ID to delete")
211
+ },
212
+ annotations: { destructiveHint: true }
213
+ }, async ({ clientId, clientSecret, tagId }) => {
214
+ try {
215
+ return ok(await (await getAPI(clientId, clientSecret)).tag.deleteTag(tagId));
216
+ } catch (error) {
217
+ return fail("Delete tag", error);
218
+ }
219
+ });
220
+ server.registerTool("intlayer-organizations-list", {
221
+ title: "List Organizations",
222
+ description: "List all organizations the authenticated user belongs to.",
223
+ inputSchema: {
224
+ ...authSchema,
225
+ page: z.number().optional().describe("Page number (1-based)"),
226
+ pageSize: z.number().optional().describe("Items per page")
227
+ },
228
+ annotations: { readOnlyHint: true }
229
+ }, async ({ clientId, clientSecret, page, pageSize }) => {
230
+ try {
231
+ return ok(await (await getAPI(clientId, clientSecret)).organization.getOrganizations({
232
+ page,
233
+ pageSize
234
+ }));
235
+ } catch (error) {
236
+ return fail("List organizations", error);
237
+ }
238
+ });
239
+ server.registerTool("intlayer-organization-select", {
240
+ title: "Select Organization",
241
+ description: "Select an organization as the current active organization. Required before accessing organization-specific resources.",
242
+ inputSchema: {
243
+ ...authSchema,
244
+ organizationId: z.string().describe("Organization ID to select")
245
+ },
246
+ annotations: { destructiveHint: false }
247
+ }, async ({ clientId, clientSecret, organizationId }) => {
248
+ try {
249
+ return ok(await (await getAPI(clientId, clientSecret)).organization.selectOrganization(organizationId));
250
+ } catch (error) {
251
+ return fail("Select organization", error);
252
+ }
253
+ });
254
+ server.registerTool("intlayer-organization-update", {
255
+ title: "Update Organization",
256
+ description: "Update the selected organization name or settings.",
257
+ inputSchema: {
258
+ ...authSchema,
259
+ name: z.string().optional().describe("New organization name"),
260
+ customInstructions: z.string().optional().describe("Custom AI instructions for this organization")
261
+ },
262
+ annotations: { destructiveHint: true }
263
+ }, async ({ clientId, clientSecret, name, customInstructions }) => {
264
+ try {
265
+ return ok(await (await getAPI(clientId, clientSecret)).organization.updateOrganization({
266
+ name,
267
+ customInstructions
268
+ }));
269
+ } catch (error) {
270
+ return fail("Update organization", error);
271
+ }
272
+ });
273
+ server.registerTool("intlayer-cms-projects-list", {
274
+ title: "List CMS Projects",
275
+ description: "List all Intlayer CMS projects for the selected organization. These are server-side projects, not local project directories.",
276
+ inputSchema: {
277
+ ...authSchema,
278
+ page: z.number().optional().describe("Page number (1-based)"),
279
+ pageSize: z.number().optional().describe("Items per page")
280
+ },
281
+ annotations: { readOnlyHint: true }
282
+ }, async ({ clientId, clientSecret, page, pageSize }) => {
283
+ try {
284
+ return ok(await (await getAPI(clientId, clientSecret)).project.getProjects({
285
+ page,
286
+ pageSize
287
+ }));
288
+ } catch (error) {
289
+ return fail("List CMS projects", error);
290
+ }
291
+ });
292
+ server.registerTool("intlayer-cms-project-select", {
293
+ title: "Select CMS Project",
294
+ description: "Select a CMS project as the current active project. Required before accessing project-specific dictionaries.",
295
+ inputSchema: {
296
+ ...authSchema,
297
+ projectId: z.string().describe("Project ID to select")
298
+ },
299
+ annotations: { destructiveHint: false }
300
+ }, async ({ clientId, clientSecret, projectId }) => {
301
+ try {
302
+ return ok(await (await getAPI(clientId, clientSecret)).project.selectProject(projectId));
303
+ } catch (error) {
304
+ return fail("Select CMS project", error);
305
+ }
306
+ });
307
+ server.registerTool("intlayer-cms-project-create", {
308
+ title: "Create CMS Project",
309
+ description: "Create a new CMS project in the selected organization.",
310
+ inputSchema: {
311
+ ...authSchema,
312
+ name: z.string().describe("Project name")
313
+ },
314
+ annotations: { destructiveHint: false }
315
+ }, async ({ clientId, clientSecret, name }) => {
316
+ try {
317
+ return ok(await (await getAPI(clientId, clientSecret)).project.addProject({ name }));
318
+ } catch (error) {
319
+ return fail("Create CMS project", error);
320
+ }
321
+ });
322
+ server.registerTool("intlayer-cms-project-update", {
323
+ title: "Update CMS Project",
324
+ description: "Update the selected CMS project settings.",
325
+ inputSchema: {
326
+ ...authSchema,
327
+ name: z.string().optional().describe("New project name")
328
+ },
329
+ annotations: { destructiveHint: true }
330
+ }, async ({ clientId, clientSecret, name }) => {
331
+ try {
332
+ return ok(await (await getAPI(clientId, clientSecret)).project.updateProject({ name }));
333
+ } catch (error) {
334
+ return fail("Update CMS project", error);
335
+ }
336
+ });
337
+ };
338
+
339
+ //#endregion
340
+ export { loadAPITools };
341
+ //# sourceMappingURL=api.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.mjs","names":[],"sources":["../../../src/tools/api.ts"],"sourcesContent":["import { getConfiguration } from '@intlayer/config';\nimport { getIntlayerAPI } from '@intlayer/api';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod';\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 config = getConfiguration();\n const resolvedClientId = clientId ?? config.editor.clientId;\n const resolvedClientSecret = clientSecret ?? config.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 ...config,\n editor: { ...config.editor, clientId: resolvedClientId, clientSecret: resolvedClientSecret },\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('Failed to obtain OAuth2 access token. Check your credentials.');\n }\n\n return getIntlayerAPI(\n { headers: { Authorization: `Bearer ${token}` } },\n config\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({ page, pageSize } as any);\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.string().optional().describe('Description of the dictionary'),\n content: z.record(z.unknown()).optional().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({ key, title, description, content } as any);\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.record(z.unknown()).optional().describe('Updated content as JSON object'),\n },\n annotations: { destructiveHint: true },\n },\n async ({ clientId, clientSecret, id, key, title, description, content }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.dictionary.updateDictionary({ id, key, title, description, content } as any);\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: '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 } as any);\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.string().optional().describe('AI instructions to apply when this tag is used'),\n },\n annotations: { destructiveHint: false },\n },\n async ({ clientId, clientSecret, key, name, description, color, instructions }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.tag.addTag({ key, name, description, color, instructions } as any);\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 ({ clientId, clientSecret, tagId, key, name, description, color, instructions }) => {\n try {\n const api = await getAPI(clientId, clientSecret);\n const result = await api.tag.updateTag(tagId, { key, name, description, color, instructions } as any);\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({ page, pageSize } as any);\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 = 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.string().optional().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({ name, customInstructions } as any);\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 } as any);\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 } as any);\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 } as any);\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,QAAQ,CACR,UAAU,CACV,SACC,oFACD;CACH,cAAc,EACX,QAAQ,CACR,UAAU,CACV,SACC,+EACD;CACJ;AAED,MAAM,SAAS,OAAO,UAAmB,iBAA0B;CACjE,MAAM,SAAS,kBAAkB;CACjC,MAAM,mBAAmB,YAAY,OAAO,OAAO;CACnD,MAAM,uBAAuB,gBAAgB,OAAO,OAAO;CAE3D,IAAI,CAAC,oBAAoB,CAAC,sBACxB,MAAM,IAAI,MACR,kHACD;CAUH,MAAM,SAAS,MAFC,eAAe,EAAE,EAAE;EAJjC,GAAG;EACH,QAAQ;GAAE,GAAG,OAAO;GAAQ,UAAU;GAAkB,cAAc;GAAsB;EAG5C,CACjB,CAAC,MAAM,sBAAsB,GAC1B,MAAM;CAE1C,IAAI,CAAC,OACH,MAAM,IAAI,MAAM,gEAAgE;CAGlF,OAAO,eACL,EAAE,SAAS,EAAE,eAAe,UAAU,SAAS,EAAE,EACjD,OACD;;AAGH,MAAM,MAAM,UAAmB,EAC7B,SAAS,CAAC;CAAE,MAAM;CAAiB,MAAM,KAAK,UAAU,MAAM,MAAM,EAAE;CAAE,CAAC,EAC1E;AAED,MAAM,QAAQ,OAAe,WAAoB;CAC/C,SAAS,CACP;EACE,MAAM;EACN,MAAM,GAAG,MAAM,WAAW,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;EACjF,CACF;CACD,SAAS;CACV;AAED,MAAa,gBAA8B,W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/C,IAAI;GAGF,OAAO,GAAG,OADW,MADH,OAAO,UAAU,aAAa,EACvB,QAAQ,cAAc,UAAU,CACxC;WACV,OAAO;GACd,OAAO,KAAK,sBAAsB,MAAM;;GAG7C;CAED,OAAO,aACL,+BACA;EACE,OAAO;EACP,aAAa;EACb,aAAa;GACX,GAAG;GACH,MAAM,EAAE,QAAQ,CAAC,SAAS,eAAe;GAC1C;EACD,aAAa,EAAE,iBAAiB,OAAO;EACxC,EACD,OAAO,EAAE,UAAU,cAAc,WAAW;EAC1C,IAAI;GAGF,OAAO,GAAG,OADW,MADH,OAAO,UAAU,aAAa,EACvB,QAAQ,WAAW,EAAE,MAAM,CAAQ,CAC3C;WACV,OAAO;GACd,OAAO,KAAK,sBAAsB,MAAM;;GAG7C;CAED,OAAO,aACL,+BACA;EACE,OAAO;EACP,aAAa;EACb,aAAa;GACX,GAAG;GACH,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,mBAAmB;GACzD;EACD,aAAa,EAAE,iBAAiB,MAAM;EACvC,EACD,OAAO,EAAE,UAAU,cAAc,WAAW;EAC1C,IAAI;GAGF,OAAO,GAAG,OADW,MADH,OAAO,UAAU,aAAa,EACvB,QAAQ,cAAc,EAAE,MAAM,CAAQ,CAC9C;WACV,OAAO;GACd,OAAO,KAAK,sBAAsB,MAAM;;GAG7C"}
@@ -1,9 +1,5 @@
1
- import { Client } from "@modelcontextprotocol/sdk/client/index.js";
2
-
3
1
  //#region src/client/client.d.ts
4
2
  declare const dirname: string;
5
- type LoadClient = () => Client;
6
- declare const loadClient: LoadClient;
7
3
  //#endregion
8
- export { dirname, loadClient };
4
+ export { dirname };
9
5
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","names":[],"sources":["../../../src/client/client.ts"],"mappings":";;;cAMa,OAAA;AAAA,KAQR,UAAA,SAAmB,MAAA;AAAA,cAEX,UAAA,EAAY,UAAA"}
1
+ {"version":3,"file":"client.d.ts","names":[],"sources":["../../../src/client/client.ts"],"mappings":";cAIa,OAAA"}
@@ -1,4 +1,4 @@
1
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
1
+ import { McpServer } from "/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/@modelcontextprotocol+sdk@1.29.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js";
2
2
 
3
3
  //#region src/server/server.d.ts
4
4
  declare const dirname: string;
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","names":[],"sources":["../../../src/server/server.ts"],"mappings":";;;cASa,OAAA;AAAA,KAQR,UAAA,IAAc,OAAA;EAAW,OAAA;AAAA,MAAuB,SAAA;AAAA,cAExC,UAAA,EAAY,UAAA"}
1
+ {"version":3,"file":"server.d.ts","names":[],"sources":["../../../src/server/server.ts"],"mappings":";;;cAUa,OAAA;AAAA,KAQR,UAAA,IAAc,OAAA;EAAW,OAAA;AAAA,MAAuB,SAAA;AAAA,cAExC,UAAA,EAAY,UAAA"}
@@ -0,0 +1,8 @@
1
+ import { McpServer } from "/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/@modelcontextprotocol+sdk@1.29.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js";
2
+
3
+ //#region src/tools/api.d.ts
4
+ type LoadAPITools = (server: McpServer) => void;
5
+ declare const loadAPITools: LoadAPITools;
6
+ //#endregion
7
+ export { loadAPITools };
8
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","names":[],"sources":["../../../src/tools/api.ts"],"mappings":";;;KAKK,YAAA,IAAgB,MAAA,EAAQ,SAAA;AAAA,cA6DhB,YAAA,EAAc,YAAA"}
@@ -1,4 +1,4 @@
1
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
1
+ import { McpServer } from "/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/@modelcontextprotocol+sdk@1.29.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js";
2
2
 
3
3
  //#region src/tools/cli.d.ts
4
4
  type LoadCLITools = (server: McpServer) => Promise<void>;
@@ -1,4 +1,4 @@
1
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
1
+ import { McpServer } from "/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/@modelcontextprotocol+sdk@1.29.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js";
2
2
 
3
3
  //#region src/tools/docs.d.ts
4
4
  type LoadDocsTools = (server: McpServer) => Promise<void>;
@@ -1,4 +1,4 @@
1
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
1
+ import { McpServer } from "/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/@modelcontextprotocol+sdk@1.29.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js";
2
2
 
3
3
  //#region src/tools/installSkills.d.ts
4
4
  declare const loadInstallSkillsTool: (server: McpServer) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/mcp",
3
- "version": "8.9.3",
3
+ "version": "8.9.4-canary.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": [
@@ -93,22 +93,21 @@
93
93
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
94
94
  },
95
95
  "dependencies": {
96
- "@intlayer/api": "8.9.3",
97
- "@intlayer/chokidar": "8.9.3",
98
- "@intlayer/cli": "8.9.3",
99
- "@intlayer/config": "8.9.3",
100
- "@intlayer/docs": "8.9.3",
101
- "@intlayer/types": "8.9.3",
102
- "@modelcontextprotocol/sdk": "1.29.0",
96
+ "@ai-sdk/mcp": "^1.0.41",
97
+ "@intlayer/api": "8.9.4-canary.0",
98
+ "@intlayer/chokidar": "8.9.4-canary.0",
99
+ "@intlayer/cli": "8.9.4-canary.0",
100
+ "@intlayer/config": "8.9.4-canary.0",
101
+ "@intlayer/docs": "8.9.4-canary.0",
102
+ "@intlayer/types": "8.9.4-canary.0",
103
103
  "dotenv": "17.4.2",
104
104
  "express": "5.2.1",
105
105
  "zod": "4.4.3"
106
106
  },
107
107
  "devDependencies": {
108
- "@intlayer/types": "8.9.3",
109
- "@modelcontextprotocol/inspector": "0.21.2",
108
+ "@intlayer/types": "8.9.4-canary.0",
110
109
  "@types/express": "5.0.6",
111
- "@types/node": "25.6.1",
110
+ "@types/node": "25.6.2",
112
111
  "@utils/ts-config": "1.0.4",
113
112
  "@utils/ts-config-types": "1.0.4",
114
113
  "@utils/tsdown-config": "1.0.4",