TimeMCP: a time and timezone MCP server

TimeMCP: a time and timezone MCP server

timemcp•bychew-z

A Model Context Protocol server implemented in Go and built on mcp-go that offers current time, timezone conversion, and flexible date interpretation tools, served over stdio or streamable HTTP.

License: Not specified•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Provides a get_current_time tool that returns the current time in a specified IANA timezone or the system timezone.
  • •Provides a convert_time tool that converts a time from a source timezone to a required target timezone.
  • •Provides a describe_time tool that parses flexible absolute or relative date/time phrases and returns an RFC 3339 timestamp plus human-readable prose.
  • •Supports stdio and streamable HTTP transports, with optional CORS, static JWT authentication, and OAuth 2.1 connector login.

BEST FOR

  • •Clients that need reliable current-time lookups across arbitrary IANA timezones.
  • •Agents that must resolve natural-language dates and relative phrases without doing date arithmetic themselves.
  • •Deployments needing a remote time service secured with JWT or OAuth and reachable from claude.ai custom connectors.

ABOUT TIMEMCP

TimeMCP: a time and timezone MCP server is cataloged as an MCP server attributed to chew-z. A Model Context Protocol server implemented in Go and built on mcp-go that offers current time, timezone conversion, and flexible date interpretation tools, served over stdio or streamable HTTP. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for TimeMCP: a time and timezone MCP server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

How does describe_time handle ambiguous dates?

It returns labeled candidate interpretations instead of guessing, covering weekday/date mismatches, mm/dd versus dd/mm ordering, and year-less dates more than 30 days in the past.

Is OAuth login required to use the server?

No, OAuth is opt-in and disabled by default; existing stdio and static JWT setups keep working.

Where does the server keep OAuth state?

OAuth state such as registered clients, codes, and refresh tokens is stored in memory, so a server restart requires a fresh connector login.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 9532355032f2 · 采集于 2026-11-13 12:01:38 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

TimeMCP

A Model Context Protocol (MCP) server that provides time and timezone tools. It runs over stdio (default) or streamable HTTP and is built on mark3labs/mcp-go.

Tools

get_current_time

Returns the current time in a specific timezone or the system timezone.

ArgumentTypeRequiredDescription
timezonestringnoIANA timezone; defaults to TIME_DEFAULT_TIMEZONE, then the system timezone

Example response:

Current time in Europe/Warsaw (CEST, UTC+02:00): Monday, 2025-04-09 15:30:45

convert_time

Converts a time from one timezone to another.

ArgumentTypeRequiredDescription
source_timezonestringnoSource IANA timezone; defaults to the configured default
timestringnoTime in HH:MM format; defaults to now
target_timezonestringyesTarget IANA timezone

Example response:

Time conversion: 2025-04-09 15:30 in Europe/Warsaw → 2025-04-09 09:30 in America/New_York

describe_time

Parses a flexible date/time string and describes how it relates to now. It returns a machine-usable RFC 3339 timestamp plus human-friendly prose, so the caller never has to do date arithmetic.

Supported inputs include absolute dates (July 4th, 1776, 22:08, Thursday, July 20 2026) and relative phrases (now, today, tomorrow, yesterday, next/last/this <weekday>, bare <weekday>, in N minutes/hours/days/weeks/months/years, N ... ago, next/last week/month/year), optionally suffixed with at <time>.

Ambiguous inputs return labeled candidates instead of guessing: a weekday that does not match the date, mm/dd versus dd/mm, and a year-less date more than 30 days in the past.

ArgumentTypeRequiredDescription
datestringyesDate/time phrase to interpret
timezonestringnoTimezone used to anchor "now"; defaults as above

Example response:

input:       "tomorrow at 5pm"
machine:     2026-10-24T17:00:00-04:00
human:       tomorrow at 5:00 PM
tense:       future
perspective: tomorrow evening

Build and run

The Taskfile.yml wraps the common commands; go works directly too.

task build                       # go build -o bin/mcp-time .
task run                         # stdio transport
task run:http                    # HTTP transport on :8080
task run:http:auth               # HTTP transport with JWT auth
task test                        # unit tests
task test-client                 # stdio smoke test via examples/test_client.go
task check                       # fmt:check, vet, lint, test

