@intlayer/mcp 7.0.7 → 7.0.8
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/cjs/client/client.cjs +0 -5
- package/dist/cjs/client/client.cjs.map +1 -1
- package/dist/cjs/client/sse.cjs +0 -2
- package/dist/cjs/client/sse.cjs.map +1 -1
- package/dist/cjs/server/server.cjs +10 -7
- package/dist/cjs/server/server.cjs.map +1 -1
- package/dist/cjs/server/sse.cjs +0 -1
- package/dist/cjs/server/sse.cjs.map +1 -1
- package/dist/cjs/server/stdio.cjs +0 -1
- package/dist/cjs/server/stdio.cjs.map +1 -1
- package/dist/cjs/tools/cli.cjs +1 -3
- package/dist/cjs/tools/cli.cjs.map +1 -1
- package/dist/cjs/tools/docs.cjs +34 -14
- package/dist/cjs/tools/docs.cjs.map +1 -1
- package/dist/esm/server/server.mjs +10 -2
- package/dist/esm/server/server.mjs.map +1 -1
- package/dist/esm/tools/cli.mjs +1 -1
- package/dist/esm/tools/cli.mjs.map +1 -1
- package/dist/esm/tools/docs.mjs +34 -13
- package/dist/esm/tools/docs.mjs.map +1 -1
- package/dist/types/tools/docs.d.ts.map +1 -1
- package/package.json +17 -17
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
let node_fs = require("node:fs");
|
|
3
|
-
node_fs = require_rolldown_runtime.__toESM(node_fs);
|
|
4
3
|
let node_path = require("node:path");
|
|
5
|
-
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
6
4
|
let node_url = require("node:url");
|
|
7
|
-
node_url = require_rolldown_runtime.__toESM(node_url);
|
|
8
5
|
let __intlayer_config = require("@intlayer/config");
|
|
9
|
-
__intlayer_config = require_rolldown_runtime.__toESM(__intlayer_config);
|
|
10
6
|
let __modelcontextprotocol_sdk_client_index_js = require("@modelcontextprotocol/sdk/client/index.js");
|
|
11
|
-
__modelcontextprotocol_sdk_client_index_js = require_rolldown_runtime.__toESM(__modelcontextprotocol_sdk_client_index_js);
|
|
12
7
|
|
|
13
8
|
//#region src/client/client.ts
|
|
14
9
|
const dirname = __intlayer_config.isESModule ? (0, node_path.dirname)((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href)) : __dirname;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.cjs","names":["dirname: string","isESModule","packageJson: Record<string, any>","loadClient: LoadClient","Client"],"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';\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":"
|
|
1
|
+
{"version":3,"file":"client.cjs","names":["dirname: string","isESModule","packageJson: Record<string, any>","loadClient: LoadClient","Client"],"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';\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,MAAaA,UAAkBC,gIACe,CAAC,GAC3C;AAEJ,MAAMC,cAAmC,KAAK,uDACvB,SAAS,wBAAwB,EAAE,OAAO,CAChE;AAID,MAAaC,mBACX,IAAIC,kDAAO;CACT,MAAM;CACN,SAAS,YAAY;CACtB,CAAC"}
|
package/dist/cjs/client/sse.cjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_client_client = require('./client.cjs');
|
|
3
3
|
let node_url = require("node:url");
|
|
4
|
-
node_url = require_rolldown_runtime.__toESM(node_url);
|
|
5
4
|
let __modelcontextprotocol_sdk_client_sse_js = require("@modelcontextprotocol/sdk/client/sse.js");
|
|
6
|
-
__modelcontextprotocol_sdk_client_sse_js = require_rolldown_runtime.__toESM(__modelcontextprotocol_sdk_client_sse_js);
|
|
7
5
|
|
|
8
6
|
//#region src/client/sse.ts
|
|
9
7
|
var SSEClient = class {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse.cjs","names":["loadClient","URL","SSEClientTransport"],"sources":["../../../src/client/sse.ts"],"sourcesContent":["import { URL } from 'node:url';\nimport type { Client } from '@modelcontextprotocol/sdk/client/index.js';\nimport { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.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 =\n process.env.MCP_SERVER_URL ?? 'https://mcp.intlayer.org';\n\n const url = new URL(mcpServerURL);\n try {\n console.info(`Connecting to server - ${mcpServerURL}`);\n this.transport = new SSEClientTransport(url);\n await this.client.connect(this.transport);\n console.info('Connected to MCP server');\n\n this.setUpTransport();\n } catch (e) {\n console.info('Failed to connect to MCP server: ', e);\n throw e;\n }\n }\n\n private setUpTransport() {\n if (this.transport === null) {\n return;\n }\n this.transport.onclose = () => {\n console.info('SSE transport closed.');\n this.isCompleted = true;\n };\n\n this.transport.onerror = async (error) => {\n console.info('SSE 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 await this.client.close();\n }\n}\n\nconst main = async () => {\n const client = new SSEClient();\n\n try {\n await client.connectToServer();\n await client.waitForCompletion();\n } finally {\n await client.cleanup();\n }\n};\n\nmain();\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sse.cjs","names":["loadClient","URL","SSEClientTransport"],"sources":["../../../src/client/sse.ts"],"sourcesContent":["import { URL } from 'node:url';\nimport type { Client } from '@modelcontextprotocol/sdk/client/index.js';\nimport { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.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 =\n process.env.MCP_SERVER_URL ?? 'https://mcp.intlayer.org';\n\n const url = new URL(mcpServerURL);\n try {\n console.info(`Connecting to server - ${mcpServerURL}`);\n this.transport = new SSEClientTransport(url);\n await this.client.connect(this.transport);\n console.info('Connected to MCP server');\n\n this.setUpTransport();\n } catch (e) {\n console.info('Failed to connect to MCP server: ', e);\n throw e;\n }\n }\n\n private setUpTransport() {\n if (this.transport === null) {\n return;\n }\n this.transport.onclose = () => {\n console.info('SSE transport closed.');\n this.isCompleted = true;\n };\n\n this.transport.onerror = async (error) => {\n console.info('SSE 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 await this.client.close();\n }\n}\n\nconst main = async () => {\n const client = new SSEClient();\n\n try {\n await client.connectToServer();\n await client.waitForCompletion();\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;AACZ,OAAK,SAASA,kCAAY;;CAG5B,MAAM,kBAAkB;EACtB,MAAM,eACJ,QAAQ,IAAI,kBAAkB;EAEhC,MAAM,MAAM,IAAIC,aAAI,aAAa;AACjC,MAAI;AACF,WAAQ,KAAK,0BAA0B,eAAe;AACtD,QAAK,YAAY,IAAIC,4DAAmB,IAAI;AAC5C,SAAM,KAAK,OAAO,QAAQ,KAAK,UAAU;AACzC,WAAQ,KAAK,0BAA0B;AAEvC,QAAK,gBAAgB;WACd,GAAG;AACV,WAAQ,KAAK,qCAAqC,EAAE;AACpD,SAAM;;;CAIV,AAAQ,iBAAiB;AACvB,MAAI,KAAK,cAAc,KACrB;AAEF,OAAK,UAAU,gBAAgB;AAC7B,WAAQ,KAAK,wBAAwB;AACrC,QAAK,cAAc;;AAGrB,OAAK,UAAU,UAAU,OAAO,UAAU;AACxC,WAAQ,KAAK,yBAAyB,MAAM;AAC5C,SAAM,KAAK,SAAS;;AAGtB,OAAK,UAAU,aAAa,YAAY;AACtC,WAAQ,KAAK,sBAAsB,QAAQ;;;CAI/C,MAAM,oBAAoB;AACxB,SAAO,CAAC,KAAK,YACX,OAAM,IAAI,SAAS,YAAY,WAAW,SAAS,IAAI,CAAC;;CAI5D,MAAM,UAAU;AACd,QAAM,KAAK,OAAO,OAAO;;;AAI7B,MAAM,OAAO,YAAY;CACvB,MAAM,SAAS,IAAI,WAAW;AAE9B,KAAI;AACF,QAAM,OAAO,iBAAiB;AAC9B,QAAM,OAAO,mBAAmB;WACxB;AACR,QAAM,OAAO,SAAS;;;AAI1B,MAAM"}
|
|
@@ -2,15 +2,10 @@ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
|
2
2
|
const require_tools_cli = require('../tools/cli.cjs');
|
|
3
3
|
const require_tools_docs = require('../tools/docs.cjs');
|
|
4
4
|
let node_fs = require("node:fs");
|
|
5
|
-
node_fs = require_rolldown_runtime.__toESM(node_fs);
|
|
6
5
|
let node_path = require("node:path");
|
|
7
|
-
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
8
6
|
let node_url = require("node:url");
|
|
9
|
-
node_url = require_rolldown_runtime.__toESM(node_url);
|
|
10
7
|
let __intlayer_config = require("@intlayer/config");
|
|
11
|
-
__intlayer_config = require_rolldown_runtime.__toESM(__intlayer_config);
|
|
12
8
|
let __modelcontextprotocol_sdk_server_mcp_js = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
13
|
-
__modelcontextprotocol_sdk_server_mcp_js = require_rolldown_runtime.__toESM(__modelcontextprotocol_sdk_server_mcp_js);
|
|
14
9
|
|
|
15
10
|
//#region src/server/server.ts
|
|
16
11
|
const dirname = __intlayer_config.isESModule ? (0, node_path.dirname)((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href)) : __dirname;
|
|
@@ -21,8 +16,16 @@ const loadServer = ({ isLocal }) => {
|
|
|
21
16
|
version: packageJson.version,
|
|
22
17
|
capabilities: { resources: {} }
|
|
23
18
|
});
|
|
24
|
-
if (isLocal)
|
|
25
|
-
|
|
19
|
+
if (isLocal) try {
|
|
20
|
+
require_tools_cli.loadCLITools(server);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
console.error("Error loading CLI tools:", error);
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
require_tools_docs.loadDocsTools(server);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
console.error("Error loading docs tools:", error);
|
|
28
|
+
}
|
|
26
29
|
return server;
|
|
27
30
|
};
|
|
28
31
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.cjs","names":["dirname: string","isESModule","packageJson: Record<string, any>","loadServer: LoadServer","McpServer"],"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';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { loadCLITools } from '../tools/cli';\nimport { loadDocsTools } from '../tools/docs';\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 capabilities: {\n resources: {},\n },\n });\n\n if (isLocal) {\n loadCLITools(server);\n }\n\n loadDocsTools(server);\n\n return server;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.cjs","names":["dirname: string","isESModule","packageJson: Record<string, any>","loadServer: LoadServer","McpServer"],"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';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { loadCLITools } from '../tools/cli';\nimport { loadDocsTools } from '../tools/docs';\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 capabilities: {\n resources: {},\n },\n });\n\n if (isLocal) {\n try {\n loadCLITools(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":";;;;;;;;;;AAQA,MAAaA,UAAkBC,gIACe,CAAC,GAC3C;AAEJ,MAAMC,cAAmC,KAAK,uDACvB,SAAS,wBAAwB,EAAE,OAAO,CAChE;AAID,MAAaC,cAA0B,EAAE,cAAc;CACrD,MAAM,SAAS,IAAIC,mDAAU;EAC3B,MAAM;EACN,SAAS,YAAY;EACrB,cAAc,EACZ,WAAW,EAAE,EACd;EACF,CAAC;AAEF,KAAI,QACF,KAAI;AACF,iCAAa,OAAO;UACb,OAAO;AACd,UAAQ,MAAM,4BAA4B,MAAM;;AAIpD,KAAI;AACF,mCAAc,OAAO;UACd,OAAO;AACd,UAAQ,MAAM,6BAA6B,MAAM;;AAGnD,QAAO"}
|
package/dist/cjs/server/sse.cjs
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
3
3
|
const require_server_server = require('./server.cjs');
|
|
4
4
|
let __modelcontextprotocol_sdk_server_sse_js = require("@modelcontextprotocol/sdk/server/sse.js");
|
|
5
|
-
__modelcontextprotocol_sdk_server_sse_js = require_rolldown_runtime.__toESM(__modelcontextprotocol_sdk_server_sse_js);
|
|
6
5
|
let dotenv = require("dotenv");
|
|
7
6
|
dotenv = require_rolldown_runtime.__toESM(dotenv);
|
|
8
7
|
let express = require("express");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse.cjs","names":["loadServer","transports: { [sessionId: string]: SSEServerTransport }","SSEServerTransport"],"sources":["../../../src/server/sse.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';\nimport dotenv from 'dotenv';\nimport express, { type Request, type Response } from 'express';\nimport { loadServer } from './server';\n\n/**********************************/\n/******* Server Set Up ************/\n/**********************************/\n\nconst server = loadServer({ isLocal: false });\n\n/**********************************/\n/******* Express App Set Up *******/\n/**********************************/\n\nconst app = express();\n\n// Environment variables\nconst env = app.get('env');\n\ndotenv.config({\n path: [`.env.${env}.local`, `.env.${env}`, '.env.local', '.env'],\n});\n\n// Enable CORS for development\napp.use((req, res, next) => {\n res.header('Access-Control-Allow-Origin', '*');\n res.header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');\n res.header('Access-Control-Allow-Headers', 'Content-Type');\n\n if (req.method === 'OPTIONS') {\n res.sendStatus(200);\n return;\n }\n\n next();\n});\n\napp.use(express.json());\nconst router = express.Router();\n\n// to support multiple simultaneous connections we have a lookup object from\n// sessionId to transport\nconst transports: { [sessionId: string]: SSEServerTransport } = {};\n\n// endpoint for the client to use for sending messages\nconst POST_ENDPOINT = '/messages';\n\nrouter.post(POST_ENDPOINT, async (req: Request, res: Response) => {\n console.info('message request received: ', req.body);\n // when client sends messages with `SSEClientTransport`,\n // the sessionId will be atomically set as query parameter.\n const sessionId = req.query.sessionId;\n\n if (typeof sessionId !== 'string') {\n res.status(400).send({ messages: 'Bad session id.' });\n return;\n }\n const transport = transports[sessionId];\n if (!transport) {\n res.status(400).send({ messages: 'No transport found for sessionId.' });\n return;\n }\n\n // IMPORTANT!\n // using `await transport.handlePostMessage(req, res)` will cause\n // `SSE transport error: Error: Error POSTing to endpoint (HTTP 400): InternalServerError: stream is not readable`\n // on the client side\n await transport.handlePostMessage(req, res, req.body);\n\n return;\n});\n\n// initialization:\n// create a new transport to connect and\n// send an endpoint event containing a URI for the client to use for sending messages\nrouter.get('/', async (_req: Request, res: Response) => {\n console.info('connection request received');\n // tells the client to send messages to the `POST_ENDPOINT`\n const transport = new SSEServerTransport(POST_ENDPOINT, res);\n console.info('new transport created with session id: ', transport.sessionId);\n\n transports[transport.sessionId] = transport;\n\n console.info(`${Object.keys(transports).length} sessions active`);\n\n res.on('close', () => {\n console.info('SSE connection closed');\n delete transports[transport.sessionId];\n });\n\n await server.connect(transport);\n\n // an exmaple of a server-sent-event (message) to client\n await sendMessages(transport);\n\n return;\n});\n\nconst sendMessages = async (transport: SSEServerTransport) => {\n try {\n // some messages will proabaly not be able to observed on the client side\n // becasue an open SSE Stream is not yet established\n // by receving the `initialize` POST request and the `notifications/initialized` POST request\n await transport.send({\n jsonrpc: '2.0',\n method: 'sse/connection',\n params: { message: 'Stream started' },\n });\n console.info('Stream started');\n\n let messageCount = 0;\n const interval = setInterval(async () => {\n messageCount++;\n\n const message = `Message ${messageCount} at ${new Date().toISOString()}`;\n\n try {\n await transport.send({\n jsonrpc: '2.0',\n method: 'sse/message',\n params: { data: message },\n });\n\n console.info(`Sent: ${message}`);\n\n if (messageCount === 2) {\n clearInterval(interval);\n await transport.send({\n jsonrpc: '2.0',\n method: 'sse/complete',\n params: { message: 'Stream completed' },\n });\n console.info('Stream completed');\n }\n } catch (error) {\n console.error('Error sending message:', error);\n clearInterval(interval);\n }\n }, 1000);\n } catch (error) {\n console.error('Error in startSending:', error);\n }\n};\n\napp.use('/', router);\n\napp.use('/health', (_req: Request, res: Response) => {\n res.send('OK');\n});\n\nconst PORT = process.env.PORT ?? 3000;\n\napp.listen(PORT, () => {\n console.info(`MCP Streamable HTTP Server listening on port ${PORT}`);\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sse.cjs","names":["loadServer","transports: { [sessionId: string]: SSEServerTransport }","SSEServerTransport"],"sources":["../../../src/server/sse.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';\nimport dotenv from 'dotenv';\nimport express, { type Request, type Response } from 'express';\nimport { loadServer } from './server';\n\n/**********************************/\n/******* Server Set Up ************/\n/**********************************/\n\nconst server = loadServer({ isLocal: false });\n\n/**********************************/\n/******* Express App Set Up *******/\n/**********************************/\n\nconst app = express();\n\n// Environment variables\nconst env = app.get('env');\n\ndotenv.config({\n path: [`.env.${env}.local`, `.env.${env}`, '.env.local', '.env'],\n});\n\n// Enable CORS for development\napp.use((req, res, next) => {\n res.header('Access-Control-Allow-Origin', '*');\n res.header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');\n res.header('Access-Control-Allow-Headers', 'Content-Type');\n\n if (req.method === 'OPTIONS') {\n res.sendStatus(200);\n return;\n }\n\n next();\n});\n\napp.use(express.json());\nconst router = express.Router();\n\n// to support multiple simultaneous connections we have a lookup object from\n// sessionId to transport\nconst transports: { [sessionId: string]: SSEServerTransport } = {};\n\n// endpoint for the client to use for sending messages\nconst POST_ENDPOINT = '/messages';\n\nrouter.post(POST_ENDPOINT, async (req: Request, res: Response) => {\n console.info('message request received: ', req.body);\n // when client sends messages with `SSEClientTransport`,\n // the sessionId will be atomically set as query parameter.\n const sessionId = req.query.sessionId;\n\n if (typeof sessionId !== 'string') {\n res.status(400).send({ messages: 'Bad session id.' });\n return;\n }\n const transport = transports[sessionId];\n if (!transport) {\n res.status(400).send({ messages: 'No transport found for sessionId.' });\n return;\n }\n\n // IMPORTANT!\n // using `await transport.handlePostMessage(req, res)` will cause\n // `SSE transport error: Error: Error POSTing to endpoint (HTTP 400): InternalServerError: stream is not readable`\n // on the client side\n await transport.handlePostMessage(req, res, req.body);\n\n return;\n});\n\n// initialization:\n// create a new transport to connect and\n// send an endpoint event containing a URI for the client to use for sending messages\nrouter.get('/', async (_req: Request, res: Response) => {\n console.info('connection request received');\n // tells the client to send messages to the `POST_ENDPOINT`\n const transport = new SSEServerTransport(POST_ENDPOINT, res);\n console.info('new transport created with session id: ', transport.sessionId);\n\n transports[transport.sessionId] = transport;\n\n console.info(`${Object.keys(transports).length} sessions active`);\n\n res.on('close', () => {\n console.info('SSE connection closed');\n delete transports[transport.sessionId];\n });\n\n await server.connect(transport);\n\n // an exmaple of a server-sent-event (message) to client\n await sendMessages(transport);\n\n return;\n});\n\nconst sendMessages = async (transport: SSEServerTransport) => {\n try {\n // some messages will proabaly not be able to observed on the client side\n // becasue an open SSE Stream is not yet established\n // by receving the `initialize` POST request and the `notifications/initialized` POST request\n await transport.send({\n jsonrpc: '2.0',\n method: 'sse/connection',\n params: { message: 'Stream started' },\n });\n console.info('Stream started');\n\n let messageCount = 0;\n const interval = setInterval(async () => {\n messageCount++;\n\n const message = `Message ${messageCount} at ${new Date().toISOString()}`;\n\n try {\n await transport.send({\n jsonrpc: '2.0',\n method: 'sse/message',\n params: { data: message },\n });\n\n console.info(`Sent: ${message}`);\n\n if (messageCount === 2) {\n clearInterval(interval);\n await transport.send({\n jsonrpc: '2.0',\n method: 'sse/complete',\n params: { message: 'Stream completed' },\n });\n console.info('Stream completed');\n }\n } catch (error) {\n console.error('Error sending message:', error);\n clearInterval(interval);\n }\n }, 1000);\n } catch (error) {\n console.error('Error in startSending:', error);\n }\n};\n\napp.use('/', router);\n\napp.use('/health', (_req: Request, res: Response) => {\n res.send('OK');\n});\n\nconst PORT = process.env.PORT ?? 3000;\n\napp.listen(PORT, () => {\n console.info(`MCP Streamable HTTP Server listening on port ${PORT}`);\n});\n"],"mappings":";;;;;;;;;;;AAWA,MAAM,SAASA,iCAAW,EAAE,SAAS,OAAO,CAAC;;AAM7C,MAAM,4BAAe;AAGrB,MAAM,MAAM,IAAI,IAAI,MAAM;AAE1B,eAAO,OAAO,EACZ,MAAM;CAAC,QAAQ,IAAI;CAAS,QAAQ;CAAO;CAAc;CAAO,EACjE,CAAC;AAGF,IAAI,KAAK,KAAK,KAAK,SAAS;AAC1B,KAAI,OAAO,+BAA+B,IAAI;AAC9C,KAAI,OAAO,gCAAgC,qBAAqB;AAChE,KAAI,OAAO,gCAAgC,eAAe;AAE1D,KAAI,IAAI,WAAW,WAAW;AAC5B,MAAI,WAAW,IAAI;AACnB;;AAGF,OAAM;EACN;AAEF,IAAI,IAAI,gBAAQ,MAAM,CAAC;AACvB,MAAM,SAAS,gBAAQ,QAAQ;AAI/B,MAAMC,aAA0D,EAAE;AAGlE,MAAM,gBAAgB;AAEtB,OAAO,KAAK,eAAe,OAAO,KAAc,QAAkB;AAChE,SAAQ,KAA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AQ;MACR,QAAQ,EAAE,SAAS,oBAAoB;MACxC,CAAC;AACF,aAAQ,KAAK,mBAAmB;;YAE3B,OAAO;AACd,YAAQ,MAAM,0BAA0B,MAAM;AAC9C,kBAAc,SAAS;;KAExB,IAAK;UACD,OAAO;AACd,UAAQ,MAAM,0BAA0B,MAAM;;;AAIlD,IAAI,IAAI,KAAK,OAAO;AAEpB,IAAI,IAAI,YAAY,MAAe,QAAkB;AACnD,KAAI,KAAK,KAAK;EACd;AAEF,MAAM,OAAO,QAAQ,IAAI,QAAQ;AAEjC,IAAI,OAAO,YAAY;AACrB,SAAQ,KAAK,gDAAgD,OAAO;EACpE"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
3
3
|
const require_server_server = require('./server.cjs');
|
|
4
4
|
let __modelcontextprotocol_sdk_server_stdio_js = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
5
|
-
__modelcontextprotocol_sdk_server_stdio_js = require_rolldown_runtime.__toESM(__modelcontextprotocol_sdk_server_stdio_js);
|
|
6
5
|
|
|
7
6
|
//#region src/server/stdio.ts
|
|
8
7
|
const server = require_server_server.loadServer({ isLocal: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio.cjs","names":["loadServer","StdioServerTransport"],"sources":["../../../src/server/stdio.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { loadServer } from './server';\n\nconst server = loadServer({ isLocal: true });\n\nconst main = async () => {\n const transport = new StdioServerTransport();\n await server.connect(transport);\n\n console.error('Intlayer MCP Server running on stdio');\n};\n\nmain().catch((error) => {\n console.error('Fatal error in main():', error);\n process.exit(1);\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"stdio.cjs","names":["loadServer","StdioServerTransport"],"sources":["../../../src/server/stdio.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { loadServer } from './server';\n\nconst server = loadServer({ isLocal: true });\n\nconst main = async () => {\n const transport = new StdioServerTransport();\n await server.connect(transport);\n\n console.error('Intlayer MCP Server running on stdio');\n};\n\nmain().catch((error) => {\n console.error('Fatal error in main():', error);\n process.exit(1);\n});\n"],"mappings":";;;;;;AAKA,MAAM,SAASA,iCAAW,EAAE,SAAS,MAAM,CAAC;AAE5C,MAAM,OAAO,YAAY;CACvB,MAAM,YAAY,IAAIC,iEAAsB;AAC5C,OAAM,OAAO,QAAQ,UAAU;AAE/B,SAAQ,MAAM,uCAAuC;;AAGvD,MAAM,CAAC,OAAO,UAAU;AACtB,SAAQ,MAAM,0BAA0B,MAAM;AAC9C,SAAQ,KAAK,EAAE;EACf"}
|
package/dist/cjs/tools/cli.cjs
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
let __intlayer_cli = require("@intlayer/cli");
|
|
3
|
-
__intlayer_cli = require_rolldown_runtime.__toESM(__intlayer_cli);
|
|
4
3
|
let __intlayer_types = require("@intlayer/types");
|
|
5
|
-
__intlayer_types = require_rolldown_runtime.__toESM(__intlayer_types);
|
|
6
4
|
let zod_v3 = require("zod/v3");
|
|
7
5
|
zod_v3 = require_rolldown_runtime.__toESM(zod_v3);
|
|
8
6
|
|
|
@@ -187,7 +185,7 @@ const loadCLITools = async (server) => {
|
|
|
187
185
|
}).optional() }).optional()
|
|
188
186
|
}).optional().describe("Configuration options") }, async (props) => {
|
|
189
187
|
try {
|
|
190
|
-
const missingTranslations = (0, __intlayer_cli.listMissingTranslations)(
|
|
188
|
+
const missingTranslations = (0, __intlayer_cli.listMissingTranslations)(props?.configOptions);
|
|
191
189
|
return { content: [{
|
|
192
190
|
type: "text",
|
|
193
191
|
text: JSON.stringify(missingTranslations, null, 2)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.cjs","names":["loadCLITools: LoadCLITools","z","log: Partial<LogConfig>","Locales","fillOptions: any","pushOptions: any"],"sources":["../../../src/tools/cli.ts"],"sourcesContent":["import {\n build,\n fill,\n listContentDeclarationRows,\n listMissingTranslations,\n pull,\n push,\n} from '@intlayer/cli';\nimport { Locales, type LogConfig } from '@intlayer/types';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod/v3';\n\ntype LoadCLITools = (server: McpServer) => Promise<void>;\n\nexport const loadCLITools: LoadCLITools = async (server) => {\n server.tool(\n 'intlayer-build',\n 'Build the dictionaries. List all content declarations files `.content.{ts,tsx,js,json,...}` to update the content callable using the `useIntlayer` hook.',\n {\n watch: z.boolean().optional().describe('Watch for changes'),\n baseDir: z.string().optional().describe('Base directory'),\n env: z.string().optional().describe('Environment'),\n envFile: z.string().optional().describe('Environment file'),\n verbose: z.boolean().optional().describe('Verbose output'),\n prefix: z.string().optional().describe('Log prefix'),\n },\n async ({ watch, baseDir, env, envFile, verbose, prefix }) => {\n try {\n const log: Partial<LogConfig> = {};\n if (verbose) {\n log.mode = 'verbose';\n }\n if (prefix) {\n log.prefix = prefix;\n }\n\n await build({\n watch,\n configOptions: {\n baseDir,\n env,\n envFile,\n override: {\n log,\n },\n },\n });\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.tool(\n 'intlayer-fill',\n 'Fill the dictionaries with missing translations / review translations using Intlayer servers',\n {\n sourceLocale: z\n .nativeEnum(Locales.ALL_LOCALES)\n .optional()\n .describe('Source locale'),\n outputLocales: z\n .union([\n z.nativeEnum(Locales.ALL_LOCALES),\n z.array(z.nativeEnum(Locales.ALL_LOCALES)),\n ])\n .optional()\n .describe('Output locales'),\n file: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('File path'),\n mode: z.enum(['complete', 'review']).optional().describe('Fill mode'),\n keys: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Keys to include'),\n excludedKeys: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Keys to exclude'),\n pathFilter: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Path filter'),\n gitOptions: z\n .object({\n gitDiff: z.boolean().optional(),\n gitDiffBase: z.string().optional(),\n gitDiffCurrent: z.string().optional(),\n uncommitted: z.boolean().optional(),\n unpushed: z.boolean().optional(),\n untracked: z.boolean().optional(),\n })\n .optional()\n .describe('Git options'),\n aiOptions: z\n .object({\n provider: z.string().optional(),\n temperature: z.number().optional(),\n model: z.string().optional(),\n apiKey: z.string().optional(),\n customPrompt: z.string().optional(),\n applicationContext: z.string().optional(),\n })\n .optional()\n .describe('AI options'),\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.tool(\n 'intlayer-push',\n 'Push local dictionaries to the server',\n {\n deleteLocaleDictionary: z\n .boolean()\n .optional()\n .describe('Delete local dictionary after push'),\n keepLocaleDictionary: z\n .boolean()\n .optional()\n .describe('Keep local dictionary after push'),\n dictionaries: z\n .array(z.string())\n .optional()\n .describe('List of dictionaries to push'),\n gitOptions: z\n .object({\n gitDiff: z.boolean().optional(),\n gitDiffBase: z.string().optional(),\n gitDiffCurrent: z.string().optional(),\n uncommitted: z.boolean().optional(),\n unpushed: z.boolean().optional(),\n untracked: z.boolean().optional(),\n })\n .optional()\n .describe('Git options'),\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.tool(\n 'intlayer-pull',\n 'Pull dictionaries from the CMS',\n {\n dictionaries: z\n .array(z.string())\n .optional()\n .describe('List of dictionaries to pull'),\n newDictionariesPath: z\n .string()\n .optional()\n .describe('Path to save new dictionaries'),\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.tool(\n 'intlayer-content-list',\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 {\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\n },\n async (props) => {\n try {\n const rows = listContentDeclarationRows(props);\n return {\n content: [\n {\n type: 'text',\n text: 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.tool(\n 'intlayer-content-test',\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 {\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\n },\n async (props) => {\n try {\n const missingTranslations = listMissingTranslations(\n undefined,\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"],"mappings":";;;;;;;;;AAcA,MAAaA,eAA6B,OAAO,WAAW;AAC1D,QAAO,KACL,kBACA,4JACA;EACE,OAAOC,eAAE,SAAS,CAAC,UAAU,CAAC,SAAS,oBAAoB;EAC3D,SAASA,eAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,iBAAiB;EACzD,KAAKA,eAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,cAAc;EAClD,SAASA,eAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,mBAAmB;EAC3D,SAASA,eAAE,SAAS,CAAC,UAAU,CAAC,SAAS,iBAAiB;EAC1D,QAAQA,eAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,aAAa;EACrD,EACD,OAAO,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ACD,UAAU;EACd,CAAC,CACD,UAAU,CACV,SAAS,wBAAwB,EACrC,EACD,OAAO,UAAU;AACf,MAAI;GACF,MAAM,kEACJ,QACA,OAAO,cACR;AACD,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,KAAK,UAAU,qBAAqB,MAAM,EAAE;IACnD,CACF,EACF;WACM,OAAO;AAGd,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,wBALV,iBAAiB,QAAQ,MAAM,UAAU;IAMtC,CACF,EACF;;GAGN"}
|
|
1
|
+
{"version":3,"file":"cli.cjs","names":["loadCLITools: LoadCLITools","z","log: Partial<LogConfig>","Locales","fillOptions: any","pushOptions: any"],"sources":["../../../src/tools/cli.ts"],"sourcesContent":["import {\n build,\n fill,\n listContentDeclarationRows,\n listMissingTranslations,\n pull,\n push,\n} from '@intlayer/cli';\nimport { Locales, type LogConfig } from '@intlayer/types';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod/v3';\n\ntype LoadCLITools = (server: McpServer) => Promise<void>;\n\nexport const loadCLITools: LoadCLITools = async (server) => {\n server.tool(\n 'intlayer-build',\n 'Build the dictionaries. List all content declarations files `.content.{ts,tsx,js,json,...}` to update the content callable using the `useIntlayer` hook.',\n {\n watch: z.boolean().optional().describe('Watch for changes'),\n baseDir: z.string().optional().describe('Base directory'),\n env: z.string().optional().describe('Environment'),\n envFile: z.string().optional().describe('Environment file'),\n verbose: z.boolean().optional().describe('Verbose output'),\n prefix: z.string().optional().describe('Log prefix'),\n },\n async ({ watch, baseDir, env, envFile, verbose, prefix }) => {\n try {\n const log: Partial<LogConfig> = {};\n if (verbose) {\n log.mode = 'verbose';\n }\n if (prefix) {\n log.prefix = prefix;\n }\n\n await build({\n watch,\n configOptions: {\n baseDir,\n env,\n envFile,\n override: {\n log,\n },\n },\n });\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.tool(\n 'intlayer-fill',\n 'Fill the dictionaries with missing translations / review translations using Intlayer servers',\n {\n sourceLocale: z\n .nativeEnum(Locales.ALL_LOCALES)\n .optional()\n .describe('Source locale'),\n outputLocales: z\n .union([\n z.nativeEnum(Locales.ALL_LOCALES),\n z.array(z.nativeEnum(Locales.ALL_LOCALES)),\n ])\n .optional()\n .describe('Output locales'),\n file: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('File path'),\n mode: z.enum(['complete', 'review']).optional().describe('Fill mode'),\n keys: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Keys to include'),\n excludedKeys: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Keys to exclude'),\n pathFilter: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Path filter'),\n gitOptions: z\n .object({\n gitDiff: z.boolean().optional(),\n gitDiffBase: z.string().optional(),\n gitDiffCurrent: z.string().optional(),\n uncommitted: z.boolean().optional(),\n unpushed: z.boolean().optional(),\n untracked: z.boolean().optional(),\n })\n .optional()\n .describe('Git options'),\n aiOptions: z\n .object({\n provider: z.string().optional(),\n temperature: z.number().optional(),\n model: z.string().optional(),\n apiKey: z.string().optional(),\n customPrompt: z.string().optional(),\n applicationContext: z.string().optional(),\n })\n .optional()\n .describe('AI options'),\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.tool(\n 'intlayer-push',\n 'Push local dictionaries to the server',\n {\n deleteLocaleDictionary: z\n .boolean()\n .optional()\n .describe('Delete local dictionary after push'),\n keepLocaleDictionary: z\n .boolean()\n .optional()\n .describe('Keep local dictionary after push'),\n dictionaries: z\n .array(z.string())\n .optional()\n .describe('List of dictionaries to push'),\n gitOptions: z\n .object({\n gitDiff: z.boolean().optional(),\n gitDiffBase: z.string().optional(),\n gitDiffCurrent: z.string().optional(),\n uncommitted: z.boolean().optional(),\n unpushed: z.boolean().optional(),\n untracked: z.boolean().optional(),\n })\n .optional()\n .describe('Git options'),\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.tool(\n 'intlayer-pull',\n 'Pull dictionaries from the CMS',\n {\n dictionaries: z\n .array(z.string())\n .optional()\n .describe('List of dictionaries to pull'),\n newDictionariesPath: z\n .string()\n .optional()\n .describe('Path to save new dictionaries'),\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.tool(\n 'intlayer-content-list',\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 {\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\n },\n async (props) => {\n try {\n const rows = listContentDeclarationRows(props);\n return {\n content: [\n {\n type: 'text',\n text: 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.tool(\n 'intlayer-content-test',\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 {\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\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"],"mappings":";;;;;;;AAcA,MAAaA,eAA6B,OAAO,WAAW;AAC1D,QAAO,KACL,kBACA,4JACA;EACE,OAAOC,eAAE,SAAS,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F,EACF;;GAGN;AAED,QAAO,KACL,yBACA,mLACA,EACE,eAAeA,eACZ,OAAO;EACN,SAASA,eAAE,QAAQ,CAAC,UAAU;EAC9B,KAAKA,eAAE,QAAQ,CAAC,UAAU;EAC1B,SAASA,eAAE,QAAQ,CAAC,UAAU;EAC9B,UAAUA,eACP,OAAO,EACN,KAAKA,eACF,OAAO;GACN,QAAQA,eAAE,QAAQ,CAAC,UAAU;GAC7B,SAASA,eAAE,SAAS,CAAC,UAAU;GAChC,CAAC,CACD,UAAU,EACd,CAAC,CACD,UAAU;EACd,CAAC,CACD,UAAU,CACV,SAAS,wBAAwB,EACrC,EACD,OAAO,UAAU;AACf,MAAI;GACF,MAAM,kEACJ,OAAO,cACR;AACD,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,KAAK,UAAU,qBAAqB,MAAM,EAAE;IACnD,CACF,EACF;WACM,OAAO;AAGd,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,wBALV,iBAAiB,QAAQ,MAAM,UAAU;IAMtC,CACF,EACF;;GAGN"}
|
package/dist/cjs/tools/docs.cjs
CHANGED
|
@@ -2,33 +2,53 @@ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
|
2
2
|
let zod_v3 = require("zod/v3");
|
|
3
3
|
zod_v3 = require_rolldown_runtime.__toESM(zod_v3);
|
|
4
4
|
let __intlayer_docs = require("@intlayer/docs");
|
|
5
|
-
__intlayer_docs = require_rolldown_runtime.__toESM(__intlayer_docs);
|
|
6
5
|
|
|
7
6
|
//#region src/tools/docs.ts
|
|
8
7
|
const loadDocsTools = async (server) => {
|
|
9
8
|
const docsKeys = (0, __intlayer_docs.getDocsKeys)();
|
|
10
9
|
server.tool("get-doc-list", "Get the list of docs names and their metadata to get more details about what doc to retrieve", {}, async () => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
try {
|
|
11
|
+
const docsMetadataRecord = await (0, __intlayer_docs.getDocMetadataRecord)();
|
|
12
|
+
return { content: [{
|
|
13
|
+
type: "text",
|
|
14
|
+
text: JSON.stringify(docsMetadataRecord, null, 2)
|
|
15
|
+
}] };
|
|
16
|
+
} catch (error) {
|
|
17
|
+
return { content: [{
|
|
18
|
+
type: "text",
|
|
19
|
+
text: `Get doc list failed: ${error instanceof Error ? error.message : "An unknown error occurred"}`
|
|
20
|
+
}] };
|
|
21
|
+
}
|
|
16
22
|
});
|
|
17
23
|
server.tool("get-doc", "Get a doc by his key. Example: `./docs/en/getting-started.md`. List all docs metadata first to get more details about what doc key to retrieve.", { docKey: zod_v3.default.enum(docsKeys) }, async ({ docKey }) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
try {
|
|
25
|
+
return { content: [{
|
|
26
|
+
type: "text",
|
|
27
|
+
text: await (0, __intlayer_docs.getDoc)(docKey)
|
|
28
|
+
}] };
|
|
29
|
+
} catch (error) {
|
|
30
|
+
return { content: [{
|
|
31
|
+
type: "text",
|
|
32
|
+
text: `Get doc failed: ${error instanceof Error ? error.message : "An unknown error occurred"}`
|
|
33
|
+
}] };
|
|
34
|
+
}
|
|
22
35
|
});
|
|
23
36
|
server.tool("get-doc-by-slug", "Get an array of docs by their slugs. If not slug is provided, return all docs (1.2Mb). List all docs metadata first to get more details about what doc to retrieve.", {
|
|
24
37
|
slug: zod_v3.default.union([zod_v3.default.string(), zod_v3.default.array(zod_v3.default.string())]).optional().describe("Slug of the docs. If not provided, return all docs. If not provided, return all docs."),
|
|
25
38
|
strict: zod_v3.default.boolean().optional().describe("Strict mode - only return docs that match all slugs, by excluding additional slugs"),
|
|
26
39
|
description: "Get an array of docs by their slugs"
|
|
27
40
|
}, async ({ slug, strict }) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
41
|
+
try {
|
|
42
|
+
return { content: (await (0, __intlayer_docs.getDocBySlug)(slug, void 0, strict)).map((d) => ({
|
|
43
|
+
type: "text",
|
|
44
|
+
text: d
|
|
45
|
+
})) };
|
|
46
|
+
} catch (error) {
|
|
47
|
+
return { content: [{
|
|
48
|
+
type: "text",
|
|
49
|
+
text: `Get doc by slug failed: ${error instanceof Error ? error.message : "An unknown error occurred"}`
|
|
50
|
+
}] };
|
|
51
|
+
}
|
|
32
52
|
});
|
|
33
53
|
};
|
|
34
54
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.cjs","names":["loadDocsTools: LoadDocsTools","z"],"sources":["../../../src/tools/docs.ts"],"sourcesContent":["import {\n getDoc,\n getDocBySlug,\n getDocMetadataRecord,\n getDocsKeys,\n} from '@intlayer/docs';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod/v3';\n\ntype LoadDocsTools = (server: McpServer) => Promise<void>;\n\nexport const loadDocsTools: LoadDocsTools = async (server) => {\n const docsKeys = getDocsKeys();\n\n server.tool(\n 'get-doc-list',\n 'Get the list of docs names and their metadata to get more details about what doc to retrieve',\n {},\n async () => {\n const docsMetadataRecord = await getDocMetadataRecord();\n\n
|
|
1
|
+
{"version":3,"file":"docs.cjs","names":["loadDocsTools: LoadDocsTools","z"],"sources":["../../../src/tools/docs.ts"],"sourcesContent":["import type { DocKey } from '@intlayer/docs';\nimport {\n getDoc,\n getDocBySlug,\n getDocMetadataRecord,\n getDocsKeys,\n} from '@intlayer/docs';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod/v3';\n\ntype LoadDocsTools = (server: McpServer) => Promise<void>;\n\nexport const loadDocsTools: LoadDocsTools = async (server) => {\n const docsKeys = getDocsKeys();\n\n server.tool(\n 'get-doc-list',\n 'Get the list of docs names and their metadata to get more details about what doc to retrieve',\n {},\n async () => {\n try {\n const docsMetadataRecord = await getDocMetadataRecord();\n\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(docsMetadataRecord, 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 { type: 'text', text: `Get doc list failed: ${errorMessage}` },\n ],\n };\n }\n }\n );\n\n server.tool(\n 'get-doc',\n 'Get a doc by his key. Example: `./docs/en/getting-started.md`. List all docs metadata first to get more details about what doc key to retrieve.',\n {\n docKey: z.enum(docsKeys as [string, ...string[]]),\n },\n async ({ docKey }) => {\n try {\n const doc = await getDoc(docKey as DocKey);\n return {\n content: [{ type: 'text', text: doc }],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [{ type: 'text', text: `Get doc failed: ${errorMessage}` }],\n };\n }\n }\n );\n\n server.tool(\n 'get-doc-by-slug',\n 'Get an array of docs by their slugs. If not slug is provided, return all docs (1.2Mb). List all docs metadata first to get more details about what doc to retrieve.',\n {\n slug: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe(\n 'Slug of the docs. If not provided, return all docs. If not provided, return all docs.'\n ),\n strict: z\n .boolean()\n .optional()\n .describe(\n 'Strict mode - only return docs that match all slugs, by excluding additional slugs'\n ),\n description: 'Get an array of docs by their slugs',\n },\n async ({ slug, strict }) => {\n try {\n const doc = await getDocBySlug(slug, undefined, strict);\n return {\n content: doc.map((d) => ({ type: 'text', text: d })),\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n { type: 'text', text: `Get doc by slug failed: ${errorMessage}` },\n ],\n };\n }\n }\n );\n};\n"],"mappings":";;;;;;AAYA,MAAaA,gBAA+B,OAAO,WAAW;CAC5D,MAAM,6CAAwB;AAE9B,QAAO,KACL,gBACA,gGACA,EAAE,EACF,YAAY;AACV,MAAI;GACF,MAAM,qBAAqB,iDAA4B;AAEvD,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,KAAK,UAAU,oBAAoB,MAAM,EAAE;IAClD,CACF,EACF;WACM,OAAO;AAGd,UAAO,EACL,SAAS,CACP;IAAE,MAAM;IAAQ,MAAM,wBAHxB,iBAAiB,QAAQ,MAAM,UAAU;IAGuB,CAC/D,EACF;;GAGN;AAED,QAAO,KACL,WACA,mJACA,EACE,QAAQC,eAAE,KAAK,SAAkC,EAClD,EACD,OAAO,EAAE,aAAa;AACpB,MAAI;AAEF,UAAO,EACL,SAAS,CAAC;IAAE,MAAM;IAAQ,MAFhB,kCAAa,OAAiB;IAEH,CAAC,EACvC;WACM,OAAO;AAGd,UAAO,EACL,SAAS,CAAC;IAAE,MAAM;IAAQ,MAAM,mBAFhC,iBAAiB,QAAQ,MAAM,UAAU;IAE0B,CAAC,EACrE;;GAGN;AAED,QAAO,KACL,mBACA,uKACA;EACE,MAAMA,eACH,MAAM,CAACA,eAAE,QAAQ,EAAEA,eAAE,MAAMA,eAAE,QAAQ,CAAC,CAAC,CAAC,CACxC,UAAU,CACV,SACC,wFACD;EACH,QAAQA,eACL,SAAS,CACT,UAAU,CACV,SACC,qFACD;EACH,aAAa;EACd,EACD,OAAO,EAAE,MAAM,aAAa;AAC1B,MAAI;AAEF,UAAO,EACL,UAFU,wCAAmB,MAAM,QAAW,OAAO,EAExC,KAAK,OAAO;IAAE,MAAM;IAAQ,MAAM;IAAG,EAAE,EACrD;WACM,OAAO;AAGd,UAAO,EACL,SAAS,CACP;IAAE,MAAM;IAAQ,MAAM,2BAHxB,iBAAiB,QAAQ,MAAM,UAAU;IAG0B,CAClE,EACF;;GAGN"}
|
|
@@ -15,8 +15,16 @@ const loadServer = ({ isLocal }) => {
|
|
|
15
15
|
version: packageJson.version,
|
|
16
16
|
capabilities: { resources: {} }
|
|
17
17
|
});
|
|
18
|
-
if (isLocal)
|
|
19
|
-
|
|
18
|
+
if (isLocal) try {
|
|
19
|
+
loadCLITools(server);
|
|
20
|
+
} catch (error) {
|
|
21
|
+
console.error("Error loading CLI tools:", error);
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
loadDocsTools(server);
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.error("Error loading docs tools:", error);
|
|
27
|
+
}
|
|
20
28
|
return server;
|
|
21
29
|
};
|
|
22
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.mjs","names":["dirname: string","pathDirname","packageJson: Record<string, any>","loadServer: LoadServer"],"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';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { loadCLITools } from '../tools/cli';\nimport { loadDocsTools } from '../tools/docs';\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 capabilities: {\n resources: {},\n },\n });\n\n if (isLocal) {\n loadCLITools(server);\n }\n\n loadDocsTools(server);\n\n return server;\n};\n"],"mappings":";;;;;;;;;AAQA,MAAaA,UAAkB,aAC3BC,UAAY,cAAc,OAAO,KAAK,IAAI,CAAC,GAC3C;AAEJ,MAAMC,cAAmC,KAAK,MAC5C,aAAa,QAAQ,SAAS,wBAAwB,EAAE,OAAO,CAChE;AAID,MAAaC,cAA0B,EAAE,cAAc;CACrD,MAAM,SAAS,IAAI,UAAU;EAC3B,MAAM;EACN,SAAS,YAAY;EACrB,cAAc,EACZ,WAAW,EAAE,EACd;EACF,CAAC;AAEF,KAAI,QACF,
|
|
1
|
+
{"version":3,"file":"server.mjs","names":["dirname: string","pathDirname","packageJson: Record<string, any>","loadServer: LoadServer"],"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';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { loadCLITools } from '../tools/cli';\nimport { loadDocsTools } from '../tools/docs';\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 capabilities: {\n resources: {},\n },\n });\n\n if (isLocal) {\n try {\n loadCLITools(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":";;;;;;;;;AAQA,MAAaA,UAAkB,aAC3BC,UAAY,cAAc,OAAO,KAAK,IAAI,CAAC,GAC3C;AAEJ,MAAMC,cAAmC,KAAK,MAC5C,aAAa,QAAQ,SAAS,wBAAwB,EAAE,OAAO,CAChE;AAID,MAAaC,cAA0B,EAAE,cAAc;CACrD,MAAM,SAAS,IAAI,UAAU;EAC3B,MAAM;EACN,SAAS,YAAY;EACrB,cAAc,EACZ,WAAW,EAAE,EACd;EACF,CAAC;AAEF,KAAI,QACF,KAAI;AACF,eAAa,OAAO;UACb,OAAO;AACd,UAAQ,MAAM,4BAA4B,MAAM;;AAIpD,KAAI;AACF,gBAAc,OAAO;UACd,OAAO;AACd,UAAQ,MAAM,6BAA6B,MAAM;;AAGnD,QAAO"}
|
package/dist/esm/tools/cli.mjs
CHANGED
|
@@ -183,7 +183,7 @@ const loadCLITools = async (server) => {
|
|
|
183
183
|
}).optional() }).optional()
|
|
184
184
|
}).optional().describe("Configuration options") }, async (props) => {
|
|
185
185
|
try {
|
|
186
|
-
const missingTranslations = listMissingTranslations(
|
|
186
|
+
const missingTranslations = listMissingTranslations(props?.configOptions);
|
|
187
187
|
return { content: [{
|
|
188
188
|
type: "text",
|
|
189
189
|
text: JSON.stringify(missingTranslations, null, 2)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.mjs","names":["loadCLITools: LoadCLITools","log: Partial<LogConfig>","fillOptions: any","pushOptions: any"],"sources":["../../../src/tools/cli.ts"],"sourcesContent":["import {\n build,\n fill,\n listContentDeclarationRows,\n listMissingTranslations,\n pull,\n push,\n} from '@intlayer/cli';\nimport { Locales, type LogConfig } from '@intlayer/types';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod/v3';\n\ntype LoadCLITools = (server: McpServer) => Promise<void>;\n\nexport const loadCLITools: LoadCLITools = async (server) => {\n server.tool(\n 'intlayer-build',\n 'Build the dictionaries. List all content declarations files `.content.{ts,tsx,js,json,...}` to update the content callable using the `useIntlayer` hook.',\n {\n watch: z.boolean().optional().describe('Watch for changes'),\n baseDir: z.string().optional().describe('Base directory'),\n env: z.string().optional().describe('Environment'),\n envFile: z.string().optional().describe('Environment file'),\n verbose: z.boolean().optional().describe('Verbose output'),\n prefix: z.string().optional().describe('Log prefix'),\n },\n async ({ watch, baseDir, env, envFile, verbose, prefix }) => {\n try {\n const log: Partial<LogConfig> = {};\n if (verbose) {\n log.mode = 'verbose';\n }\n if (prefix) {\n log.prefix = prefix;\n }\n\n await build({\n watch,\n configOptions: {\n baseDir,\n env,\n envFile,\n override: {\n log,\n },\n },\n });\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.tool(\n 'intlayer-fill',\n 'Fill the dictionaries with missing translations / review translations using Intlayer servers',\n {\n sourceLocale: z\n .nativeEnum(Locales.ALL_LOCALES)\n .optional()\n .describe('Source locale'),\n outputLocales: z\n .union([\n z.nativeEnum(Locales.ALL_LOCALES),\n z.array(z.nativeEnum(Locales.ALL_LOCALES)),\n ])\n .optional()\n .describe('Output locales'),\n file: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('File path'),\n mode: z.enum(['complete', 'review']).optional().describe('Fill mode'),\n keys: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Keys to include'),\n excludedKeys: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Keys to exclude'),\n pathFilter: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Path filter'),\n gitOptions: z\n .object({\n gitDiff: z.boolean().optional(),\n gitDiffBase: z.string().optional(),\n gitDiffCurrent: z.string().optional(),\n uncommitted: z.boolean().optional(),\n unpushed: z.boolean().optional(),\n untracked: z.boolean().optional(),\n })\n .optional()\n .describe('Git options'),\n aiOptions: z\n .object({\n provider: z.string().optional(),\n temperature: z.number().optional(),\n model: z.string().optional(),\n apiKey: z.string().optional(),\n customPrompt: z.string().optional(),\n applicationContext: z.string().optional(),\n })\n .optional()\n .describe('AI options'),\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.tool(\n 'intlayer-push',\n 'Push local dictionaries to the server',\n {\n deleteLocaleDictionary: z\n .boolean()\n .optional()\n .describe('Delete local dictionary after push'),\n keepLocaleDictionary: z\n .boolean()\n .optional()\n .describe('Keep local dictionary after push'),\n dictionaries: z\n .array(z.string())\n .optional()\n .describe('List of dictionaries to push'),\n gitOptions: z\n .object({\n gitDiff: z.boolean().optional(),\n gitDiffBase: z.string().optional(),\n gitDiffCurrent: z.string().optional(),\n uncommitted: z.boolean().optional(),\n unpushed: z.boolean().optional(),\n untracked: z.boolean().optional(),\n })\n .optional()\n .describe('Git options'),\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.tool(\n 'intlayer-pull',\n 'Pull dictionaries from the CMS',\n {\n dictionaries: z\n .array(z.string())\n .optional()\n .describe('List of dictionaries to pull'),\n newDictionariesPath: z\n .string()\n .optional()\n .describe('Path to save new dictionaries'),\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.tool(\n 'intlayer-content-list',\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 {\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\n },\n async (props) => {\n try {\n const rows = listContentDeclarationRows(props);\n return {\n content: [\n {\n type: 'text',\n text: 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.tool(\n 'intlayer-content-test',\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 {\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\n },\n async (props) => {\n try {\n const missingTranslations = listMissingTranslations(\n undefined,\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"],"mappings":";;;;;AAcA,MAAaA,eAA6B,OAAO,WAAW;AAC1D,QAAO,KACL,kBACA,4JACA;EACE,OAAO,EAAE,SAAS,CAAC,UAAU,CAAC,SAAS,oBAAoB;EAC3D,SAAS,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,iBAAiB;EACzD,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,cAAc;EAClD,SAAS,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,mBAA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QAAQ,CAAC,UAAU;GAC7B,SAAS,EAAE,SAAS,CAAC,UAAU;GAChC,CAAC,CACD,UAAU,EACd,CAAC,CACD,UAAU;EACd,CAAC,CACD,UAAU,CACV,SAAS,wBAAwB,EACrC,EACD,OAAO,UAAU;AACf,MAAI;GACF,MAAM,sBAAsB,wBAC1B,QACA,OAAO,cACR;AACD,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,KAAK,UAAU,qBAAqB,MAAM,EAAE;IACnD,CACF,EACF;WACM,OAAO;AAGd,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,wBALV,iBAAiB,QAAQ,MAAM,UAAU;IAMtC,CACF,EACF;;GAGN"}
|
|
1
|
+
{"version":3,"file":"cli.mjs","names":["loadCLITools: LoadCLITools","log: Partial<LogConfig>","fillOptions: any","pushOptions: any"],"sources":["../../../src/tools/cli.ts"],"sourcesContent":["import {\n build,\n fill,\n listContentDeclarationRows,\n listMissingTranslations,\n pull,\n push,\n} from '@intlayer/cli';\nimport { Locales, type LogConfig } from '@intlayer/types';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod/v3';\n\ntype LoadCLITools = (server: McpServer) => Promise<void>;\n\nexport const loadCLITools: LoadCLITools = async (server) => {\n server.tool(\n 'intlayer-build',\n 'Build the dictionaries. List all content declarations files `.content.{ts,tsx,js,json,...}` to update the content callable using the `useIntlayer` hook.',\n {\n watch: z.boolean().optional().describe('Watch for changes'),\n baseDir: z.string().optional().describe('Base directory'),\n env: z.string().optional().describe('Environment'),\n envFile: z.string().optional().describe('Environment file'),\n verbose: z.boolean().optional().describe('Verbose output'),\n prefix: z.string().optional().describe('Log prefix'),\n },\n async ({ watch, baseDir, env, envFile, verbose, prefix }) => {\n try {\n const log: Partial<LogConfig> = {};\n if (verbose) {\n log.mode = 'verbose';\n }\n if (prefix) {\n log.prefix = prefix;\n }\n\n await build({\n watch,\n configOptions: {\n baseDir,\n env,\n envFile,\n override: {\n log,\n },\n },\n });\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.tool(\n 'intlayer-fill',\n 'Fill the dictionaries with missing translations / review translations using Intlayer servers',\n {\n sourceLocale: z\n .nativeEnum(Locales.ALL_LOCALES)\n .optional()\n .describe('Source locale'),\n outputLocales: z\n .union([\n z.nativeEnum(Locales.ALL_LOCALES),\n z.array(z.nativeEnum(Locales.ALL_LOCALES)),\n ])\n .optional()\n .describe('Output locales'),\n file: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('File path'),\n mode: z.enum(['complete', 'review']).optional().describe('Fill mode'),\n keys: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Keys to include'),\n excludedKeys: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Keys to exclude'),\n pathFilter: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Path filter'),\n gitOptions: z\n .object({\n gitDiff: z.boolean().optional(),\n gitDiffBase: z.string().optional(),\n gitDiffCurrent: z.string().optional(),\n uncommitted: z.boolean().optional(),\n unpushed: z.boolean().optional(),\n untracked: z.boolean().optional(),\n })\n .optional()\n .describe('Git options'),\n aiOptions: z\n .object({\n provider: z.string().optional(),\n temperature: z.number().optional(),\n model: z.string().optional(),\n apiKey: z.string().optional(),\n customPrompt: z.string().optional(),\n applicationContext: z.string().optional(),\n })\n .optional()\n .describe('AI options'),\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.tool(\n 'intlayer-push',\n 'Push local dictionaries to the server',\n {\n deleteLocaleDictionary: z\n .boolean()\n .optional()\n .describe('Delete local dictionary after push'),\n keepLocaleDictionary: z\n .boolean()\n .optional()\n .describe('Keep local dictionary after push'),\n dictionaries: z\n .array(z.string())\n .optional()\n .describe('List of dictionaries to push'),\n gitOptions: z\n .object({\n gitDiff: z.boolean().optional(),\n gitDiffBase: z.string().optional(),\n gitDiffCurrent: z.string().optional(),\n uncommitted: z.boolean().optional(),\n unpushed: z.boolean().optional(),\n untracked: z.boolean().optional(),\n })\n .optional()\n .describe('Git options'),\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.tool(\n 'intlayer-pull',\n 'Pull dictionaries from the CMS',\n {\n dictionaries: z\n .array(z.string())\n .optional()\n .describe('List of dictionaries to pull'),\n newDictionariesPath: z\n .string()\n .optional()\n .describe('Path to save new dictionaries'),\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.tool(\n 'intlayer-content-list',\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 {\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\n },\n async (props) => {\n try {\n const rows = listContentDeclarationRows(props);\n return {\n content: [\n {\n type: 'text',\n text: 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.tool(\n 'intlayer-content-test',\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 {\n configOptions: z\n .object({\n baseDir: z.string().optional(),\n env: z.string().optional(),\n envFile: z.string().optional(),\n override: z\n .object({\n log: z\n .object({\n prefix: z.string().optional(),\n verbose: z.boolean().optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional()\n .describe('Configuration options'),\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"],"mappings":";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MAAM,wBALV,iBAAiB,QAAQ,MAAM,UAAU;IAMtC,CACF,EACF;;GAGN;AAED,QAAO,KACL,yBACA,mLACA,EACE,eAAe,EACZ,OAAO;EACN,SAAS,EAAE,QAAQ,CAAC,UAAU;EAC9B,KAAK,EAAE,QAAQ,CAAC,UAAU;EAC1B,SAAS,EAAE,QAAQ,CAAC,UAAU;EAC9B,UAAU,EACP,OAAO,EACN,KAAK,EACF,OAAO;GACN,QAAQ,EAAE,QAAQ,CAAC,UAAU;GAC7B,SAAS,EAAE,SAAS,CAAC,UAAU;GAChC,CAAC,CACD,UAAU,EACd,CAAC,CACD,UAAU;EACd,CAAC,CACD,UAAU,CACV,SAAS,wBAAwB,EACrC,EACD,OAAO,UAAU;AACf,MAAI;GACF,MAAM,sBAAsB,wBAC1B,OAAO,cACR;AACD,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,KAAK,UAAU,qBAAqB,MAAM,EAAE;IACnD,CACF,EACF;WACM,OAAO;AAGd,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,wBALV,iBAAiB,QAAQ,MAAM,UAAU;IAMtC,CACF,EACF;;GAGN"}
|
package/dist/esm/tools/docs.mjs
CHANGED
|
@@ -5,27 +5,48 @@ import { getDoc, getDocBySlug, getDocMetadataRecord, getDocsKeys } from "@intlay
|
|
|
5
5
|
const loadDocsTools = async (server) => {
|
|
6
6
|
const docsKeys = getDocsKeys();
|
|
7
7
|
server.tool("get-doc-list", "Get the list of docs names and their metadata to get more details about what doc to retrieve", {}, async () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
try {
|
|
9
|
+
const docsMetadataRecord = await getDocMetadataRecord();
|
|
10
|
+
return { content: [{
|
|
11
|
+
type: "text",
|
|
12
|
+
text: JSON.stringify(docsMetadataRecord, null, 2)
|
|
13
|
+
}] };
|
|
14
|
+
} catch (error) {
|
|
15
|
+
return { content: [{
|
|
16
|
+
type: "text",
|
|
17
|
+
text: `Get doc list failed: ${error instanceof Error ? error.message : "An unknown error occurred"}`
|
|
18
|
+
}] };
|
|
19
|
+
}
|
|
13
20
|
});
|
|
14
21
|
server.tool("get-doc", "Get a doc by his key. Example: `./docs/en/getting-started.md`. List all docs metadata first to get more details about what doc key to retrieve.", { docKey: z.enum(docsKeys) }, async ({ docKey }) => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
try {
|
|
23
|
+
return { content: [{
|
|
24
|
+
type: "text",
|
|
25
|
+
text: await getDoc(docKey)
|
|
26
|
+
}] };
|
|
27
|
+
} catch (error) {
|
|
28
|
+
return { content: [{
|
|
29
|
+
type: "text",
|
|
30
|
+
text: `Get doc failed: ${error instanceof Error ? error.message : "An unknown error occurred"}`
|
|
31
|
+
}] };
|
|
32
|
+
}
|
|
19
33
|
});
|
|
20
34
|
server.tool("get-doc-by-slug", "Get an array of docs by their slugs. If not slug is provided, return all docs (1.2Mb). List all docs metadata first to get more details about what doc to retrieve.", {
|
|
21
35
|
slug: z.union([z.string(), z.array(z.string())]).optional().describe("Slug of the docs. If not provided, return all docs. If not provided, return all docs."),
|
|
22
36
|
strict: z.boolean().optional().describe("Strict mode - only return docs that match all slugs, by excluding additional slugs"),
|
|
23
37
|
description: "Get an array of docs by their slugs"
|
|
24
38
|
}, async ({ slug, strict }) => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
try {
|
|
40
|
+
return { content: (await getDocBySlug(slug, void 0, strict)).map((d) => ({
|
|
41
|
+
type: "text",
|
|
42
|
+
text: d
|
|
43
|
+
})) };
|
|
44
|
+
} catch (error) {
|
|
45
|
+
return { content: [{
|
|
46
|
+
type: "text",
|
|
47
|
+
text: `Get doc by slug failed: ${error instanceof Error ? error.message : "An unknown error occurred"}`
|
|
48
|
+
}] };
|
|
49
|
+
}
|
|
29
50
|
});
|
|
30
51
|
};
|
|
31
52
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.mjs","names":["loadDocsTools: LoadDocsTools"],"sources":["../../../src/tools/docs.ts"],"sourcesContent":["import {\n getDoc,\n getDocBySlug,\n getDocMetadataRecord,\n getDocsKeys,\n} from '@intlayer/docs';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod/v3';\n\ntype LoadDocsTools = (server: McpServer) => Promise<void>;\n\nexport const loadDocsTools: LoadDocsTools = async (server) => {\n const docsKeys = getDocsKeys();\n\n server.tool(\n 'get-doc-list',\n 'Get the list of docs names and their metadata to get more details about what doc to retrieve',\n {},\n async () => {\n const docsMetadataRecord = await getDocMetadataRecord();\n\n
|
|
1
|
+
{"version":3,"file":"docs.mjs","names":["loadDocsTools: LoadDocsTools"],"sources":["../../../src/tools/docs.ts"],"sourcesContent":["import type { DocKey } from '@intlayer/docs';\nimport {\n getDoc,\n getDocBySlug,\n getDocMetadataRecord,\n getDocsKeys,\n} from '@intlayer/docs';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport z from 'zod/v3';\n\ntype LoadDocsTools = (server: McpServer) => Promise<void>;\n\nexport const loadDocsTools: LoadDocsTools = async (server) => {\n const docsKeys = getDocsKeys();\n\n server.tool(\n 'get-doc-list',\n 'Get the list of docs names and their metadata to get more details about what doc to retrieve',\n {},\n async () => {\n try {\n const docsMetadataRecord = await getDocMetadataRecord();\n\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(docsMetadataRecord, 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 { type: 'text', text: `Get doc list failed: ${errorMessage}` },\n ],\n };\n }\n }\n );\n\n server.tool(\n 'get-doc',\n 'Get a doc by his key. Example: `./docs/en/getting-started.md`. List all docs metadata first to get more details about what doc key to retrieve.',\n {\n docKey: z.enum(docsKeys as [string, ...string[]]),\n },\n async ({ docKey }) => {\n try {\n const doc = await getDoc(docKey as DocKey);\n return {\n content: [{ type: 'text', text: doc }],\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [{ type: 'text', text: `Get doc failed: ${errorMessage}` }],\n };\n }\n }\n );\n\n server.tool(\n 'get-doc-by-slug',\n 'Get an array of docs by their slugs. If not slug is provided, return all docs (1.2Mb). List all docs metadata first to get more details about what doc to retrieve.',\n {\n slug: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe(\n 'Slug of the docs. If not provided, return all docs. If not provided, return all docs.'\n ),\n strict: z\n .boolean()\n .optional()\n .describe(\n 'Strict mode - only return docs that match all slugs, by excluding additional slugs'\n ),\n description: 'Get an array of docs by their slugs',\n },\n async ({ slug, strict }) => {\n try {\n const doc = await getDocBySlug(slug, undefined, strict);\n return {\n content: doc.map((d) => ({ type: 'text', text: d })),\n };\n } catch (error) {\n const errorMessage =\n error instanceof Error ? error.message : 'An unknown error occurred';\n return {\n content: [\n { type: 'text', text: `Get doc by slug failed: ${errorMessage}` },\n ],\n };\n }\n }\n );\n};\n"],"mappings":";;;;AAYA,MAAaA,gBAA+B,OAAO,WAAW;CAC5D,MAAM,WAAW,aAAa;AAE9B,QAAO,KACL,gBACA,gGACA,EAAE,EACF,YAAY;AACV,MAAI;GACF,MAAM,qBAAqB,MAAM,sBAAsB;AAEvD,UAAO,EACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,KAAK,UAAU,oBAAoB,MAAM,EAAE;IAClD,CACF,EACF;WACM,OAAO;AAGd,UAAO,EACL,SAAS,CACP;IAAE,MAAM;IAAQ,MAAM,wBAHxB,iBAAiB,QAAQ,MAAM,UAAU;IAGuB,CAC/D,EACF;;GAGN;AAED,QAAO,KACL,WACA,mJACA,EACE,QAAQ,EAAE,KAAK,SAAkC,EAClD,EACD,OAAO,EAAE,aAAa;AACpB,MAAI;AAEF,UAAO,EACL,SAAS,CAAC;IAAE,MAAM;IAAQ,MAFhB,MAAM,OAAO,OAAiB;IAEH,CAAC,EACvC;WACM,OAAO;AAGd,UAAO,EACL,SAAS,CAAC;IAAE,MAAM;IAAQ,MAAM,mBAFhC,iBAAiB,QAAQ,MAAM,UAAU;IAE0B,CAAC,EACrE;;GAGN;AAED,QAAO,KACL,mBACA,uKACA;EACE,MAAM,EACH,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CACxC,UAAU,CACV,SACC,wFACD;EACH,QAAQ,EACL,SAAS,CACT,UAAU,CACV,SACC,qFACD;EACH,aAAa;EACd,EACD,OAAO,EAAE,MAAM,aAAa;AAC1B,MAAI;AAEF,UAAO,EACL,UAFU,MAAM,aAAa,MAAM,QAAW,OAAO,EAExC,KAAK,OAAO;IAAE,MAAM;IAAQ,MAAM;IAAG,EAAE,EACrD;WACM,OAAO;AAGd,UAAO,EACL,SAAS,CACP;IAAE,MAAM;IAAQ,MAAM,2BAHxB,iBAAiB,QAAQ,MAAM,UAAU;IAG0B,CAClE,EACF;;GAGN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","names":["loadDocsTools: LoadDocsTools"],"sources":["../../../src/tools/docs.ts"],"sourcesContent":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"docs.d.ts","names":["loadDocsTools: LoadDocsTools"],"sources":["../../../src/tools/docs.ts"],"sourcesContent":[],"mappings":";;;KAUK,aAAA,YAAyB,cAAc;cAE/BA,eAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/mcp",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.8",
|
|
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": [
|
|
@@ -92,11 +92,11 @@
|
|
|
92
92
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
93
93
|
},
|
|
94
94
|
"dependencies": {
|
|
95
|
-
"@intlayer/cli": "7.0.
|
|
96
|
-
"@intlayer/config": "7.0.
|
|
97
|
-
"@intlayer/docs": "7.0.
|
|
98
|
-
"@intlayer/types": "7.0.
|
|
99
|
-
"@modelcontextprotocol/sdk": "1.
|
|
95
|
+
"@intlayer/cli": "7.0.8",
|
|
96
|
+
"@intlayer/config": "7.0.8",
|
|
97
|
+
"@intlayer/docs": "7.0.8",
|
|
98
|
+
"@intlayer/types": "7.0.8",
|
|
99
|
+
"@modelcontextprotocol/sdk": "1.21.1",
|
|
100
100
|
"dotenv": "16.6.1",
|
|
101
101
|
"express": "5.1.0",
|
|
102
102
|
"zod": "3.25.76"
|
|
@@ -104,20 +104,20 @@
|
|
|
104
104
|
"devDependencies": {
|
|
105
105
|
"@modelcontextprotocol/inspector": "0.17.2",
|
|
106
106
|
"@types/express": "5.0.5",
|
|
107
|
-
"@types/node": "24.
|
|
108
|
-
"@utils/ts-config": "7.0.
|
|
109
|
-
"@utils/ts-config-types": "7.0.
|
|
110
|
-
"@utils/tsdown-config": "7.0.
|
|
111
|
-
"rimraf": "6.0
|
|
112
|
-
"tsdown": "0.
|
|
107
|
+
"@types/node": "24.10.0",
|
|
108
|
+
"@utils/ts-config": "7.0.8",
|
|
109
|
+
"@utils/ts-config-types": "7.0.8",
|
|
110
|
+
"@utils/tsdown-config": "7.0.8",
|
|
111
|
+
"rimraf": "6.1.0",
|
|
112
|
+
"tsdown": "0.16.0",
|
|
113
113
|
"typescript": "5.9.3",
|
|
114
|
-
"vitest": "4.0.
|
|
114
|
+
"vitest": "4.0.7"
|
|
115
115
|
},
|
|
116
116
|
"peerDependencies": {
|
|
117
|
-
"@intlayer/cli": "7.0.
|
|
118
|
-
"@intlayer/config": "7.0.
|
|
119
|
-
"@intlayer/docs": "7.0.
|
|
120
|
-
"@intlayer/types": "7.0.
|
|
117
|
+
"@intlayer/cli": "7.0.8",
|
|
118
|
+
"@intlayer/config": "7.0.8",
|
|
119
|
+
"@intlayer/docs": "7.0.8",
|
|
120
|
+
"@intlayer/types": "7.0.8"
|
|
121
121
|
},
|
|
122
122
|
"engines": {
|
|
123
123
|
"node": ">=14.18"
|