diff --git a/src/time/Dockerfile b/src/time/Dockerfile index bd62ea84..9a1ed2af 100644 --- a/src/time/Dockerfile +++ b/src/time/Dockerfile @@ -32,5 +32,8 @@ COPY --from=uv --chown=app:app /app/.venv /app/.venv # Place executables in the environment at the front of the path ENV PATH="/app/.venv/bin:$PATH" -# when running the container, add --db-path and a bind mount to the host's db file -ENTRYPOINT ["mcp-server-time"] +# Set the LOCAL_TIMEZONE environment variable +ENV LOCAL_TIMEZONE=${LOCAL_TIMEZONE:-"UTC"} + +# when running the container, add --local-timezone and a bind mount to the host's db file +ENTRYPOINT ["mcp-server-time", "--local-timezone", "${LOCAL_TIMEZONE}"] diff --git a/src/time/README.md b/src/time/README.md index eed504bb..6f7e4fec 100644 --- a/src/time/README.md +++ b/src/time/README.md @@ -61,7 +61,7 @@ Add to your Claude settings: "mcpServers": { "time": { "command": "docker", - "args": ["run", "-i", "--rm", "mcp/time"] + "args": ["run", "-i", "--rm", "-e", "LOCAL_TIMEZONE", "mcp/time"] } } ``` diff --git a/src/time/src/mcp_server_time/__init__.py b/src/time/src/mcp_server_time/__init__.py deleted file mode 100644 index cce7ccc9..00000000 --- a/src/time/src/mcp_server_time/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -from .server import serve - - -def main(): - """MCP Time Server - Time and timezone conversion functionality for MCP""" - import argparse - import asyncio - - parser = argparse.ArgumentParser( - description="give a model the ability to handle time queries and timezone conversions" - ) - parser.add_argument("--local-timezone", type=str, help="Override local timezone") - - args = parser.parse_args() - asyncio.run(serve(args.local_timezone)) - - -if __name__ == "__main__": - main()