๐ Time MCP Server
A comprehensive Model Context Protocol (MCP) server that provides timezone-aware time operations with smart completion, automatic DST handling, and local timezone detection.
โจ Features
- ๐ Global Timezone Support - Works with all 400+ IANA timezones
- ๐ Time Conversion - Convert time between different timezones
- ๐ฏ Smart Completion - Fuzzy matching for timezone names and time formats
- ๐ Automatic DST Handling - Seamlessly handles daylight saving transitions
- ๐ Local Timezone Detection - Automatically detects system timezone
- ๐ก๏ธ Robust Error Handling - Comprehensive error messages with suggestions
- ๐งน Input Sanitization - Automatically trims whitespace from inputs
- ๐ Rich Documentation - Built-in help and timezone references
- ๐ Interactive Prompts - Guided timezone conversion with completion
- ๐ง Optional Logging - Configurable logging via LOG_LEVEL environment variable
๐ Installation & Usage
Install from Crates.io
Run the Server
# Start the MCP server (communicates via stdio)
Test with MCP Inspector
# Install and run the MCP Inspector to test the server
Use with Claude Desktop
Add to your Claude Desktop MCP configuration:
๐ ๏ธ Available Tools
Smart Completion Features
NEW in v0.2.0: The server now provides intelligent completion for:
- Timezone Names: Fuzzy matching (e.g., "ny" โ "America/New_York", "tok" โ "Asia/Tokyo")
- Time Formats: All 15-minute intervals (00:00, 00:15, 00:30, 00:45, etc.)
- Context-Aware: Suggestions adapt based on what you're typing
Tools
get_current_time
Get the current time in any IANA timezone.
Parameters:
timezone
(string): IANA timezone name (e.g., "America/New_York", "Europe/London")
Example Request:
Example Response:
convert_time
Convert 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 name
Example Request:
Example Response:
๐ฌ Available Prompts
timezone_guidance
Get comprehensive guidance on timezone best practices, IANA naming conventions, and DST handling.
timezone_conversion
โญ NEW
Interactive timezone conversion with smart completion support. This prompt provides:
- Fuzzy timezone matching: Type partial names for suggestions
- Time format completion: Get suggestions for valid time formats
- Rich conversion results: Detailed information with DST status
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)
๐ Available Resources
time://status
Current server status, local timezone, and system information.
time://help
Comprehensive help documentation with examples and best practices.
time://timezones
List of common IANA timezone names organized by region.
๐ Supported Timezones
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:
Americas
America/New_York
- Eastern TimeAmerica/Los_Angeles
- Pacific TimeAmerica/Chicago
- Central TimeAmerica/Toronto
- Eastern Time (Canada)America/Sao_Paulo
- Brazil Time
Europe
Europe/London
- Greenwich Mean TimeEurope/Paris
- Central European TimeEurope/Berlin
- Central European TimeEurope/Moscow
- Moscow Time
Asia
Asia/Tokyo
- Japan Standard TimeAsia/Shanghai
- China Standard TimeAsia/Kolkata
- India Standard TimeAsia/Dubai
- Gulf Standard Time
Special
UTC
- Coordinated Universal TimeGMT
- Greenwich Mean Time
๐ง Configuration
Environment Variables
NEW 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)
# Run with debug logging
LOG_LEVEL=debug
# Run with info logging
LOG_LEVEL=info
Timezone Detection
The server automatically detects your local timezone. You can override this by setting environment variables or using the builder pattern (if implemented).
๐ Usage Examples
With Claude Desktop
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!
With MCP Inspector
# Test the server with smart completion
Try these features:
- Tools: Use
get_current_time
orconvert_time
- Prompts: Try
timezone_conversion
with smart completion:- Type "ny" in timezone fields โ see "America/New_York" suggested
- Type "14" in time field โ see "14:00", "14:15", "14:30", "14:45" suggested
- Resources: Browse
time://help
for documentation
Command Line Testing
The MCP protocol requires proper initialization. Use the MCP Inspector for testing:
# Use MCP Inspector for interactive testing
# 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).
๐จ Error Handling
The server provides detailed error messages for common issues:
- Invalid Timezone: Suggests similar timezone names
- Invalid Time Format: Shows expected format (HH:MM)
- Ambiguous Time: Handles DST transition edge cases
- Resource Not Found: Lists available resources
๐งช Testing
Run the test suite:
Run with coverage:
๐ค Contributing
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.
Development Setup
- Clone the repository
- Install Rust (1.70+ required)
- Run
cargo build
- Run
cargo test
Code Style
This project follows the Rust standard formatting. Run cargo fmt
before submitting.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Built with rmcp - Rust MCP implementation
- Timezone data from chrono-tz
- Local timezone detection via iana-time-zone
๐ Support
- ๐ Documentation
- ๐ Issue Tracker
- ๐ฌ Discussions