Provides current date and time with configurable formats and timezones.
English | 日本語 | README
A Model Context Protocol (MCP) server that provides tools to get the current date and time in various formats. This is a Python implementation of the datetime MCP server, demonstrating how to build MCP servers using the Python SDK.
get_current_time
Choose one of these examples based on your needs:
Basic usage (ISO format):
{ "mcpServers": { "datetime": { "command": "uvx", "args": ["takanarishimbo-datetime-mcp-server"] } } }
Human-readable format with timezone:
{ "mcpServers": { "datetime": { "command": "uvx", "args": ["takanarishimbo-datetime-mcp-server"], "env": { "DATETIME_FORMAT": "human", "TIMEZONE": "America/New_York" } } } }
Unix timestamp format:
{ "mcpServers": { "datetime": { "command": "uvx", "args": ["takanarishimbo-datetime-mcp-server"], "env": { "DATETIME_FORMAT": "unix", "TIMEZONE": "UTC" } } } }
Custom format:
{ "mcpServers": { "datetime": { "command": "uvx", "args": ["takanarishimbo-datetime-mcp-server"], "env": { "DATETIME_FORMAT": "custom", "DATE_FORMAT_STRING": "%Y/%m/%d %H:%M", "TIMEZONE": "Asia/Tokyo" } } } }
The server can be configured using environment variables:
DATETIME_FORMAT
Controls the default output format of the datetime (default: "iso")
Supported formats:
iso
: ISO 8601 format (2024-01-01T12:00:00.000000+00:00)unix
: Unix timestamp in secondsunix_ms
: Unix timestamp in millisecondshuman
: Human-readable format (Mon, Jan 1, 2024 12:00:00 PM UTC)date
: Date only (2024-01-01)time
: Time only (12:00:00)custom
: Custom format using DATE_FORMAT_STRING environment variableDATE_FORMAT_STRING
Custom date format string (only used when DATETIME_FORMAT="custom") Default: "%Y-%m-%d %H:%M:%S"
Uses Python's strftime format codes:
%Y
: 4-digit year%y
: 2-digit year%m
: 2-digit month%d
: 2-digit day%H
: 2-digit hour (24-hour)%M
: 2-digit minute%S
: 2-digit secondTIMEZONE
Timezone to use (default: "UTC") Examples: "UTC", "America/New_York", "Asia/Tokyo"
get_current_time
Get the current date and time
Parameters:
format
(optional): Output format, overrides DATETIME_FORMAT env vartimezone
(optional): Timezone to use, overrides TIMEZONE env varThis project uses PyPI's Trusted Publishers feature for secure, token-less publishing via GitHub Actions.
TakanariShimbo
(your GitHub username/org)uvx-datetime-mcp-server
pypi-publish.yml
pypi
(optional but recommended)pypi
The release script needs to push to GitHub, so you'll need a GitHub token:
repo
(Full control of private repositories)ghp_
)gh auth login
git config --global credential.helper store
Use the release script to automatically version, tag, and trigger publishing:
chmod +x scripts/release.sh
./scripts/release.sh patch
./scripts/release.sh minor
./scripts/release.sh major
./scripts/release.sh 1.2.3
pip show takanarishimbo-datetime-mcp-server
release.sh
script updates version in all filespip install
or uvx
This project uses ruff
for linting and formatting:
uv run ruff check
uv run ruff check --fix
uv run ruff format
uvx-datetime-mcp-server/
├── src/
│ ├── __init__.py # Package initialization
│ ├── __main__.py # Main entry point
│ └── server.py # Server implementation
├── pyproject.toml # Project configuration
├── uv.lock # Dependency lock file
├── .github/
│ └── workflows/
│ └── pypi-publish.yml # PyPI publish workflow with Trusted Publishers
├── scripts/
│ └── release.sh # Release automation script
├── docs/
│ ├── README.md # This file
│ └── README_ja.md # Japanese documentation
└── .gitignore # Git ignore file
MIT
Create spaced repetition flashcards in Rember to remember anything you learn in your chats
Converts Markdown to styled PDFs using VS Code's markdown styling and Python's ReportLab.
Exposes portfolio tracking tools for AI clients.
Interact with Quire.io projects and tasks using the Quire API, enabling AI assistants to manage your workflow.
Monitors system resources in real-time, including CPU, memory, disk, network, battery, and internet speed.
A simple note storage system with a custom note:// URI scheme, allowing users to add and summarize notes.
Python tools for MCP that integrate with native Apple applications like Messages, Notes, Mail, and more on macOS.
Fetch and summarize YouTube videos by extracting their titles, descriptions, and transcripts.
A suite of servers for intelligent travel planning, including flights, hotels, events, geocoding, weather, and finance.
Parses invoice data, uploads it to Google Sheets, and answers queries by fetching information from the sheet.