An MCP Server that provides a tool to get the current time with optional timezone support
Project description
MCP Time Server
An MCP Server that provides a tool to get the current time with optional timezone support.
Features
- Provides a
get_current_timetool to retrieve the current time - Supports optional timezone parameter
- Simple and lightweight implementation
- Built using the Model Context Protocol (MCP)
Installation
pip install mcp-time-server
Usage
Running the Server
mcp-time-server
This will start the MCP Server using the STDIO transport, which is suitable for local process communication.
Using the get_current_time Tool
The server exposes a single tool called get_current_time that can be used by MCP clients.
Parameters
timezone(optional): A timezone string, e.g., "Asia/Shanghai", "America/New_York"- If not provided, the system's default timezone will be used
Return Value
A formatted string representing the current time in the format: YYYY-MM-DD HH:MM:SS.SSSSSS TIMEZONE
Examples
# Get current time in system default timezone
result = await mcp_client.call_tool("get_current_time")
# Example output: "2023-12-25 13:45:30.123456 EST"
# Get current time in a specific timezone
result = await mcp_client.call_tool("get_current_time", timezone="Asia/Shanghai")
# Example output: "2023-12-26 02:45:30.123456 CST"
Project Structure
mcp-time-server/
├── mcp_time_server/
│ ├── __init__.py # Package initialization
│ └── main.py # Main server implementation
├── pyproject.toml # Project configuration
├── README.md # This file
├── LICENSE # License file
└── .gitignore # Git ignore file
License
MIT License - see the LICENSE file for details.
About MCP
The Model Context Protocol (MCP) is an open-source standard for connecting AI applications to external systems. For more information, visit modelcontextprotocol.io.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_time_server_cyf_cuc-0.1.0.tar.gz.
File metadata
- Download URL: mcp_time_server_cyf_cuc-0.1.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.9 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09f3116dcd83ff0760ad0ccb476b7c34281c4456af994c2f21bafa46bdc05efd
|
|
| MD5 |
d7cb612d1cd3bc63fb0a74c47712a133
|
|
| BLAKE2b-256 |
29d79d450af5d9cbf28b72759cd90c9215e27f39841a091cb1f3b3828b82852e
|
File details
Details for the file mcp_time_server_cyf_cuc-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_time_server_cyf_cuc-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.9 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30c305c0cf5f789e9bedb9abf6438dc8149a5dd1436f9a14c424f6e299590eb2
|
|
| MD5 |
93d6e7f33fb7552a91cb75aa98dc6462
|
|
| BLAKE2b-256 |
6055a12c068c1b410b6aef0194e16640b2951ad609374cc5fa61183cd2b5f246
|