Skip to content

feat: HTTP transport env vars, Dockerfile defaults, compose service#32

Merged
tallpsmith merged 9 commits into
mainfrom
feat/005-http-transport
Mar 9, 2026
Merged

feat: HTTP transport env vars, Dockerfile defaults, compose service#32
tallpsmith merged 9 commits into
mainfrom
feat/005-http-transport

Conversation

@tallpsmith
Copy link
Copy Markdown
Owner

Summary

Closes #5.

  • HTTP transport CLI args existed but couldn't be configured via env vars
  • Dockerfile didn't expose port or default to HTTP mode
  • No pmmcp service in compose for end-to-end stack

Changes

  • ServerConfig in config.pypydantic-settings model with PMMCP_TRANSPORT, PMMCP_HOST, PMMCP_PORT env vars (precedence: CLI > env > default)
  • __main__.py — argparse defaults wired to ServerConfig; fixed latent bug where mcp.run() was passed host/port kwargs it doesn't accept (must use mcp.settings)
  • Healthcheck — handles pre-session state gracefully (returns 503 {"status": "starting"} instead of crashing when no MCP session has connected)
  • DockerfileEXPOSE 8080 + CMD defaults to --transport streamable-http --host 0.0.0.0 --port 8080
  • docker-compose.ymlpmmcp service on port 8080 wired to pcp backend with healthcheck
  • README — new "Running pmmcp" section with CLI flags table, env vars table, HTTP transport examples

Test plan

  • ServerConfig: defaults, env overrides, invalid transport rejected, constructor overrides env
  • __main__.py wiring: env var picked up as argparse default
  • Healthcheck pre-session state returns 503
  • Integration test: spawns subprocess in HTTP mode, hits /healthcheck, verifies 503 + JSON
  • All 467 tests pass, 89% coverage
  • Pre-push sanity clean
  • E2E not run (no PMPROXY_URL set)
  • Compose smoke test: podman compose up -d && curl localhost:8080/healthcheck

ServerConfig doesn't exist yet — these tests define the contract
for PMMCP_TRANSPORT, PMMCP_HOST, PMMCP_PORT env var configuration.
Env vars (PMMCP_TRANSPORT, PMMCP_HOST, PMMCP_PORT) can now configure
transport mode without CLI flags — needed for Dockerfile/compose.
CLI flags now fall back to PMMCP_TRANSPORT/HOST/PORT env vars via
ServerConfig, so Dockerfile/compose can configure transport without
CLI args.
Fix mcp.run() call — host/port must be set on mcp.settings, not
passed to run(). Healthcheck now handles pre-session state (returns
503 "starting" when no MCP session has connected yet in HTTP mode).
Container now defaults to streamable-http on 0.0.0.0:8080 so it
works out of the box with compose and k8s without extra args.
Full stack now includes pmmcp on port 8080 with healthcheck,
connected to pmproxy via internal compose network.
Replaces inline --timeout hint with full reference table covering
all CLI flags, env vars, and HTTP transport examples.
"Starting" (no MCP session yet) is not unhealthy — the HTTP transport
is up and ready. Returning 200 lets compose --wait pass correctly.

Also: just e2e now uses --wait to match CI, pre-push-sanity always
runs e2e instead of silently skipping when PMPROXY_URL is unset.
@tallpsmith tallpsmith merged commit e05c566 into main Mar 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: HTTP/SSE transport support for shared team deployments

1 participant