Overview
What is MCPTimeServer?
MCPTimeServer is a Model Context Protocol (MCP) server that fetches accurate current time from internet NTP servers (pool.ntp.org) and supports custom timezone configuration via environment variable. It is designed for use with Claude Desktop and other MCP-compatible clients.
How to use MCPTimeServer?
Install dependencies with pip install mcp ntplib pytz, then register the server with your preferred timezone using mcp install timeserver.py -e TIMEZONE=America/New_York or by adding it to claude_desktop_config.json. Once installed, ask Claude to use the get_current_time tool to display the current time in your configured timezone.
Key features of MCPTimeServer
- Fetches accurate time from NTP servers (pool.ntp.org)
- Supports custom timezone via TIMEZONE environment variable
- Graceful error handling for network issues
- Graceful handling of invalid timezones (falls back to UTC)
- Compatible with Claude Desktop
Use cases of MCPTimeServer
- Displaying the current time in a specific timezone within Claude Desktop conversations
- Fetching accurate internet time without relying on local system clock settings
- Automating time-aware tasks that require a reliable, timezone-correct timestamp
FAQ from MCPTimeServer
What time source does MCPTimeServer use?
MCPTimeServer connects to pool.ntp.org to get accurate current time and converts it to your specified timezone (or UTC if none is specified).
How do I configure a timezone?
Set the TIMEZONE environment variable during installation (e.g., TIMEZONE=America/New_York) or in the claude_desktop_config.json env block. Any valid IANA Time Zone Database name is accepted.
What happens if I specify an invalid timezone?
The server falls back to UTC and returns the time without timezone conversion, along with an informative error message.
What dependencies does MCPTimeServer require?
Python packages mcp (Model Context Protocol SDK), ntplib (NTP client library), and pytz (timezone database).