Skip to main content

A local MCP server that provides local time and timezone conversion tools.

Project description

gettime-mcp

A local FastMCP server (stdio) with two tools:

  • get_local_time
  • convert_time_between_timezones

Requirements

  • Python 3.13+
  • uv

Setup

uv sync --all-groups

Run

uv run gettime-mcp

Tools

get_local_time

Input:

  • none

Output JSON:

  • local_iso: ISO 8601 local datetime with offset
  • weekday: weekday name in current local timezone (Monday to Sunday)
  • timezone_name: local timezone name
  • utc_offset: +HH:MM/-HH:MM
  • unix_timestamp: seconds timestamp

convert_time_between_timezones

Input:

  • datetime_iso (required): ISO 8601 datetime string (supports Z)
  • to_timezone (required): IANA timezone name (for example UTC, Asia/Shanghai)
  • from_timezone (optional): used only when datetime_iso has no offset

Output JSON:

  • input_datetime_iso
  • source_timezone
  • target_timezone
  • converted_iso
  • converted_unix_timestamp

Error behavior:

  • invalid timezone: Invalid timezone: <name>
  • invalid datetime format: Invalid datetime_iso format
  • if datetime_iso already has an offset, from_timezone is ignored

Cursor / Cline (local MCP)

Add to your MCP config (path depends on your editor installation):

{
  "mcpServers": {
    "gettime-local": {
      "command": "uv",
      "args": ["run", "gettime-mcp"],
      "cwd": "<ABSOLUTE_PROJECT_PATH>"
    }
  }
}

Example cwd on Windows: D:\\path\\to\\gettime

Tests

uv run pytest

Publish To PyPI (safe)

Build and validate:

uv build
uvx twine check dist/*

Publish with environment variable (do not paste token in files):

$env:PYPI_TOKEN = "pypi-***"
uvx twine upload dist/* -u __token__ -p $env:PYPI_TOKEN

Security Notes

  • Never commit tokens, cookies, or API keys.
  • Do not hardcode local absolute paths in public docs.
  • If a token was exposed, revoke and rotate it immediately.

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

gettime_mcp-0.1.0.tar.gz (53.2 kB view details)

Uploaded Source

Built Distribution

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

gettime_mcp-0.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file gettime_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: gettime_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 53.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for gettime_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a461616307f178d78ead1cf8ededd4d5d54469e4dcaeefea051fdfb95628188a
MD5 fd49700d5333c7f924ae63023a118231
BLAKE2b-256 cae1c7adc98cbfb7b2f9e187151df19e96a4f0969d8208f0933b2b37dd81854b

See more details on using hashes here.

File details

Details for the file gettime_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gettime_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for gettime_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3eda7b49ec21b99f13b09f7084c4ef8f5a87667cd72767ac85421a8997387b79
MD5 9625a8f9b4c222e22e32f0558f25447e
BLAKE2b-256 1535687c24bb724aba5b8c5699906e0e07b42844f207869f82f817b032ffb521

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