Skip to main content
Glama
mcp-time

mcp-time

by lyzetam

mcp-time

Python 3.10+ License: MIT

MCP server and LangChain tools for time and timezone operations. Stateless, zero-config, no external dependencies.

Features

5 tools for time operations:

Tool

Description

get_current_time

Get current time in any IANA timezone (ISO format)

get_current_timestamp

Get current Unix timestamp in seconds

convert_timezone

Convert time between timezones

get_time_difference

Calculate difference between two timestamps

format_time

Format ISO time with Python strftime patterns

Related MCP server: Time MCP Server

Installation

# Core library (no dependencies)
pip install .

# With MCP server support
pip install ".[mcp]"

# With LangChain tools
pip install ".[langchain]"

# Everything
pip install ".[all]"

Configuration

No configuration required. This server is stateless and uses only Python's built-in datetime and zoneinfo modules.

Quick Start

As MCP Server

# Run via stdio (for Claude Desktop/Code)
mcp-time

Add to Claude Code (~/.claude.json):

{
  "mcpServers": {
    "time": {
      "type": "stdio",
      "command": "mcp-time"
    }
  }
}

As LangChain Tools

from mcp_time.langchain_tools import TOOLS, time_now, time_convert

# Use all 5 tools with an agent
agent = create_react_agent(llm, TOOLS)

# Or use individual tools
print(time_now.invoke({"timezone_name": "America/New_York"}))
print(time_convert.invoke({
    "time_str": "2024-01-12 14:00:00",
    "from_tz": "America/New_York",
    "to_tz": "Asia/Tokyo",
}))

As Python Library

from mcp_time.operations import time_ops

time_ops.get_current_time("Europe/London")
time_ops.convert_timezone("2024-01-12 14:00:00", "US/Eastern", "Asia/Tokyo")
time_ops.get_time_difference("2024-01-12T10:00:00", "2024-01-12T14:30:00")
time_ops.format_time("2024-01-12T14:30:00", "%B %d, %Y at %I:%M %p")

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Provides current time information and timezone conversion capabilities using IANA timezone names. Enables LLMs to get current time in any timezone and convert times between different timezones with automatic system timezone detection.
      2
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Enables LLMs to retrieve current time information for specific IANA timezones or the local system timezone. It provides accurate ISO 8601 timestamps and detects daylight saving time status for requested locations.
      1
      2
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Provides current time information and timezone conversion capabilities using IANA timezone names with automatic system detection. It enables LLMs to fetch local or global times and convert specific timestamps between different regions.
      2
      2
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides current time information and timezone conversion capabilities using IANA timezone names and automatic system detection. It enables LLMs to fetch current times across different regions and convert specific times between timezones.
      MIT