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:
1 parent
3a33d34bd1
commit
5ca58735eb
8 files changed
+175
-3
No files matched your search
@@ -0,0 +1,37 @@
|
||||
---
|
||||
# Syncthing MCP — Streamable HTTP deployment behind Traefik
|
||||
#
|
||||
# Deploy on tn-sb (or any Docker host with Traefik already running).
|
||||
# Copy .env.example to .env and fill in API keys before starting.
|
||||
|
||||
services:
|
||||
syncthing-mcp:
|
||||
build: .
|
||||
container_name: syncthing-mcp
|
||||
restart: unless-stopped
|
||||
env_file: .env
|
||||
environment:
|
||||
MCP_TRANSPORT: streamable-http
|
||||
MCP_HOST: "0.0.0.0"
|
||||
MCP_PORT: "8000"
|
||||
# MCP_AUTH_TOKEN is set in .env
|
||||
# SYNCTHING_INSTANCES is set in .env
|
||||
expose:
|
||||
- "8000"
|
||||
networks:
|
||||
- traefik
|
||||
labels:
|
||||
# --- Traefik v2 / v3 labels ---
|
||||
traefik.enable: "true"
|
||||
traefik.http.routers.syncthing-mcp.rule: Host(`syncthing-mcp.${DOMAIN:?set DOMAIN in .env}`)
|
||||
traefik.http.routers.syncthing-mcp.entrypoints: websecure
|
||||
traefik.http.routers.syncthing-mcp.tls.certresolver: letsencrypt
|
||||
traefik.http.services.syncthing-mcp.loadbalancer.server.port: "8000"
|
||||
|
||||
# Health check route (Traefik can use this for backends).
|
||||
traefik.http.services.syncthing-mcp.loadbalancer.healthcheck.path: /health
|
||||
traefik.http.services.syncthing-mcp.loadbalancer.healthcheck.interval: 30s
|
||||
|
||||
networks:
|
||||
traefik:
|
||||
external: true
|
||||
Reference in new issue
Block a user