Skip to main content
Glama
DSado88

DateTime MCP Server

by DSado88
README.md
# DateTime MCP Server

A simple MCP server that provides accurate date and time information to Claude Code and Claude Desktop.

This server ensures Claude always uses the correct current date and time when creating documents, logs, or any time-sensitive content.

## Features

### Tools

- `get_current_datetime` - Get the current date and time
  - Supports multiple formats: ISO 8601, Unix timestamp, human-readable, or custom format
  - Optional timezone parameter
  
- `get_current_date` - Get only the current date
  - Formats: ISO (YYYY-MM-DD), US (MM/DD/YYYY), EU (DD/MM/YYYY), or custom
  
- `get_current_time` - Get only the current time
  - Formats: 24-hour (HH:MM:SS), 12-hour (hh:MM:SS AM/PM), or custom
  - Optional seconds display

### Custom Format Support

Use format strings with these placeholders:
- `YYYY` - 4-digit year
- `MM` - 2-digit month
- `DD` - 2-digit day
- `HH` - 2-digit hour (24-hour)
- `mm` - 2-digit minutes
- `ss` - 2-digit seconds

Example: `"YYYY-MM-DD HH:mm"` → `"2025-07-31 14:30"`

## Development

Install dependencies:
```bash
npm install
```

Build the server:
```bash
npm run build
```

For development with auto-rebuild:
```bash
npm run watch
```

## Installation

### For Claude Desktop

The server config was automatically added during setup. To verify:

On MacOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
On Windows: `%APPDATA%/Claude/claude_desktop_config.json`

```json
{
  "mcpServers": {
    "DateTime MCP Server": {
      "command": "node",
      "args": [
        "/path/to/your/datetime-mcp/build/index.js"
      ]
    }
  }
}
```

### For Claude Code CLI

Add the server to Claude Code:

```bash
# Add the server
claude mcp add datetime-server node /path/to/your/datetime-mcp/build/index.js

# Verify it's loaded
claude mcp list

# View server details
claude mcp get datetime-server
```

To remove the server:
```bash
claude mcp remove datetime-server
```

### Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector), which is available as a package script:

```bash
npm run inspector
```

The Inspector will provide a URL to access debugging tools in your browser.

TDQS

B3.4/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: get_current_date returns only the date, get_current_datetime returns both date and time, and get_current_time returns only the time. There is no overlap or ambiguity between these three operations.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with 'get_current_' prefix, using snake_case uniformly. This makes the naming predictable and easy to understand.

Tool Count3/5

With only 3 tools, the server feels somewhat thin for a datetime domain, as it lacks operations like date/time parsing, formatting, arithmetic, or timezone handling. However, the tools cover basic current datetime retrieval adequately.

Completeness2/5

The toolset is severely incomplete for a datetime server, missing essential operations such as date/time manipulation, conversion between formats or timezones, parsing strings, or calculating differences. This will limit agents to only retrieving current values without any processing capabilities.

Maintenance

ActivityInactive
ResponsivenessNo issues