Labsco
elimS2 logo

MCP Time Server

from elimS2

A simple server that provides the current UTC time.

๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

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

Cursor IDE Integration

For permanent integration across all projects:

  1. Create the global MCP configuration file:

    • Windows: C:\Users\[USERNAME]\.cursor\mcp.json
    • macOS/Linux: ~/.cursor/mcp.json
  2. 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"
      }
    }
  }
}
  1. Restart Cursor IDE
  2. Check Tools & Integrations > MCP to 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"))

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