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.
Metadata
Release files for mcp-cuc-mqh 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mcp_cuc_mqh-0.1.1.tar.gz | 3.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_cuc_mqh-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.4 kB
Release files / mcp_cuc_mqh-0.1.1.tar.gz
| Download URL | mcp_cuc_mqh-0.1.1.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
abbb716e0bf2fc6cc3a6fc9f525d4180646074ebd2d9ed34c10ab04117705a7e
|
|
BLAKE2b-256 checksum How to use checksums |
a076a5c0bced7f9684b382e53731dff4c309c3a59f03c7c3804246c7c36b6a5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.13.0 Windows/11
|
Release files / mcp_cuc_mqh-0.1.1-py3-none-any.whl
| Download URL | mcp_cuc_mqh-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc96ffedaa7a770bf5667be884b94af6ab0e492f38b80d973695c87a436cbf71
|
|
BLAKE2b-256 checksum How to use checksums |
7ddbfff508dba82ce69915d441dd9ef44b09dbb8656edded8d59d192e30f1f2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.13.0 Windows/11
|