mcpField
M
MCPTimeServer

MCPTimeServer

Local
github.com/mekanixmsOther0Updated 92w ago

About MCPTimeServer

MCPTimeServer is an MCP server for retrieving the current time in a configured timezone. It gets time from NTP servers and supports timezone settings through an environment variable.

Key features

  1. 01Fetches current time via NTP
  2. 02Configures timezone through an environment variable
  3. 03Falls back to UTC for invalid timezones
  4. 04Handles network errors

Use cases

  1. 01Check the current time in a chosen timezone
  2. 02Call a time tool from Claude Desktop

MCP support

It exposes a `get_current_time` tool to MCP clients, returning the date and time in the configured timezone.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MCP Time Server

A Model Context Protocol (MCP) server that provides current time from internet time servers with timezone support.

Features

  • Fetches accurate time from NTP servers (pool.ntp.org)
  • Supports custom timezone configuration via environment variable
  • Graceful error handling for network issues and invalid timezones
  • Compatible with Claude Desktop

Installation

  1. Install the required dependencies:
pip install mcp ntplib pytz
  1. Install the server in Claude Desktop with your preferred timezone:
mcp install timeserver.py -e TIMEZONE=America/New_York

Locate the claude_desktop_config.json and add (or change as mcp command generates it) to "mcpServers" the "Time Server":

{
  "mcpServers": {
    "Time Server": {
      "command": "/path/to/python",
      "args": [
        "/path/to/timeserver.py"
      ],
      "env": {
        "TIMEZONE": "America/New_York"
      }
    }
  }
}

You can set any valid timezone name from the IANA Time Zone Database. Some common examples:

  • 'America/New_York'
  • 'Europe/London'
  • 'Asia/Tokyo'
  • 'US/Pacific'
  • 'UTC' (default if no timezone is specified)

Usage

Once installed, you can ask Claude to use the get_current_time tool to fetch and display the current time in your configured timezone. The tool will:

  • Connect to pool.ntp.org to get the accurate current time
  • Convert the time to your specified timezone (or UTC if none specified)
  • Return a formatted string with the current date, time, and timezone

Error Handling

The server handles several types of errors gracefully:

  • Network connectivity issues when reaching the NTP server
  • Invalid timezone specifications (falls back to UTC)
  • General exceptions with informative error messages

Dependencies

  • mcp: Model Context Protocol SDK
  • ntplib: NTP client library
  • pytz: Timezone database and utilities

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.