tink3rtanner/mcp_time
If you are the rightful owner of mcp_time and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The MCP Time Server is a robust server providing time-related utilities to AI clients using the Model Context Protocol.
๐ MCP Time Server โก
A Model Context Protocol (MCP) server providing comprehensive time utilities to AI clients like Claude Desktop and Cursor. Built with Python using the FastMCP framework.
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ AI Client โโโโโบโ MCP Server โโโโโบโ Time Services โ
โ (Claude/Cursor) โ โ (timeserver) โ โ (Python) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
๐ Quick Start
Setup & Installation
cd /Users/joshpriebe/Documents/AI/mcp/timeserver
source .venv/bin/activate
python test_timeserver.py # Verify everything works
Project Structure
timeserver/
โโโ main.py # ๐ง MCP server implementation
โโโ test_timeserver.py # ๐งช Comprehensive tests
โโโ pyproject.toml # ๐ฆ Python dependencies
โโโ claude_desktop_config.json # โ๏ธ Claude config
โโโ cursor_global_mcp.json # โ๏ธ Cursor config template
โโโ .cursor/mcp.json # โ๏ธ Project Cursor config
๐ ๏ธ Available Tools
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Time Server Tools โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ๐ get_current_time(timezone="UTC") โ
โ Get current time in any timezone โ
โ โ
โ ๐ get_time_in_multiple_zones() โ
โ World clock across 10 major timezones โ
โ โ
โ ๐ get_unix_timestamp() โ
โ Current Unix timestamp + readable format โ
โ โ
โ ๐ format_time(timestamp) โ
โ Convert Unix timestamp to human-readable โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Client Integration
Claude Desktop
Configuration file: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"timeserver": {
"command": "/Users/joshpriebe/Documents/AI/mcp/timeserver/.venv/bin/python",
"args": ["/Users/joshpriebe/Documents/AI/mcp/timeserver/main.py"],
"env": {
"PYTHONPATH": "/Users/joshpriebe/Documents/AI/mcp/timeserver",
"PYTHONUNBUFFERED": "1"
}
}
}
}
Cursor
Project config (already configured): .cursor/mcp.json
Global config: Copy cursor_global_mcp.json
to ~/.cursor/mcp.json
๐ก Example Usage
Natural Language Queries
๐ Basic Time
โโโ "What time is it?"
โโโ "Current time please"
โโโ "What's the time right now?"
๐ Timezone Queries
โโโ "What time is it in London?"
โโโ "Show me Tokyo time"
โโโ "Current time in US/Pacific"
๐ World Clock
โโโ "Show me world clock"
โโโ "Time in multiple cities"
โโโ "What time is it around the world?"
๐ Unix Timestamps
โโโ "Current timestamp"
โโโ "Give me the epoch time"
โโโ "Convert 1704067200 to date"
API Examples
# Get current time in specific timezone
await get_current_time("US/Pacific")
# โ "Current time in US/Pacific: 2024-01-01 04:00:00 PST"
# Get world clock
await get_time_in_multiple_zones()
# โ Multi-line output with 10 timezones
# Get Unix timestamp
await get_unix_timestamp()
# โ "Current Unix timestamp: 1704067200\nHuman readable (UTC): ..."
# Convert timestamp
await format_time(1704067200)
# โ "Timestamp 1704067200 converts to:\nLocal time: ...\nUTC time: ..."
๐งช Testing
# Test all functionality
python test_timeserver.py
# Test MCP protocol communication
python test_mcp_protocol.py
Test Flow:
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ Unit โโโโโบโ MCP โโโโโบโ Manual โ
โ Tests โ โ Protocol โ โ Testing โ
โ โ โ Tests โ โ (AI Client) โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
๐ Troubleshooting
Quick Diagnostics
# 1. Verify Python environment
ls -la .venv/bin/python
# 2. Test server directly
python main.py
# 3. Check configuration
cat .cursor/mcp.json # or
cat ~/Library/Application\ Support/Claude/claude_desktop_config.json
Common Issues
โ "No tools available"
โ Restart AI client after config changes
โ "Server not responding"
โ Check Python path in configuration
โ "Import errors"
โ Activate virtual environment: source .venv/bin/activate
๐ง Development
Dependencies
# Runtime
pip install "mcp[cli]>=1.0.0"
# Development (optional)
pip install black isort pylint mypy pytest pytest-asyncio
Code Quality
black main.py test_timeserver.py # Format
isort main.py test_timeserver.py # Sort imports
pylint main.py # Lint
mypy main.py # Type check
๐ License
MIT License - Open source time utilities for the MCP ecosystem.
๐ Happy time tracking! Your MCP Time Server provides accurate time information across any AI client supporting the Model Context Protocol.