clock-mcp
A Model Context Protocol server that gives an AI assistant a wall clock. It exposes five tools for reading the current time, doing duration math, and converting between IANA timezones, over MCP's stdio transport. Single Rust binary.
Install
This installs the clock-mcp binary to ~/.cargo/bin/, which is on your PATH if you have a normal Rust setup.
Or build from source:
Use it
With Claude Desktop
Add a clock entry to your claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
If you already have other servers in mcpServers, merge the clock entry alongside them rather than replacing the block.
Restart Claude Desktop. The five tools below will appear in the tools picker.
With Claude Code
Verify with claude mcp list.
Tool reference
now
Returns the current wall-clock time.
Params
| Name | Type | Required | Description |
|---|---|---|---|
timezone |
string (IANA) |
no | e.g. "America/Denver". Defaults to "UTC". |
Example response
time_until
Returns the duration from now until a target datetime. Negative if the target is already in the past.
Params
| Name | Type | Required | Description |
|---|---|---|---|
target |
string (ISO 8601 / RFC 3339) |
yes | e.g. "2026-12-31T23:59:59Z". |
Example response
time_since
Returns the duration from a past datetime until now. Negative if the input is actually in the future.
Params
| Name | Type | Required | Description |
|---|---|---|---|
past |
string (ISO 8601 / RFC 3339) |
yes | e.g. "2026-01-01T00:00:00Z". |
Example response
time_between
Returns the duration between two datetimes. Negative if end precedes start.
Params
| Name | Type | Required | Description |
|---|---|---|---|
start |
string (ISO 8601 / RFC 3339) |
yes | Start datetime. |
end |
string (ISO 8601 / RFC 3339) |
yes | End datetime. |
Example response
convert_timezone
Re-expresses an instant in another IANA timezone. The unix_seconds field is preserved across the conversion — only the wall-clock representation changes.
Params
| Name | Type | Required | Description |
|---|---|---|---|
datetime |
string (ISO 8601 / RFC 3339) |
yes | Input datetime with a timezone offset. |
target_timezone |
string (IANA) |
yes | e.g. "Asia/Tokyo". |
Example response
Error shape
Every tool returns a structured JSON error (never a panic) on bad input. The payload has a required error string and an optional hint:
The MCP envelope around these errors sets isError: true on the tools/call result.
Development
Poke it by hand
The server speaks MCP over stdio. You can talk to it with any MCP client, including the reference inspector:
Or drive a raw JSON-RPC handshake yourself:
|
License
MIT. See LICENSE.