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:
2026-05-31 03:15:12 +00:00
parent a8b40641ac
commit 007c676ff2
3 changed files with 121 additions and 4 deletions

15
Dockerfile Normal file
View 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"]