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:
52
.gitea/workflows/docker-build.yml
Normal file
52
.gitea/workflows/docker-build.yml
Normal file
@@ -0,0 +1,52 @@
|
||||
name: Docker Build & Push
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
env:
|
||||
REGISTRY: gitea.p-lao.com
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
if: gitea.ref == 'refs/heads/main'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
github-server-url: https://gitea.p-lao.com
|
||||
token: ${{ secrets.TOKEN_GITEA }}
|
||||
|
||||
- name: Get version
|
||||
id: get_version
|
||||
run: |
|
||||
VERSION=$(node -p "require('./package.json').version")
|
||||
if [ "$VERSION" != "" ]; then
|
||||
echo "version=$VERSION" >> $GITEA_ENV
|
||||
else
|
||||
echo "Version not found in package.json"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Gitea Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
gitea.p-lao.com/aleleba/docmost-mcp:${{ env.version }}
|
||||
gitea.p-lao.com/aleleba/docmost-mcp:latest
|
||||
Reference in New Issue
Block a user