Use --hash-password to read a password and print its PBKDF2 hash, or --generate-token to mint a static bearer token. These credential flags exit before server configuration is loaded and cannot be used together.

Client configuration

Claude Desktop (stdio transport):

{
  "mcpServers": {
    "time": {
      "command": "/Path/To/Your/Bin/mcp-time"
    }
  }
}

Any MCP-compatible client can discover the tools, call them, and read the formatted responses.

HTTP transport

Start the server with --transport=http (optionally --auth-enabled). The MCP endpoint is POST {TIME_HTTP_PATH} (default /mcp). Health checks live at GET /health; there is no separate capabilities endpoint (tool discovery goes through MCP tools/list).

CORS

CORS is disabled by default. When enabled, no origin is allowed unless it is listed explicitly.

TIME_HTTP_CORS_ORIGINS accepts a comma-separated allowlist:

  • Hostname: example.com
  • Host and port: localhost:3000, 127.0.0.1:8080
  • Full URL: https://app.example.com (normalized to its host)
  • Wildcard subdomain: *.example.com (matches example.com and any subdomain)
  • * (only when authentication is disabled)

With TIME_AUTH_ENABLED=true, a * entry is rejected at startup. Preflight and response headers are emitted only for allowed origins.

JWT authentication

Generate a token (the secret must be at least 32 characters):

export TIME_AUTH_SECRET_KEY="your-256-bit-secret-key-here"
go run . --generate-token \
  --token-user-id="user123" --token-username="john" --token-role="admin"

Send it with each HTTP request:

curl -H "Authorization: Bearer $TOKEN" http://localhost:8080/mcp

OAuth 2.1 (claude.ai custom connectors)

Enable OAuth with TIME_OAUTH_ENABLED=true for claude.ai, Claude Desktop, and mobile custom connectors, or Claude Code /mcp login. OAuth is opt-in; existing stdio and static JWT setups keep working.

Set these environment variables:

  • TIME_OAUTH_ENABLED: default false.
  • TIME_OAUTH_ISSUER: required public base URL, including any nginx prefix, for example https://karma.example/time.
  • TIME_OAUTH_RESOURCE: required public MCP URL, for example https://karma.example/time/mcp. This is the public URL; TIME_HTTP_PATH is the local endpoint path.
  • TIME_OAUTH_LOGIN_USER: required login user name supplied by the operator.
  • TIME_OAUTH_LOGIN_PASSWORD_HASH: required PBKDF2 hash produced by mcp-time -hash-password.
  • TIME_OAUTH_ACCESS_TTL: default 1h.
  • TIME_OAUTH_REFRESH_TTL: default 720h; must exceed the access TTL.

Generate the password hash without putting the password in a command argument:

bin/mcp-time -hash-password

Enabling OAuth forces authentication on, even if TIME_AUTH_ENABLED=false. TIME_AUTH_SECRET_KEY must be at least 32 bytes; it signs OAuth access tokens. Invalid OAuth settings fail startup. Empty OAuth boolean and TTL values use their defaults. With CORS enabled, * in TIME_HTTP_CORS_ORIGINS is rejected.

OAuth mounts these routes at the server root:

  • /.well-known/oauth-protected-resource[/<resource path>]
  • /.well-known/oauth-authorization-server[/<issuer path>]
  • /authorize, /login, /token, and /register

The well-known routes serve both bare and path-suffixed discovery documents. /register supports dynamic client registration; authorization uses PKCE S256. With OAuth on, missing or invalid tokens receive HTTP 401 with WWW-Authenticate: Bearer ... resource_metadata="...". That challenge makes claude.ai start the OAuth flow. A valid OAuth token with the wrong scope receives HTTP 403 insufficient_scope. With OAuth off, unauthenticated tool calls still return an MCP tool error, as before. /health stays unauthenticated.

Create a custom connector with the public MCP URL:

https://karma.example/time/mcp

The deployed instance uses https://karma.rrj.pl/time/mcp. Leave Client ID and Client Secret empty. Log in with the user name and password supplied by the operator.

