feat: replace StdioTransport with StreamableHTTP + Node.js cluster
Integrates StreamableHTTP natively into the MCP server instead of using StdioServerTransport. Adds Node.js cluster support so multiple workers can handle concurrent MCP clients simultaneously. Changes: - src/index.ts: replace StdioServerTransport with StreamableHTTPServerTransport + Node.js cluster (primary forks N workers, each worker handles HTTP requests on :8080/mcp with a serializing mutex) - Dockerfile: multi-stage build (node:22-slim builder + runtime) - .gitea/workflows/docker-build.yml: CI/CD pipeline — on push to main, builds and pushes Docker image to gitea.p-lao.com registry Environment variables: - MCP_WORKERS (default: 4) — number of cluster workers Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
15
Dockerfile
Normal file
15
Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM node:22-slim AS builder
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM node:22-slim
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/build ./build
|
||||
COPY package*.json ./
|
||||
RUN npm ci --omit=dev
|
||||
ENV MCP_WORKERS=4
|
||||
EXPOSE 8080
|
||||
CMD ["node", "build/index.js"]
|
||||
Reference in New Issue
Block a user