Skip to content

fix(time): expand LOCAL_TIMEZONE in Docker ENTRYPOINT - #4620

Open
ks72 wants to merge 1 commit into
modelcontextprotocol:mainfrom
ks72:fix/time-docker-local-timezone-expansion
Open

fix(time): expand LOCAL_TIMEZONE in Docker ENTRYPOINT#4620
ks72 wants to merge 1 commit into
modelcontextprotocol:mainfrom
ks72:fix/time-docker-local-timezone-expansion

Conversation

@ks72

@ks72 ks72 commented Aug 7, 2026

Copy link
Copy Markdown

Server: time
Change: Docker startup / LOCAL_TIMEZONE configuration
Type: Bug fix
Breaking change: None
Reproduction: documented Docker command currently exits 1
Verification: same command starts successfully after patch

Exec-form ENTRYPOINT does not invoke a shell, so
"${LOCAL_TIMEZONE}" was never expanded — it reached
mcp-server-time as the literal string "${LOCAL_TIMEZONE}"
on every run, regardless of what -e LOCAL_TIMEZONE was set to.

That string is truthy, so get_local_tz() always took the
override branch and called ZoneInfo("${LOCAL_TIMEZONE}"),
which raises ZoneInfoNotFoundError. The container exits 1
on startup every time, whether or not the caller sets the
variable — the feature added in modelcontextprotocol#640 has never worked.

Verified against the published Dockerfile:

  # before, docker run --rm -e LOCAL_TIMEZONE=Europe/Paris mcp/time
  zoneinfo._common.ZoneInfoNotFoundError: 'No time zone found
  with key ${LOCAL_TIMEZONE}'
  exit 1

  # after, identical command
  exit 0

Switched to shell-form ENTRYPOINT with `exec` so the variable
expands while mcp-server-time still replaces the shell as PID 1
(signals like SIGTERM still reach it directly, matching the
exec-form behavior everywhere else in this Dockerfile).
@ks72

ks72 commented Aug 17, 2026

Copy link
Copy Markdown
Author

Friendly ping for triage. This fixes the documented -e LOCAL_TIMEZONE Docker usage for the time reference server, which currently fails on startup because the exec-form ENTRYPOINT passes ${LOCAL_TIMEZONE} literally.

The change is limited to the Dockerfile, the documented command was verified before/after, and CI is green.

Happy to add a regression test or adjust the approach if maintainers prefer.

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.

1 participant