Targets Portainer 2.42.x. First build to ship a container image alongside
the PyPI wheel, and the first release with a bearer-gated HTTP transport.
Added
- Container image at
docker.io/portainer/portainer-mcp, published
on every X.Y.Z tag push from
.github/workflows/release-docker.yml.
Tagged X.Y.Z and X.Y per release; no latest. See
docs/docker.md.
- HTTP bearer auth. New
PORTAINER_MCP_AUTH_TOKEN env, required
when PORTAINER_MCP_TRANSPORT=http and ignored for stdio. Strict
validation at startup (min 32 chars, ASCII printable, no whitespace —
loud-fail on any defect); constant-time comparison via
hmac.compare_digest; masked fingerprint in the startup log, full
value never logged. Wired through FastMCP's TokenVerifier protocol —
FastMCP renders the 401 + WWW-Authenticate response on failure.
- DNS-rebinding allowlist for the HTTP transport.
PORTAINER_MCP_ALLOWED_HOSTS (default 127.0.0.1:*,localhost:*,[::1]:*)
validates the Host header on every request; mismatches return 421
with a body that names the env var. The Origin allowlist is hardcoded
to localhost — programmatic MCP clients omit Origin and pass through.
A startup WARNING fires when the bind host is non-loopback while the
allowlist is still the localhost defaults, so the
"deployed-then-it-421s" case self-diagnoses. …