Skip to content

Commit f3e1469

Browse files
committed
feat: configurable timezone for docker in time server
Fixes #639 Add support for configurable timezone in Docker for `time` server. * Update `src/time/Dockerfile` to include `LOCAL_TIMEZONE` environment variable. * Set default timezone to "UTC" in `src/time/Dockerfile`. * Modify `ENTRYPOINT` in `src/time/Dockerfile` to include `--local-timezone` argument. * Update `src/time/README.md` to include instructions on setting the timezone using `LOCAL_TIMEZONE` environment variable. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/modelcontextprotocol/servers/issues/639?shareId=XXXX-XXXX-XXXX-XXXX).
1 parent e055e18 commit f3e1469

3 files changed

Lines changed: 6 additions & 22 deletions

File tree

src/time/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,8 @@ COPY --from=uv --chown=app:app /app/.venv /app/.venv
3232
# Place executables in the environment at the front of the path
3333
ENV PATH="/app/.venv/bin:$PATH"
3434

35-
# when running the container, add --db-path and a bind mount to the host's db file
36-
ENTRYPOINT ["mcp-server-time"]
35+
# Set the LOCAL_TIMEZONE environment variable
36+
ENV LOCAL_TIMEZONE=${LOCAL_TIMEZONE:-"UTC"}
37+
38+
# when running the container, add --local-timezone and a bind mount to the host's db file
39+
ENTRYPOINT ["mcp-server-time", "--local-timezone", "${LOCAL_TIMEZONE}"]

src/time/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Add to your Claude settings:
6161
"mcpServers": {
6262
"time": {
6363
"command": "docker",
64-
"args": ["run", "-i", "--rm", "mcp/time"]
64+
"args": ["run", "-i", "--rm", "-e", "LOCAL_TIMEZONE", "mcp/time"]
6565
}
6666
}
6767
```

src/time/src/mcp_server_time/__init__.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)