@intlayer/mcp 9.5.10 → 9.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { dirname as dirname$1 } from "node:path";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { createMCPClient } from "@ai-sdk/mcp";
|
|
4
3
|
import { isESModule } from "@intlayer/config/utils";
|
|
4
|
+
import { createMCPClient } from "@ai-sdk/mcp";
|
|
5
5
|
|
|
6
6
|
//#region src/client/client.ts
|
|
7
7
|
const dirname = isESModule ? dirname$1(fileURLToPath(import.meta.url)) : __dirname;
|
|
@@ -5,9 +5,9 @@ import { loadInstallLSPTool } from "../tools/installLSP.mjs";
|
|
|
5
5
|
import { loadInstallSkillsTool } from "../tools/installSkills.mjs";
|
|
6
6
|
import { z } from "zod/mini";
|
|
7
7
|
import { dirname as dirname$1, resolve } from "node:path";
|
|
8
|
+
import { readFileSync } from "node:fs";
|
|
8
9
|
import { fileURLToPath } from "node:url";
|
|
9
10
|
import { isESModule } from "@intlayer/config/utils";
|
|
10
|
-
import { readFileSync } from "node:fs";
|
|
11
11
|
|
|
12
12
|
//#region src/server/server.ts
|
|
13
13
|
const dirname = isESModule ? dirname$1(fileURLToPath(import.meta.url)) : __dirname;
|
package/dist/esm/server/sse.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse.mjs","names":[],"sources":["../../../src/server/sse.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { randomUUID } from 'node:crypto';\nimport fastifyCors from '@fastify/cors';\nimport fastifyHelmet from '@fastify/helmet';\nimport dotenv from 'dotenv';\nimport Fastify from 'fastify';\nimport { loadServer, type McpServer } from './server';\n\nconst startServer = async () => {\n const app = Fastify();\n\n const env = process.env.NODE_ENV || 'development';\n\n dotenv.config({\n path: [`.env.${env}.local`, `.env.${env}`, '.env.local', '.env'],\n quiet: true,\n });\n\n await app.register(fastifyHelmet, {\n contentSecurityPolicy: false,\n global: true,\n });\n\n await app.register(fastifyCors, {\n origin: '*',\n methods: ['GET', 'POST', 'DELETE', 'OPTIONS'],\n allowedHeaders: ['Content-Type', 'mcp-session-id'],\n });\n\n const sessions = new Map<string, McpServer>();\n\n app.post('/', async (request, reply) => {\n const sessionId = request.headers['mcp-session-id'] as string | undefined;\n\n let server: McpServer;\n let currentSessionId: string;\n\n if (sessionId && sessions.has(sessionId)) {\n server = sessions.get(sessionId)!;\n currentSessionId = sessionId;\n } else if (!sessionId) {\n currentSessionId = randomUUID();\n server = loadServer({ isLocal: false });\n sessions.set(currentSessionId, server);\n reply.header('mcp-session-id', currentSessionId);\n } else {\n return reply.status(400).send({ messages: 'Bad session id.' });\n }\n\n try {\n const response = await server.handleMessage(request.body);\n if (response !== null && response !== undefined) {\n return reply.send(response);\n }\n return reply.status(202).send();\n } catch (error) {\n return reply.status(500).send({\n jsonrpc: '2.0',\n id: (request.body as any)?.id ?? null,\n error: { code: -32000, message: ['Internal server error', error] },\n });\n }\n });\n\n app.get('/', async (_request, reply) => {\n return reply.status(200).send('OK');\n });\n\n app.delete('/', async (request, reply) => {\n const sessionId = request.headers['mcp-session-id'] as string | undefined;\n if (!sessionId || !sessions.has(sessionId)) {\n return reply.status(400).send({ messages: 'Bad session id.' });\n }\n sessions.delete(sessionId);\n return reply.status(200).send();\n });\n\n app.get('/health', async (_request, reply) => {\n return reply.send('OK');\n });\n\n const PORT = Number(process.env.PORT) || 3000;\n await app.listen({ port: PORT, host: '0.0.0.0' });\n console.info(`MCP Streamable HTTP Server listening on port ${PORT}`);\n};\n\nstartServer();\n"],"mappings":";;;;;;;;;AASA,MAAM,cAAc,YAAY;CAC9B,MAAM,MAAM,QAAQ;CAEpB,MAAM;
|
|
1
|
+
{"version":3,"file":"sse.mjs","names":[],"sources":["../../../src/server/sse.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { randomUUID } from 'node:crypto';\nimport fastifyCors from '@fastify/cors';\nimport fastifyHelmet from '@fastify/helmet';\nimport dotenv from 'dotenv';\nimport Fastify from 'fastify';\nimport { loadServer, type McpServer } from './server';\n\nconst startServer = async () => {\n const app = Fastify();\n\n const env = process.env.NODE_ENV || 'development';\n\n dotenv.config({\n path: [`.env.${env}.local`, `.env.${env}`, '.env.local', '.env'],\n quiet: true,\n });\n\n await app.register(fastifyHelmet, {\n contentSecurityPolicy: false,\n global: true,\n });\n\n await app.register(fastifyCors, {\n origin: '*',\n methods: ['GET', 'POST', 'DELETE', 'OPTIONS'],\n allowedHeaders: ['Content-Type', 'mcp-session-id'],\n });\n\n const sessions = new Map<string, McpServer>();\n\n app.post('/', async (request, reply) => {\n const sessionId = request.headers['mcp-session-id'] as string | undefined;\n\n let server: McpServer;\n let currentSessionId: string;\n\n if (sessionId && sessions.has(sessionId)) {\n server = sessions.get(sessionId)!;\n currentSessionId = sessionId;\n } else if (!sessionId) {\n currentSessionId = randomUUID();\n server = loadServer({ isLocal: false });\n sessions.set(currentSessionId, server);\n reply.header('mcp-session-id', currentSessionId);\n } else {\n return reply.status(400).send({ messages: 'Bad session id.' });\n }\n\n try {\n const response = await server.handleMessage(request.body);\n if (response !== null && response !== undefined) {\n return reply.send(response);\n }\n return reply.status(202).send();\n } catch (error) {\n return reply.status(500).send({\n jsonrpc: '2.0',\n id: (request.body as any)?.id ?? null,\n error: { code: -32000, message: ['Internal server error', error] },\n });\n }\n });\n\n app.get('/', async (_request, reply) => {\n return reply.status(200).send('OK');\n });\n\n app.delete('/', async (request, reply) => {\n const sessionId = request.headers['mcp-session-id'] as string | undefined;\n if (!sessionId || !sessions.has(sessionId)) {\n return reply.status(400).send({ messages: 'Bad session id.' });\n }\n sessions.delete(sessionId);\n return reply.status(200).send();\n });\n\n app.get('/health', async (_request, reply) => {\n return reply.send('OK');\n });\n\n const PORT = Number(process.env.PORT) || 3000;\n await app.listen({ port: PORT, host: '0.0.0.0' });\n console.info(`MCP Streamable HTTP Server listening on port ${PORT}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AAC;EACH;CACF,CAAC;CAED,IAAI,IAAI,KAAK,OAAO,UAAU,UAAU;EACtC,OAAO,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,IAAI;CACpC,CAAC;CAED,IAAI,OAAO,KAAK,OAAO,SAAS,UAAU;EACxC,MAAM,YAAY,QAAQ,QAAQ;EAClC,IAAI,CAAC,aAAa,CAAC,SAAS,IAAI,SAAS,GACvC,OAAO,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,EAAE,UAAU,kBAAkB,CAAC;EAE/D,SAAS,OAAO,SAAS;EACzB,OAAO,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK;CAChC,CAAC;CAED,IAAI,IAAI,WAAW,OAAO,UAAU,UAAU;EAC5C,OAAO,MAAM,KAAK,IAAI;CACxB,CAAC;CAED,MAAM,OAAO,OAAO,QAAQ,IAAI,IAAI,KAAK;CACzC,MAAM,IAAI,OAAO;EAAE,MAAM;EAAM,MAAM;CAAU,CAAC;CAChD,QAAQ,KAAK,gDAAgD,MAAM;AACrE;AAEA,YAAY"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/mcp",
|
|
3
|
-
"version": "9.5.
|
|
3
|
+
"version": "9.5.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Intlayer MCP server. Handle MCP to help IDE to use Intlayer. It build, fill, pull, push, dictionaries",
|
|
6
6
|
"keywords": [
|
|
@@ -112,21 +112,21 @@
|
|
|
112
112
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
113
113
|
},
|
|
114
114
|
"dependencies": {
|
|
115
|
-
"@ai-sdk/mcp": "2.0.
|
|
115
|
+
"@ai-sdk/mcp": "2.0.63",
|
|
116
116
|
"@fastify/cors": "11.3.0",
|
|
117
117
|
"@fastify/helmet": "13.1.1",
|
|
118
|
-
"@intlayer/api": "9.5.
|
|
119
|
-
"@intlayer/cli": "9.5.
|
|
120
|
-
"@intlayer/config": "9.5.
|
|
121
|
-
"@intlayer/docs": "9.5.
|
|
122
|
-
"@intlayer/engine": "9.5.
|
|
123
|
-
"@intlayer/types": "9.5.
|
|
118
|
+
"@intlayer/api": "9.5.12",
|
|
119
|
+
"@intlayer/cli": "9.5.12",
|
|
120
|
+
"@intlayer/config": "9.5.12",
|
|
121
|
+
"@intlayer/docs": "9.5.12",
|
|
122
|
+
"@intlayer/engine": "9.5.12",
|
|
123
|
+
"@intlayer/types": "9.5.12",
|
|
124
124
|
"dotenv": "18.0.4",
|
|
125
125
|
"fastify": "5.12.5",
|
|
126
126
|
"zod": "4.6.5"
|
|
127
127
|
},
|
|
128
128
|
"devDependencies": {
|
|
129
|
-
"@intlayer/types": "9.5.
|
|
129
|
+
"@intlayer/types": "9.5.12",
|
|
130
130
|
"@types/node": "^22",
|
|
131
131
|
"@utils/ts-config": "1.0.4",
|
|
132
132
|
"@utils/ts-config-types": "1.0.4",
|