Time and date utilities as a FastMCP server
Project description
Time and Date MCP Server
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file casual_mcp_server_time-1.0.0.tar.gz.
File metadata
- Download URL: casual_mcp_server_time-1.0.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b04e9edf26f5bd7a82678258498c5ad59b96a24138005385e0fcc9ccdd287f82
|
|
| MD5 |
c6f53b8af76b5779124679fbf44d22ca
|
|
| BLAKE2b-256 |
f840b749889a3bbef90a413cc3546725e957248fcacbc6a5f1b8ffb7a44e4c4b
|
File details
Details for the file casual_mcp_server_time-1.0.0-py3-none-any.whl.
File metadata
- Download URL: casual_mcp_server_time-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b9ceeefaa042d274c2f46c65efe326d19e0948db94b83c91ecf4e9d9634e1f9
|
|
| MD5 |
1c922c77e752acb92d593e96107c9fb7
|
|
| BLAKE2b-256 |
ed15a0c7262983ce420513ccd92ab5c895443a148fa9d7a667f9e66a5d6e100d
|