Skip to main content

Time and date utilities as a FastMCP server

Project description

Time and Date MCP Server

PyPI License

An MCP server providing time and date tools for LLMs.


Overview

The Time and Date MCP Server provides date and time utilities for language models and AI assistants. It allows tools like current_time, time_since, date_diff to be called programmatically via Stdio or Streamable HTTP.


Tools

The tools exposed by the MCP server include:

  • current_time - Get the current time in a given timezone.
  • time_since - Human readable time elapsed since a given date.
  • add_days - Add days to today and return the future date.
  • subtract_days - Subtract days from today and return the past date.
  • date_diff - Number of days between two dates.
  • next_weekday - Date of the next occurrence of a weekday.
  • is_leap_year - Check if a year is a leap year.
  • week_number - ISO week number for a date.
  • parse_human_date - Parse a natural language date description.

Configuration

Local Time Zone

The local time zone can be set using the environmental variable LOCAL_TIME_ZONE.

It takes a IANA Timezone, if not given it will default to Etc/UTC.


🛠️ Installation

Local Development (via uv)

From this directory:

uv sync --locked
uv tool install .

Docker Build

From the root of the repository:

docker build -f servers/time/Dockerfile -t casual-mcp-server-time .

▶️ Running the Server

➤ Stdio Mode

From Source

Install for local development and then configure:

{
  "mcpServers": {
    "time": {
      "command": "uv",
      "args": ["tool", "run", "casual-mcp-server-time"],
      "env": {
        "LOCAL_TIME_ZONE": "Asia/Bangkok"
      }
    }
  }
}

Using uvx

{
  "mcpServers": {
    "time": {
      "command": "uvx",
      "args": ["casual-mcp-server-time"],
      "env": {
        "LOCAL_TIME_ZONE": "Asia/Bangkok"
      }
    }
  }
}

Docker

{
  "mcpServers": {
    "time": {
      "command": "docker",
      "args": ["run", "--rm", "casual-mcp-server-time"],
      "env": {
        "LOCAL_TIME_ZONE": "Asia/Bangkok"
      }
    }
  }
}

➤ Streamable HTTP Mode

From Source

uv run casual-mcp-server-time --transport streamable-http

With port/host overrides:

uv run casual-mcp-server-time --transport streamable-http --port 9000 --host 0.0.0.0

Using uvx

uvx casual-mcp-server-time --transport streamable-http

You can use the same port/host overrides as above

Docker

docker run -e MCP_TRANSPORT=streamable-http -e MCP_PORT=9000 -p 9000:9000 casual-mcp-server-time
Configuration
{
  "mcpServers": {
    "time": {
      "type": "streamable-http",
      "url": "http://localhost:9000"
    }
  }
}

📜 License

MIT – LICENSE


📦 PyPI

Published at: https://pypi.org/project/casual-mcp-server-time/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

casual_mcp_server_time-1.0.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

casual_mcp_server_time-1.0.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file casual_mcp_server_time-1.0.0.tar.gz.

File metadata

File hashes

Hashes for casual_mcp_server_time-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b04e9edf26f5bd7a82678258498c5ad59b96a24138005385e0fcc9ccdd287f82
MD5 c6f53b8af76b5779124679fbf44d22ca
BLAKE2b-256 f840b749889a3bbef90a413cc3546725e957248fcacbc6a5f1b8ffb7a44e4c4b

See more details on using hashes here.

File details

Details for the file casual_mcp_server_time-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for casual_mcp_server_time-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b9ceeefaa042d274c2f46c65efe326d19e0948db94b83c91ecf4e9d9634e1f9
MD5 1c922c77e752acb92d593e96107c9fb7
BLAKE2b-256 ed15a0c7262983ce420513ccd92ab5c895443a148fa9d7a667f9e66a5d6e100d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page