For Claude Code, add this to the project .mcp.json without headers, then run /mcp to complete OAuth login:

{
  "mcpServers": {
    "time": {
      "type": "http",
      "url": "https://karma.example/time/mcp"
    }
  }
}

Alternatively, generate a static bearer token with --generate-token (see JWT authentication) and configure it as a header:

{
  "mcpServers": {
    "time": {
      "type": "http",
      "url": "https://karma.example/time/mcp",
      "headers": {
        "Authorization": "Bearer <operator-issued-token>"
      }
    }
  }
}

The server stores OAuth state (registered clients, codes, and refresh tokens) in memory, so a server restart requires a fresh login from the connector. Static TIME_AUTH bearer tokens keep working across restarts as long as the signing secret, issuer, and audience stay the same.

If nginx strips /time, proxy /time/authorize, /time/login, /time/token, and /time/register to the corresponding server-root routes too. Also forward host-root /.well-known/* requests, preserving the derived paths such as /.well-known/oauth-protected-resource/time/mcp. The server-root authorization routes are published with the issuer prefix.

Configuration

VariableDefaultDescription
TIME_DEFAULT_TIMEZONEsystem timezoneDefault IANA timezone for all tools
TIME_HTTP_ADDRESS:8080HTTP listen address
TIME_HTTP_PATH/mcpMCP endpoint path
TIME_HTTP_STATELESSfalseRun the streamable HTTP transport without sessions
TIME_HTTP_HEARTBEAT30sSSE heartbeat interval
TIME_HTTP_TIMEOUT30sRead, write, and shutdown timeout
TIME_HTTP_SESSION_IDLE_TTL5mIdle session eviction
TIME_HTTP_DISABLE_LOCALHOST_PROTECTIONtrueDisable DNS-rebinding checks (TimeMCP runs behind a reverse proxy)
TIME_HTTP_CORS_ENABLEDfalseEnable the CORS wrapper
TIME_HTTP_CORS_ORIGINSemptyComma-separated origin allowlist
TIME_AUTH_ENABLEDfalseRequire a JWT on HTTP tool calls
TIME_AUTH_SECRET_KEYemptyHMAC secret, required when auth is enabled
TIME_AUTH_ISSUERTimeMCPExpected JWT issuer
TIME_AUTH_AUDIENCETimeMCP-userExpected JWT audience
TIME_OAUTH_ENABLEDfalseEnable OAuth connector login
TIME_OAUTH_ISSUERemptyPublic base URL, including any nginx prefix
TIME_OAUTH_RESOURCEemptyPublic MCP URL
TIME_OAUTH_LOGIN_USERemptyOperator-supplied login user name
TIME_OAUTH_LOGIN_PASSWORD_HASHemptyHash from --hash-password
TIME_OAUTH_ACCESS_TTL1hAccess token lifetime
TIME_OAUTH_REFRESH_TTL720hRefresh lifetime; must exceed access TTL

Development

  • Unit tests live beside the code (*_test.go); run them with task test or go test -race ./....
  • examples/test_client.go checks the legacy 2025-11-25 initialize handshake and exercises MCP 2026-07-28 over stdio only (server/discover, tools/list, tools/call) with _meta. It calls every tool and fails on protocol or tool errors.
  • docs/ARCHITECTURE.md explains how the pieces fit, docs/STATUS.md records the current toolchain and health, and docs/OPEN_ITEMS.md lists known debt.
  • Superseded docs and old reports belong in docs/retired/ (tracked). New reports belong in docs/reports/ (gitignored).

Dependencies

  • github.com/mark3labs/mcp-go v1: MCP protocol and transports
  • github.com/golang-jwt/jwt/v5: JWT authentication
  • github.com/araddon/dateparse: flexible absolute date parsing
  • golang.org/x/term: echo-free password input for --hash-password

Supported timezones

Any IANA timezone identifier works, for example Europe/Warsaw, America/New_York, Asia/Tokyo, Australia/Sydney, or Africa/Cairo.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for TimeMCP: a time and timezone MCP server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/timemcp)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools