MCP Time Server
A simple server that provides the current UTC time.
MCP Time Server
A simple Model Context Protocol (MCP) server that provides current UTC time functionality. This server can be integrated globally with Cursor IDE to provide time-related capabilities across all projects.
Features
- Get current UTC time in multiple formats
- Simple MCP protocol implementation
- Global Cursor IDE integration
- Lightweight and fast
Installation
Prerequisites
- Python 3.8 or higher
- pip package manager
Install from source
- Clone or download this repository
- Navigate to the project directory
- Install the package:
pip install -e .
Install dependencies only
pip install -r requirements.txt
Usage
Running the server
# Run directly
python -m mcp_time_server.server
# Or use the installed script
mcp-time-server
Available Tools
get_current_time_utc
Get the current UTC time in various formats.
Parameters:
format(optional): Output format"iso"(default): ISO 8601 format (2025-01-15T10:30:45Z)"datetime": Human-readable format (2025-01-15 10:30:45)"timestamp": Unix timestamp (1736939445)
Example response:
Current UTC time: 2025-01-15T10:30:45.123456Z
Format: iso
Full ISO: 2025-01-15T10:30:45.123456Z
Cursor IDE Integration
Global Configuration (Recommended)
For permanent integration across all projects:
-
Create the global MCP configuration file:
- Windows:
C:\Users\[USERNAME]\.cursor\mcp.json - macOS/Linux:
~/.cursor/mcp.json
- Windows:
-
Add the following configuration:
{
"mcpServers": {
"time-server": {
"command": "python",
"args": ["-m", "mcp_time_server.server"],
"cwd": "/full/path/to/mcp-time-server/src",
"env": {
"PYTHONPATH": "/full/path/to/mcp-time-server/src"
}
}
}
}
- Restart Cursor IDE
- Check
Tools & Integrations>MCPto verify the server is enabled
The server will now automatically start with Cursor IDE and work across all projects!
Project-Specific Configuration
For project-only usage, create .cursor/mcp.json in your project directory with the same structure.
Development
Development Setup
# Install with development dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black src/
isort src/
# Type checking
mypy src/
Project Structure
mcp-time-server/
├── src/
│ └── mcp_time_server/
│ ├── __init__.py
│ └── server.py
├── pyproject.toml
├── requirements.txt
├── README.md
├── mcp_config.json
└── PROJECT_PLAN.md
Testing
Test the server functionality:
from mcp_time_server.server import get_current_time_utc
# Test different formats
print(get_current_time_utc("iso"))
print(get_current_time_utc("datetime"))
print(get_current_time_utc("timestamp"))
Troubleshooting
Common Issues
- Import errors: Make sure the package is installed with
pip install -e . - MCP connection issues: Verify the server path in your MCP configuration
- Permission errors: Ensure Python has necessary permissions to run the server
- Server not appearing: Check that the
.cursordirectory exists andmcp.jsonis properly formatted
Windows PowerShell
If you encounter issues with && operator in PowerShell, use:
cd src; python -m mcp_time_server.server
Verifying Server Status
Check if server is running:
# Windows
tasklist | findstr python
wmic process where "name='python.exe'" get ProcessId,CommandLine /format:list
# macOS/Linux
ps aux | grep mcp_time_server
Test connection in Cursor: Ask the AI assistant to get current time - it should use the MCP Time Server automatically.
Manual Server Management
Start server manually:
cd src && python -m mcp_time_server.server
Stop server:
# Windows (replace PID with actual process ID)
taskkill /PID [PID] /F
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Changelog
v0.1.0
- Initial release
- Basic UTC time functionality
- MCP protocol compliance
- FastMCP integration for simplified server management
- Global Cursor IDE configuration support
- Multiple time formats (ISO, datetime, timestamp)
- Comprehensive testing and documentation
- Process management and troubleshooting tools
- GitHub repository with MIT license
- Live testing confirmed across restart cycles
Related Servers
PiAPI
PiAPI MCP server makes user able to generate media content with Midjourney/Flux/Kling/Hunyuan/Udio/Trellis directly from Claude or any other MCP-compatible apps.
Phone Carrier Detector
Detects Chinese mobile phone carriers, including China Mobile, China Unicom, China Telecom, and virtual carriers.
Fibrous MCP Server
A server for Fibrous Finance, a DeFi aggregation platform.
MCP Marvel Rivals
Provides access to Marvel Rivals game data through a standardized interface.
Ecovacs Robot Control
Control and query the status of Ecovacs cleaning robots using the MCP protocol.
ADM1 MCP Server
Control anaerobic digestion modeling (ADM1) using natural language.
Manifold Markets
Interact with Manifold Markets prediction markets, including market creation, trading, and liquidity management.
Map Traveler
A virtual travel environment for an avatar on Google Maps, utilizing various Google Maps and optional AI image generation APIs.
Current Time JST
Provides the current time in Japan Standard Time (JST, UTC+9).
MCP OCR Server
An MCP server for Optical Character Recognition (OCR) using the Tesseract engine.