home / mcp / datetime mcp server
A MCP server for datetime formatting and file name generation.
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.
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.
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-datetimeOr 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 .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"
}
}
}
}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.
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.
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.
Fetches the current date and time in a variety of formats based on the requested format type