temporal-mcp-server
You can use this MCP server for timezone-aware time, conversion, duration arithmetic, and elapsed-time calculations.
Get the current time as epoch, UTC ISO-8601, and wall-clock time in any IANA timezone.
Convert an ISO-8601 timestamp into a target timezone.
Add or subtract ISO-8601 durations, with calendar-aware date units and exact time units.
Calculate elapsed time between two timestamps with signed days/hours/minutes/seconds and direction.
Retrieve server identity and build information via the
infotool.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@temporal-mcp-server what time is it in Tokyo?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
temporal-mcp-server
MCP server for time, timezone, and duration tools.
Run it locally over stdio (Claude Desktop, Claude Code, any local MCP client), locally over HTTP, or use the hosted instance — same tools, same code, three ways to run it.
A public instance runs on Cloudflare Workers at https://time.somamcp.com/mcp:
claude mcp add --transport http temporal https://time.somamcp.com/mcpBuilt on somamcp (README · npm), which supplies the MCP plumbing, telemetry, and health/introspection endpoints for both runtimes. Time logic is pure and functional, using functype.
Tools
Tool | Purpose |
| Current time as epoch, UTC ISO-8601, and wall-clock in any IANA timezone |
| Render an ISO-8601 timestamp in a target timezone |
| Add or subtract an ISO-8601 duration, with calendar-aware month arithmetic |
| Elapsed time between two timestamps, in whole units plus a readable summary |
somamcp also registers an info tool and /health, /health/detail, /info, and /dashboard endpoints.
Behaviour worth knowing
Date units are calendar units; time units are exact. This is the distinction that makes DST come out right, and it follows ISO-8601 and Temporal:
Across US "fall back" | Result |
|
|
|
|
Both are correct, and they differ. "Tomorrow" is a calendar idea; "24 hours from now" is a physical one.
timezone governs the arithmetic, not just the rendering. Calendar units are applied to that zone's wall clock, so add_duration in America/New_York behaves the way a person in New York expects.
Month arithmetic clamps rather than overflows. P1M on 2026-01-31 returns 2026-02-28, not 2026-03-03.
Offsets are resolved per instant, not per zone. America/New_York reports -04:00 in August and -05:00 in January. DST comes from the runtime's tz database, so there is no offset table here to go stale.
Naive timestamps are read in the supplied timezone. 2026-11-01T00:00:00 with America/New_York means midnight in New York. It never falls back to the host's zone — that would answer differently on a laptop than on a Worker.
Timestamp parsing is strict. Only ISO-8601 forms are accepted; 17 Aug 2026 is rejected with a hint. new Date() would have taken it and resolved it against whatever zone the process happened to run in.
Elapsed components share one sign. time_between returns all of days/hours/minutes/seconds negative for a backward interval, so summing them is correct, plus a direction of past/future/same.
Errors carry a hint. An unknown timezone returns the bad value and the expected format, so a calling agent can correct itself instead of guessing again.
Related MCP server: mcp-datetimeday
Running as a local MCP server
Stdio is the default and the mode local clients expect. Nothing is hosted, nothing listens on a port — your client launches the process and talks to it over stdin/stdout.
Claude Code
claude mcp add temporal -- npx -y temporal-mcp-serverClaude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"temporal": {
"command": "npx",
"args": ["-y", "temporal-mcp-server"]
}
}
}On macOS that file lives at ~/Library/Application Support/Claude/claude_desktop_config.json; on Windows, %APPDATA%\Claude\claude_desktop_config.json. Restart Claude Desktop after editing it.
Running from a clone
If you'd rather not go through npm:
pnpm install
pnpm build
pnpm start # stdioThen point your client at the built entry point:
claude mcp add temporal -- node /absolute/path/to/temporal-mcp-server/dist/node.js{
"mcpServers": {
"temporal": {
"command": "node",
"args": ["/absolute/path/to/temporal-mcp-server/dist/node.js"]
}
}
}The package also installs a temporal-mcp-server binary, so a global install (npm i -g temporal-mcp-server) lets you use that name directly as the command.
Working in this repo
A checked-in .mcp.json registers the local build as the temporal server, so Claude Code picks up your changes rather than the hosted instance:
{
"mcpServers": {
"temporal": {
"command": "node",
"args": ["dist/node.js"]
}
}
}Run pnpm build first — it points at dist/, so an unbuilt checkout has nothing to launch.
Verifying it works
The server speaks JSON-RPC on stdout, so you can drive it by hand:
printf '%s\n%s\n%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"smoke","version":"1.0.0"}}}' \
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_current_time","arguments":{"timezone":"Asia/Tokyo"}}}' \
| node dist/node.jsOnly JSON-RPC goes to stdout; logs go to stderr, so piping is safe.
Running locally over HTTP
For clients that speak streamable HTTP rather than stdio:
pnpm start:http # http://localhost:3333/mcp — override the port with PORTThis is the same server and the same tools; only the transport differs.
Running remotely on Cloudflare Workers
pnpm cf:dev # local workerd runtime
pnpm cf:deploy # build + edge-safety check + deploycf:deploy runs pnpm build first, which includes check:worker — so a bundle carrying a Node built-in fails before anything reaches Cloudflare.
Continuous deployment
Deploys run through Cloudflare Workers Builds rather than GitHub Actions, so no Cloudflare API token is stored in GitHub at all — Cloudflare connects to the repo through its own GitHub App.
Set it up once in the dashboard (Workers & Pages → temporal-mcp-server → Settings → Build):
Field | Value |
Deploy command |
|
Build command | (leave empty — |
Root directory | (repo root) |
Pointing the deploy command at a package script keeps the gating logic in version control; the dashboard holds one stable line. The Worker name in the dashboard must match name in wrangler.jsonc (temporal-mcp-server), or the build fails.
The build image ships pnpm and honours .nvmrc (ours pins Node 24). Non-production branches default to npx wrangler versions upload, so branch pushes produce preview versions without touching the live deployment.
The MCP endpoint is at /mcp. To require a bearer token:
wrangler secret put MCP_AUTH_TOKENWith MCP_AUTH_TOKEN set, unauthenticated calls to /mcp get a 401. Leave it unset and the endpoint is public — reasonable for a clock, not for much else.
Build provenance
scripts/deploy.mjs stamps the deploy with GIT_COMMIT, GIT_BRANCH, and BUILD_DATE, so the info tool and /info report exactly what is running:
curl -s https://time.somamcp.com/info # protected; also available via the `info` MCP toolWorkers Builds exposes WORKERS_CI_COMMIT_SHA and WORKERS_CI_BRANCH during the build, but build variables are not readable at runtime — they have to be forwarded as Worker vars, which is what the deploy script does. Running pnpm cf:deploy locally falls back to git rev-parse, and a deploy from a dirty tree is stamped <sha>-dirty rather than claiming to be a commit it isn't.
Connecting a client to the deployed worker
The public instance is served from a custom domain:
claude mcp add --transport http temporal https://time.somamcp.com/mcpWith a token set, pass it as a header:
claude mcp add --transport http temporal https://time.somamcp.com/mcp \
--header "Authorization: Bearer $MCP_AUTH_TOKEN"Health check: https://time.somamcp.com/health.
pnpm cf:dev serves the same thing on http://localhost:8787/mcp, so you can point a client at a local workerd instance before deploying.
Why the worker imports somamcp, and the Node entry somamcp/node
somamcp's main entry uses web-standard APIs only. somamcp/node adds what only Node can do: the port listener, stdio, and file helpers. So src/worker.ts imports somamcp, src/node.ts imports somamcp/node, and pnpm check:worker fails the build if a node: import, a bare Node built-in, or somamcp/node reaches the worker bundle.
See somamcp on Workers for the full story.
The check walks the actual import graph from dist/worker.js rather than matching filenames — the bundler hoists code shared with the Node entry into a chunk with a generated name, and a filename glob would skip exactly the file most likely to carry a leak.
nodejs_compat is deliberately not enabled in wrangler.jsonc. If a Node built-in ever arrives, the build should fail loudly rather than be silently shimmed.
Architecture
src/
clock.ts pure time logic — Either<TemporalError, T>, no I/O, no globals
tools.ts MCP tool registration; takes a server, creates none
index.ts library surface (runtime-agnostic)
node.ts entry: somamcp/node -> stdio + httpStream
worker.ts entry: somamcp -> export default { fetch }registerTemporalTools(server) takes the server rather than building one, so both entry points register identical tools. Nothing in clock.ts, tools.ts, or index.ts touches process, the filesystem, or any Node built-in.
Failures are values. Every fallible function in clock.ts returns Either<TemporalError, T>; the tool layer folds a Left into an MCP error result. Nothing depends on stack unwinding, which is what lets the same logic run unchanged on both runtimes.
Development
pnpm validate # format + lint + typecheck + test + build + version and worker checks
pnpm test # 87 tests
pnpm check:worker # verify the worker bundle is edge-safetest/worker.spec.ts drives real Request objects through the Worker's fetch handler over the MCP wire protocol, so integration breakage surfaces in CI rather than after a deploy.
License
MIT
Available Tools
5 toolsadd_durationAInspect
Add an ISO-8601 duration to a timestamp, in a timezone. Date units (Y/M/D) are calendar-aware: P1D across a DST boundary keeps the same wall-clock time the next day, and P1M on Jan 31 clamps to the end of February. Time units (H/M/S) are exact elapsed time, so PT24H really is 24 hours. Prefix the duration with '-' to subtract.
Inputs: duration (required), isoTimestamp (required), timezone.
convert_timezoneBInspect
Render an ISO-8601 timestamp as wall-clock time in a target timezone.
Inputs: isoTimestamp (required), targetTimezone (required), sourceTimezone.
get_current_timeAInspect
Return the current time as an epoch, a UTC ISO-8601 timestamp, and the wall-clock time in a given timezone.
Inputs: timezone.
infoARead-onlyInspect
Returns identity and build information for this server (name, version, build commit, runtime, capability counts)
Inputs: no named parameters.
time_betweenAInspect
Exact elapsed time between two ISO-8601 timestamps, broken into days/hours/minutes/seconds plus a human-readable summary. All components share one sign, so they sum correctly; direction is 'past', 'future', or 'same'.
Inputs: to (required), from (required), timezone.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct operation: server metadata, current time retrieval, timezone conversion, duration arithmetic, and elapsed-time calculation. There is no overlap in inputs or intent, and descriptions make the boundaries unambiguous.
Three tools follow a clean verb_noun pattern (get_current_time, convert_timezone, add_duration), but 'info' is a bare noun and 'time_between' is a prepositional phrase rather than verb-led. The deviations are minor and still readable.
Five tools is well-scoped for a focused time-utility server, with each tool earning its place and no redundant entries. Nothing feels padded or missing at the count level.
The core time lifecycle is covered: now, convert, shift (subtraction handled via negative prefix), and diff. Minor gaps remain around parsing/formatting arbitrary timestamp strings or listing timezones, but agents can work around these.
Maintenance
Related MCP Connectors
Timezone MCP — wraps timeapi.io (free, no auth)
MCP server for time in cities around the world, time zones, DST, conversion, and meetings.
timesheet.io MCP server - manage timers, projects, tasks and reports
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceThe Time MCP Server is a Model Context Protocol (MCP) server that provides AI assistants and other MCP clients with standardized tools to perform time and date-related operations. This server acts as a bridge between AI tools and a robust time-handling back167 npm25MIT
- AlicenseAqualityDmaintenanceA lightweight MCP server providing comprehensive date, time, and day-of-week information. It supports relative time calculations, timezone conversions, and detailed calendar metadata like week numbers and quarters.51MIT
- AlicenseDqualityCmaintenanceA lightweight MCP server that provides date and time tools, including the ability to retrieve current timestamps and parse date strings with IANA timezone support. It enables AI models to interact with the host OS clock and perform temporal calculations via stdio transport.310 npm7MIT
- AlicenseAqualityDmaintenanceMCP server providing various date/time functions including current time, timezone conversion, and relative time calculations. Supports both local stdio and remote HTTP access via Cloudflare Workers.26443 npm3MIT