Skip to content

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

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

ks72 wants to merge 1 commit into
modelcontextprotocol:v2/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

@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.

@changeset-bot

changeset-bot Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 024c9e8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ks72
ks72 changed the base branch from main to v2/main October 14, 2026 15:01
@ks72
ks72 force-pushed the fix/time-docker-local-timezone-expansion branch from 63580f4 to d74f9a0 Compare October 14, 2026 15:01
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).

Signed-off-by: ks72 <20420826+ks72@users.noreply.github.com>
@ks72
ks72 force-pushed the fix/time-docker-local-timezone-expansion branch from d74f9a0 to 024c9e8 Compare October 14, 2026 15:06
@cliffhall cliffhall added the closed-superseded-v2 Closed: fixed or made obsolete by the v2 / 2026-07-28 refactor (#4875) label Oct 20, 2026
@cliffhall

Copy link
Copy Markdown
Member

Thank you for this pull request, and apologies for the long wait for a response.

Since it was opened, the reference servers have been rebuilt for the 2026-07-28 MCP specification (#4857) and released as v2, so this diff no longer applies to the code as it stands. This repository also now accepts issues, not pull requests, from anyone but its maintainers: design and implementation are done by the maintainers through a prompt-driven workflow, so outside PRs are closed rather than reviewed. The policy is in CONTRIBUTING.md.

This is not a judgment on the change or on you. The problem it addresses still applies to v2 and is tracked in #5182, which links back to this PR as a prototype and credits you. Please add anything further there.

This is part of the backlog triage in #4875.

@cliffhall cliffhall closed this Oct 20, 2026
@cliffhall cliffhall mentioned this pull request Oct 20, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

closed-superseded-v2 Closed: fixed or made obsolete by the v2 / 2026-07-28 refactor (#4875)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants