nx-mcp-server 1.0.1 → 1.0.3

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/.dockerignore ADDED
@@ -0,0 +1,5 @@
1
+ node_modules
2
+ output
3
+ .git
4
+ .claude
5
+ *.md
package/Dockerfile ADDED
@@ -0,0 +1,19 @@
1
+ FROM node:18-alpine
2
+
3
+ WORKDIR /app
4
+
5
+ COPY package*.json ./
6
+ RUN npm ci --omit=dev
7
+
8
+ COPY src/ ./src/
9
+ COPY config.json ./
10
+
11
+ ENV MCP_TRANSPORT=http
12
+ ENV MCP_PORT=3000
13
+
14
+ EXPOSE 3000
15
+
16
+ HEALTHCHECK --interval=30s --timeout=3s \
17
+ CMD wget -qO- http://localhost:3000/health || exit 1
18
+
19
+ CMD ["node", "src/index.js"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx-mcp-server",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "图像生成 MCP Server — 智能生图(万相API) + 本地图形工具集",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/index.js CHANGED
@@ -1,6 +1,7 @@
1
+ #!/usr/bin/env node
1
2
  import {Server} from '@modelcontextprotocol/sdk/server/index.js';
2
3
  import {StdioServerTransport} from '@modelcontextprotocol/sdk/server/stdio.js';
3
- import {CallToolRequestSchema, ListToolsRequestSchema} from '@modelcontextprotocol/sdk/types.js';
4
+ import {CallToolRequestSchema, ListToolsRequestSchema, isInitializeRequest} from '@modelcontextprotocol/sdk/types.js';
4
5
  import {generateSmart} from './tools/smart.js';
5
6
  import {generateBasic} from './tools/basic.js';
6
7
  import {generateQrcode} from './tools/qrcode.js';
@@ -259,7 +260,7 @@ async function startHttp(){
259
260
 
260
261
  if(sessionId&&transports[sessionId]){
261
262
  transport=transports[sessionId];
262
- }else if(!sessionId){
263
+ }else if(!sessionId&&isInitializeRequest(req.body)){
263
264
  // 新会话初始化
264
265
  const eventStore={
265
266
  events:[],