Add Streamable HTTP transport, bearer auth, and Docker deployment

- Enable stateless_http + json_response on FastMCP for scalable HTTP
  serving without sticky sessions (Traefik-friendly)
- Add MCP_TRANSPORT env var to select stdio (default) vs streamable-http
- Add bearer token auth middleware (MCP_AUTH_TOKEN) with /health bypass
- Add Dockerfile (Python 3.12-slim + uv) and docker-compose.yml with
  Traefik v2/v3 labels, ACME TLS, and health check routing
- Add .env.example with multi-instance config for mini/tn-sb/tn-mr2/p-mba
- Add uvicorn + starlette as runtime dependencies

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
PiersandClaude Opus 4.6 committed 2026-02-15 03:54:43 +00:00
1 parent 3a33d34bd1
commit 5ca58735eb
8 files changed
+175 -3

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
FROM python:3.12-slim AS base
WORKDIR /app
# Install uv for fast dependency resolution.
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Copy project metadata first for layer caching.
COPY pyproject.toml ./
COPY src/ src/
# Install the package and all runtime dependencies.
RUN uv pip install --system --no-cache .
# Default to streamable-http transport in container.
ENV MCP_TRANSPORT=streamable-http
ENV MCP_HOST=0.0.0.0
ENV MCP_PORT=8000
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD ["python", "-c", "import httpx; httpx.get('http://localhost:8000/health').raise_for_status()"]
ENTRYPOINT ["syncthing-mcp"]