Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.

MCPCurrentTime

A python Model Context Protocol (MCP) server that provides a simple and reliable way to get the current time in any timezone with customizable formatting.

Overview

MCPCurrentTime is an MCP server that wraps a time utility tool, allowing AI assistants and other MCP clients to retrieve the current time in various timezones and formats. This is particularly useful for applications that need timezone-aware time information or want to display time in user-friendly formats.

The server is based on the python mcp package.

Features

  • Timezone Support: Get current time in any timezone supported by the pytz library
  • Flexible Formatting: Customize time output using Python's strftime directives
  • Error Handling: Robust error handling for invalid timezones and format strings
  • Simple Integration: Easy to integrate with any MCP-compatible application

Installation

Prerequisites

  • Python 3.7+

  • Required packages:

    • mcp
    • pytz
  • install with

pip install MCPCurrentTime

Usage

Running the Server

You can run the MCP server in several ways:

Command Line, with stdio transport

python MCPCurrentTime.py

As a Module

from MCPCurrentTime import MCPCurrentTime

server = MCPCurrentTime()
server.run_server()

Custom Transport

from MCPCurrentTime import MCPCurrentTime

server = MCPCurrentTime()
# Run with custom MCP arguments
server.run_server({"transport": "stdio"})

Tool Usage

The server provides a single tool called get_time with the following parameters:

Parameters

  • time_format (optional, default: "%Y%m%d%H%M%S"): The format string for time output
  • timezone (optional, default: "UTC"): The timezone to get the current time for

Time Format Examples

The time_format parameter uses Python's strftime directives:

  • "%Y-%m-%d %H:%M:%S" → "2025-06-30 14:30:45"
  • "%Y%m%d%H%M%S" → "20250630143045" (default)
  • "%B %d, %Y at %I:%M %p" → "June 30, 2025 at 02:30 PM"
  • "%A, %B %d, %Y" → "Monday, June 30, 2025"

Timezone Examples

The timezone parameter accepts any timezone from the pytz library:

  • "UTC" (default)
  • "America/New_York"
  • "Europe/London"
  • "Asia/Tokyo"
  • "Australia/Sydney"
  • "America/Los_Angeles"

Example Calls

# Get current time in default format and UTC
await get_time()
# Returns: "20250630-143045"

# Get current time in New York with custom format
await get_time(time_format="%Y-%m-%d %H:%M:%S", timezone="America/New_York")
# Returns: "2025-06-30 10:30:45"

# Get current date only in Tokyo
await get_time(time_format="%Y-%m-%d", timezone="Asia/Tokyo")
# Returns: "2025-06-30"

AI Assistant Integration

A tool for AI assistants that need to:

  • Schedule appointments and events
  • Provide time-aware responses
  • Generate timestamps for logs or documents
  • Real-time clock functionality
  • Time-based file naming
  • Log generation with timezone awareness
  • Batch processing with time tracking
  • ...

License

This project is open source. Please refer to the LICENSE file for details.

Metadata

Release files for MCPCurrentTime 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for MCPCurrentTime 0.0.3
File Size Uploaded Provenance
mcpcurrenttime-0.0.3.tar.gz 3.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for MCPCurrentTime 0.0.3
File Interpreter ABI Platform
mcpcurrenttime-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 8.0 kB

Release files / mcpcurrenttime-0.0.3.tar.gz

Download URL mcpcurrenttime-0.0.3.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a22e58dc4717eb6066bf5dadbec588f4105b0570a6c22c00f5eab6a9fd57c195
BLAKE2b-256 checksum
How to use checksums
c7bb3153214030e0f22ddf2ef981feb910bee293d35b7b88bcb73490b7791532
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / mcpcurrenttime-0.0.3-py3-none-any.whl

Download URL mcpcurrenttime-0.0.3-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1060ccb31b2d1f794e4d8458ff1419a9246b4c28da07037d8c1752b1b4ce07c
BLAKE2b-256 checksum
How to use checksums
7f8e0e3067a31c0ae6cdeaf1bc25ab83131e77fd8e3318f2584802a56f91e3b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Security for MCPCurrentTime 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page