| Crates.io | mcp-server-time |
| lib.rs | mcp-server-time |
| version | 0.3.0 |
| created_at | 2025-09-12 02:36:40.234846+00 |
| updated_at | 2025-09-21 17:44:40.092327+00 |
| description | A comprehensive Model Context Protocol (MCP) server for timezone-aware time operations |
| homepage | https://github.com/sabry-awad97/rust-mcp-servers |
| repository | https://github.com/sabry-awad97/rust-mcp-servers |
| max_upload_size | |
| id | 1834955 |
| size | 88,332 |
A comprehensive Model Context Protocol (MCP) server that provides timezone-aware time operations with smart completion, automatic DST handling, and local timezone detection.
cargo install mcp-server-time
# Start the MCP server (communicates via stdio)
mcp-server-time
# Install and run the MCP Inspector to test the server
npx @modelcontextprotocol/inspector mcp-server-time
Add to your Claude Desktop MCP configuration:
{
"mcpServers": {
"time": {
"command": "mcp-server-time",
"args": [],
"env": {
"LOG_LEVEL": "debug"
}
}
}
}
NEW in v0.2.0: The server now provides intelligent completion for:
get_current_timeGet the current time in any IANA timezone.
Parameters:
timezone (string): IANA timezone name (e.g., "America/New_York", "Europe/London")Example Request:
{
"timezone": "Asia/Tokyo"
}
Example Response:
{
"timezone": "Asia/Tokyo",
"datetime": "2025-01-15T14:30:00+09:00",
"day_of_week": "Monday",
"is_dst": false
}
convert_timeConvert time between different timezones.
Parameters:
source_timezone (string): Source IANA timezone nametime (string): Time in 24-hour format (HH:MM)target_timezone (string): Target IANA timezone nameExample Request:
{
"source_timezone": "America/Los_Angeles",
"time": "09:00",
"target_timezone": "Europe/Paris"
}
Example Response:
{
"source": {
"timezone": "America/Los_Angeles",
"datetime": "2025-01-15T09:00:00-08:00",
"day_of_week": "Monday",
"is_dst": false
},
"target": {
"timezone": "Europe/Paris",
"datetime": "2025-01-15T18:00:00+01:00",
"day_of_week": "Monday",
"is_dst": false
},
"time_difference": "+9h"
}
timezone_guidanceGet comprehensive guidance on timezone best practices, IANA naming conventions, and DST handling.
timezone_conversion โญ NEWInteractive timezone conversion with smart completion support. This prompt provides:
Parameters:
source_timezone (string): Source IANA timezone (with completion)time (string): Time in HH:MM format (with completion)target_timezone (string): Target IANA timezone (with completion)time://statusCurrent server status, local timezone, and system information.
time://helpComprehensive help documentation with examples and best practices.
time://timezonesList of common IANA timezone names organized by region.
The server dynamically supports all 400+ IANA timezone names from chrono-tz. The completion system provides fuzzy matching for easy discovery. Here are some common examples:
America/New_York - Eastern TimeAmerica/Los_Angeles - Pacific TimeAmerica/Chicago - Central TimeAmerica/Toronto - Eastern Time (Canada)America/Sao_Paulo - Brazil TimeEurope/London - Greenwich Mean TimeEurope/Paris - Central European TimeEurope/Berlin - Central European TimeEurope/Moscow - Moscow TimeAsia/Tokyo - Japan Standard TimeAsia/Shanghai - China Standard TimeAsia/Kolkata - India Standard TimeAsia/Dubai - Gulf Standard TimeUTC - Coordinated Universal TimeGMT - Greenwich Mean TimeNEW in v0.3.0: Optional logging configuration
LOG_LEVEL (optional): Set logging level (debug, info, warn, error). If not set, logging is disabled for better performance.# Run without logging (default)
mcp-server-time
# Run with debug logging
LOG_LEVEL=debug mcp-server-time
# Run with info logging
LOG_LEVEL=info mcp-server-time
The server automatically detects your local timezone. You can override this by setting environment variables or using the builder pattern (if implemented).
Once configured, you can ask Claude:
"What time is it in Tokyo right now?"
"Convert 2 PM Los Angeles time to London time"
"What's the time difference between New York and Sydney?"
"Use the timezone conversion prompt to convert 14:30 from Europe/London to Asia/Tokyo"
NEW: Try the interactive timezone_conversion prompt for guided conversion with smart completion!
# Test the server with smart completion
npx @modelcontextprotocol/inspector mcp-server-time
Try these features:
get_current_time or convert_timetimezone_conversion with smart completion:
time://help for documentationThe MCP protocol requires proper initialization. Use the MCP Inspector for testing:
# Use MCP Inspector for interactive testing
npx @modelcontextprotocol/inspector mcp-server-time
# Or test with a proper MCP client that handles the initialization handshake
Note: Direct stdio testing requires implementing the full MCP protocol handshake (initialize โ tools/list โ tools/call).
The server provides detailed error messages for common issues:
Run the test suite:
cargo test
Run with coverage:
cargo tarpaulin --out html
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
cargo buildcargo testThis project follows the Rust standard formatting. Run cargo fmt before submitting.
This project is licensed under the MIT License - see the LICENSE file for details.