Skip to main content
Glama
Simple DateTime MCP Server

Simple DateTime MCP Server

by solverio-pl
README.md
# Simple DateTime MCP Server

Fast and simple MCP server for date/time operations with optional NTP support.

## Features

- **Lightning Fast**: Uses server time by default for instant responses
- **Optional NTP**: High-precision time from global NTP servers when needed
- **Timezone Support**: Any IANA timezone (America/New_York, Europe/Warsaw, Asia/Tokyo, etc.)
- **Flexible Formatting**: Custom format strings or locale-based formatting
- **Automatic Fallback**: Falls back to server time if NTP times out

## Installation

```bash
npx -y @solverio-pl/simple-datetime-mcp@latest
```

## Configuration

Add to your Claude desktop config (`C:\Users\[username]\AppData\Roaming\Claude\claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "simple-datetime": {
      "command": "npx",
      "args": ["-y", "@solverio-pl/simple-datetime-mcp@latest"]
    }
  }
}
```

## Usage

### Basic Usage (Fast Server Time)

Ask Claude: "What time is it in New York?"

Claude will use: `getDateTime({ timezone: "America/New_York" })`

### Custom Format String

Ask Claude: "Show me the current date in Warsaw as YYYY-MM-DD HH:mm:ss"

Claude will use: `getDateTime({ timezone: "Europe/Warsaw", format: "YYYY-MM-DD HH:mm:ss" })`

### Using NTP for High Precision

Ask Claude: "Get exact time from NTP servers in Tokyo"

Claude will use: `getDateTime({ timezone: "Asia/Tokyo", useNTP: true })`

### Locale-Based Formatting

Ask Claude: "Show me Polish formatted time in Warsaw"

Claude will use: `getDateTime({ timezone: "Europe/Warsaw", locale: "pl-PL" })`

## Parameters

### getDateTime

- **timezone** (required): IANA timezone name
  - Examples: `America/New_York`, `Europe/Warsaw`, `Asia/Tokyo`, `UTC`
  
- **format** (optional): Custom format string
  - `YYYY` - 4-digit year (2025)
  - `YY` - 2-digit year (25)
  - `MM` - 2-digit month (01-12)
  - `M` - Month without leading zero (1-12)
  - `DD` - 2-digit day (01-31)
  - `D` - Day without leading zero (1-31)
  - `HH` - 24-hour format (00-23)
  - `H` - 24-hour without leading zero (0-23)
  - `hh` - 12-hour format (01-12)
  - `h` - 12-hour without leading zero (1-12)
  - `mm` - Minutes (00-59)
  - `m` - Minutes without leading zero (0-59)
  - `ss` - Seconds (00-59)
  - `s` - Seconds without leading zero (0-59)
  - `SSS` - Milliseconds (000-999)
  - `A` - AM/PM uppercase
  - `a` - am/pm lowercase

- **locale** (optional): Locale string (default: `en-US`)
  - Examples: `en-US`, `pl-PL`, `de-DE`, `ja-JP`
  - Only used when format string is not provided

- **useNTP** (optional): Use NTP servers (default: `false`)
  - `false` - Fast server time (instant response)
  - `true` - High-precision NTP time (may add latency)

- **ntpTimeout** (optional): NTP timeout in milliseconds (default: `1000`)
  - Server time used as fallback if timeout exceeded

## Format Examples

| Format String | Example Output |
|--------------|----------------|
| `YYYY-MM-DD` | 2025-10-04 |
| `HH:mm:ss` | 14:30:45 |
| `YYYY-MM-DD HH:mm:ss` | 2025-10-04 14:30:45 |
| `DD/MM/YYYY hh:mm A` | 04/10/2025 02:30 PM |
| `M/D/YY h:mm a` | 10/4/25 2:30 pm |

## Development

```bash
# Install dependencies
npm install

# Build
npm run build

# Test locally
npm run start

# Watch mode
npm run dev
```

## Publishing

```bash
npm run build
npm publish --otp=<your-2fa-code>
```

## Performance

- **Server Time Mode**: < 1ms response time
- **NTP Mode**: ~50-200ms (depends on network)
- **Fallback**: Automatic on NTP timeout

## License

MIT © Solverio Janusz Chalimoniuk

TDQS

A3.7/5.0

Scored across 1 tool

Disambiguation5/5

There is only one tool, so there is no possibility of confusion or misselection. Its purpose—returning the current date/time for a given timezone—is unambiguous.

Naming Consistency4/5

The single tool uses a clear camelCase verb_noun-style name (getDateTime), which is readable and appropriate. With only one tool there is no broader pattern to verify, so it cannot earn a perfect consistency score.

Tool Count3/5

A single tool is borderline thin even for a deliberately 'simple' server; one more operation (e.g. timezone conversion or formatting) would make the surface feel complete. It is at least well-scoped with no bloat.

Completeness3/5

Fetching the current time with optional NTP and timezone support covers the core operation, but typical datetime needs—timestamp parsing, timezone conversion, duration/arithmetic, or custom formatting—are absent, creating dead ends for agents.

Maintenance

ActivityInactive
ResponsivenessOutdated data