home / mcp / datetime mcp server

Datetime MCP Server

A MCP server for datetime formatting and file name generation.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "zeparhyfar-mcp-datetime": {
      "command": "uvx",
      "args": [
        "mcp-datetime"
      ],
      "env": {
        "PYTHON": "/usr/local/bin/python3"
      }
    }
  }
}

You run a datetime formatting service as an MCP server, allowing Claude Desktop to request current dates and times in multiple formats. It supports standard, Japanese, ISO, and filename-friendly formats, with careful timezone handling and options optimized for file naming.

How to use

You connect to the MCP server from your MCP client by registering it under your Claude Desktop configuration. The server exposes a single tool you can invoke to obtain the current date and time in a variety of formats. Use the tool to generate timestamps for filenames, logs, or UI displays.

How to install

Prerequisites you need to have installed on your system before running this MCP server are Python 3.12 or later and the Python tooling used to manage packages and run the server.

Install the MCP server via one of the supported approaches shown below. Choose the option that matches your environment.

pip install mcp-datetime

Or install from source and enable editable install so you can develop or inspect the code.

git clone https://github.com/zeparhyfar/mcp-datetime.git
cd mcp-datetime
pip install -e .

Additional configuration and examples

Configure Claude Desktop to start the MCP server locally. You’ll run the Python module as a stdio-based MCP server. Two example configurations are shown below. Use one of them depending on whether you prefer running through uvx or directly via Python.

{
  "mcpServers": {
    "mcp_datetime_uvx": {
      "command": "uvx",
      "args": ["mcp-datetime"]
    }
  }
}
{
  "mcpServers": {
    "mcp_datetime_python": {
      "command": "python",
      "args": ["-m", "mcp_datetime"],
      "env": {
        "PYTHON": "/path/to/your/python"
      }
    }
  }
}

Tools and how to call them

This server implements one tool named get_datetime. You call it to obtain the current date and time in a specified format. The tool requires a format argument and returns the formatted datetime string.

Supported formats to request

Choose from a variety of formats to tailor the output for your needs, including standard date/time, Japanese formats, ISO forms, compact IDs, and filename-friendly styles.

Notes on usage and troubleshooting

The server is designed to work smoothly with Claude Desktop. If you encounter issues, verify that Python 3.12+ is installed, and that you’ve started the correct stdio server command from your Claude config. For debugging, you can run the server locally and test the tool invocation in your MCP client.

Available tools

get_datetime

Fetches the current date and time in a variety of formats based on the requested format type