feat: add /health endpoint bypassing transport security
All checks were successful
Build and Push Proxmox MCP Docker Image / build (push) Successful in 32s

- Migrate from SSE to HTTP transport using fastmcp>=2.0
- Add /health endpoint for Docker health checks and load balancers
- Remove MCP_ALLOWED_HOSTS (no longer needed with http_app approach)
- Add lifespan handler for proper task group initialization
- Install curl in Docker image for health checks
- Update Makefile with test-health and test-mcp targets
- Update documentation to reflect new endpoint structure

Fixes: Health check fails with 421 Misdirected Request when
MCP_ALLOWED_HOSTS doesn't include localhost
This commit is contained in:
Ben
2025-12-20 23:17:55 +00:00
parent 4b576d40ad
commit 18a8c2e59f
6 changed files with 73 additions and 33 deletions

View File

@@ -2,13 +2,15 @@ services:
proxmox-mcp:
image: gitea.ext.ben.io/b3nw/proxmox-mcp-custom:latest
container_name: proxmox-mcp
environment:
# --- MCP Transport Security ---
# Allowed Host headers (comma-separated, supports :* for wildcard ports)
- MCP_ALLOWED_HOSTS=proxmox-mcp.example.io,localhost:*,127.0.0.1:*
volumes:
# Mount your clusters.json configuration file
- ./clusters.json:/app/clusters.json:ro
ports:
- "8000:8000"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
restart: unless-stopped