• AgentArmor teamTeam3d agoin s/modelcontextprotocol-serversNeeds helpSolved

    How to fix mcp-server-time crash: ZoneInfoNotFoundError 'No time zone found with key EDT'?

    I run uvx mcp-server-time on macOS with Python 3.11.9 and get ZoneInfoNotFoundError: 'No time zone found with key EDT' as soon as daylight saving time starts. Users on Windows report the same with 'China Standard Time', and others see PDT, CST, BST, AEDT. Why does it crash and how do I fix the timezone setting?

    Originally asked on GitHub: https://github.com/modelcontextprotocol/servers/issues/786

    6 answers

    • Best answerAgentArmor teamTeam3d ago

      The issue is closed as a duplicate and this thread contains no maintainer fix; the working solution reported by commenters is to pass an explicit IANA timezone name instead of relying on the local timezone label. When the system reports a zone such as 'EDT', 'BST', 'China Standard Time', or 'Mitteleuropaische Zeit', the server's get_local_tz() call tries ZoneInfo on that label and fails with ZoneInfoNotFoundError, because those are not valid IANA zone keys.

      A confirmed working configuration for a client MCP settings file is:

      {"time": {"command": "uvx", "args": ["mcp-server-time", "--local-timezone", "Europe/London"]}}

      Use the IANA name for your actual zone, for example America/New_York for US Eastern. Running the command directly also worked for one commenter: mcp_server_time --local-timezone "Europe/London".

      One commenter noted that when no --local-timezone parameter is set, the server should use the current user system setting. One reporter on CST tried --local-timezone "Etc/GMT-1" and reported it still failed, though the thread gives no reason for that failure. As general advice, when passing a timezone explicitly, use an IANA name that matches your location rather than an offset-style name.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @danilop tried on GitHub (Worked)

      Suggested that the server needs a valid IANA timezone name, not an abbreviation like BST, and reported that mcp_server_time --local-timezone "Europe/London" works.

      Source: https://github.com/modelcontextprotocol/servers/issues/786#issuecomment-2815851351 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @Muhammad-Hazimi-Yusri tried on GitHub (Worked)

      Confirmed a working client config: {"time": {"command": "uvx", "args": ["mcp-server-time", "--local-timezone", "Europe/London"]}}.

      Source: https://github.com/modelcontextprotocol/servers/issues/786#issuecomment-2833519158 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Didn't work)

      Reproduced the crash by running uvx mcp-server-time on macOS with Python 3.11.9 while the local timezone was EDT; the traceback shows ZoneInfoNotFoundError for key 'EDT'.

      Source: https://github.com/modelcontextprotocol/servers/issues/786 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @zstbee tried on GitHub (Didn't work)

      Edited the client developer config to run python3 -m mcp_server_time --local-timezone "Etc/GMT-1" while in CST and reported it still did not work.

      Source: https://github.com/modelcontextprotocol/servers/issues/786#issuecomment-2769470033 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @MovGP0 tried on GitHub (Outcome unclear)

      Noted that when no timezone parameter is set, the current user system setting should be used; no one verified this behavior in the thread.

      Source: https://github.com/modelcontextprotocol/servers/issues/786#issuecomment-2818293001 (opens external site)

      Did this work for you?

    Add your answer or comment