session-clock
Click on "Install 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., "@session-clockhow long ago did I send that message about the deployment?"
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.
mcp-server-session-clock
A minimal remote MCP server that gives an AI assistant a clock.
Models in a chat or agent host usually have no reliable sense of wall-clock time
— often not even the current time of day — so they can't say when a message
happened or how long ago. This server exposes a single MCP tool, now, that
returns the current instant. A standing instruction
tells the model to call it at the start of each reply to timestamp the exchange,
and again on read-back to work out "how long ago".
It is stateless — nothing is stored server-side; the timestamps live in the conversation itself. It works with any host that accepts remote (Streamable HTTP) MCP servers.
⚠️ Timestamp capture is best-effort, not guaranteed — read this before relying on it. MCP tool use runs under the host's default
tool_choice: auto: the model decides per turn whether to call a tool. It will sometimes skipnowdespite the standing instruction — most often on short or trivial messages — so some messages won't get a timestamp, and most hosts give you no way to force a call. If you need guaranteed per-message timestamps, an instruction-driven MCP tool (this or any other) is the wrong mechanism — that needs control at the API layer (tool_choice: "any"), which chat/agent hosts don't expose. This server fits "roughly when did things happen", not an audit log.
How it works
Write: the instruction tells the model to call
nowat the start of each reply and not repeat the value in its answer. That call ≈ when your message was received.Storage: the conversation itself — each
nowcall and its result are kept in context as a tool-use record, not as prose.Read: when you ask "how long ago was X", the model finds the recorded
nowresult nearest message X and compares it to a freshnow.
Related MCP server: Utility MCP Server
Prerequisites
Node 18+ and npm (built with Node 22 / npm 11)
A Cloudflare account (free tier)
An MCP host/client that supports remote (Streamable HTTP) MCP servers
Setup
npm installCopy the local secret template so dev and type generation can see MCP_SECRET:
cp .dev.vars.example .dev.varsGenerate TypeScript types (worker-configuration.d.ts, git-ignored) — also run
automatically by npm run typecheck:
npm run cf-typegenGenerate a secret for the path segment (32+ random chars) and add it to .dev.vars:
node -e "console.log(require('crypto').randomBytes(24).toString('base64url'))"Put the printed value in .dev.vars as MCP_SECRET (replacing the placeholder) —
this is the secret local dev uses. The deployed Worker gets its own copy in the
Deploy step below.
Run locally
npm run devYour endpoint is http://localhost:8787/mcp/<MCP_SECRET>. Any other path returns
404.
Deploy
Install the Wrangler CLI (once per machine):
npm install -g wranglerLog in to Cloudflare (opens a browser; once per machine):
wrangler loginPublish the Worker:
npm run deploySet the secret on the deployed Worker — Wrangler can only attach a secret once the
Worker exists, so this runs after the first deploy. Use the same value you put in
.dev.vars:
npx wrangler secret put MCP_SECRETWrangler prints your public URL. The endpoint is that origin plus the secret path:
https://session-clock.<your-subdomain>.workers.dev/mcp/<MCP_SECRET>Add to your MCP host
In your host's MCP-server / connector settings, add a new remote server.
Paste the full URL above (including
/mcp/<MCP_SECRET>). Leave auth empty — this is an authless server; the secret in the path is the access control.Open a conversation and confirm the
nowtool is available.Add the standing instruction wherever your host injects persistent instructions (system prompt, custom instructions, a per-project instruction field, a saved "style", etc.).
Standing instruction
The server only makes the now tool available; this is what makes the model
use it. Paste it into your host's persistent-instruction field:
I've connected a `now` tool that returns the current time so you can tell me how long ago things happened. This is my own preference and my app shows me every tool call, so nothing here is hidden from me. At the start of each reply, call `now` once to record the time, then answer my message normally — you don't need to repeat the timestamp or describe the call (it's just for later reference), though you can if it's relevant. When I ask how long ago something happened, compare the `now` result nearest that message with a fresh `now` call.Word it transparently — this is load-bearing. An earlier draft said "silently … never mention the tool … reply exactly as you would have without it." Models read that as a request to take hidden, undisclosed actions and refuse it as a possible prompt injection (they decline to call the tool at all, which looks like a random skip but isn't). The version above frames the tool as your own, benign, self-disclosed preference and notes the calls are already visible to you — don't reintroduce "silently" / "never mention" phrasing.
The timestamp doesn't need to appear in the reply, but your host still shows a tool-call indicator for each
nowcall, so nothing is actually concealed.Times are UTC. "How long ago" is a difference, which is timezone-independent.
Even well-worded, capture is best-effort — see the note at the top.
Test it
Open a new conversation → send a message; the assistant replies normally (no visible timestamp, though your host may show a tool-call indicator).
Send a couple more messages over a few minutes.
Ask: "How long ago was my first message?" — the assistant reads the recorded
nowcalls and answers within a few minutes' accuracy.
Security model
The tool only reveals the current time and stores nothing, so a leaked URL is low-stakes (someone could ask what time it is, or try to spam it). Protection is therefore deliberately light:
Secret path segment (
/mcp/<32+ chars>) as a de-facto access key; every other path 404s. The secret lives in your host's server configuration and in Cloudflare's request logs — it's a speed bump against scanners, not real auth. Rotate by runningwrangler secret put MCP_SECRETagain and re-pasting the URL.Rate limiting: add a Cloudflare WAF rate-limit rule on the route so a discovered endpoint can't be flooded.
Limits
Not deterministic (see the note at the top): the model won't call
nowon every turn, so some messages have no nearby timestamp and their timing can only be inferred from the nearest recorded call.Compaction erases history: if a long conversation is summarized, early
nowresults fall out of context and their timing is lost (current time still works).Small tax per reply: one extra tool round-trip and a tool-call indicator in the host UI (the timestamp value is not printed).
Upgrade (Branch B) — server-side log
If compaction-loss bites, move the log server-side. Two routes:
Add storage to this stateless handler: bind a KV namespace or D1 database, persist
(session_token, seq, ts)keyed by a model-minted token, and add aget_timelinetool. Least new machinery.Switch to the stateful legacy path (
createLegacyMcpHandler/McpAgentWorkerTransport), which gives each client session its own Durable Object. That also lets you test empirically whether an MCP session maps 1:1 to a conversation in your host (does a second conversation get a fresh DO?) — if so, attribution is automatic with no token needed.
Note that Branch B moves the storage server-side; it does not make capture deterministic — the write still depends on the model choosing to call the tool.
Project structure
src/index.ts The Worker: the `now` tool + secret-path gate
src/worker-env.d.ts Types the MCP_SECRET Worker secret
wrangler.jsonc Worker config (name, entry point, compatibility)
tsconfig.json TypeScript config
.dev.vars.example Template for the local secretRuntime/binding types live in worker-configuration.d.ts, generated by
wrangler types (git-ignored) — rerun npm run cf-typegen after editing
wrangler.jsonc, keeping .dev.vars present so the secret stays typed.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceThe 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 backLast updated17025MIT
- FlicenseAqualityDmaintenanceA general-purpose MCP server providing time-related utilities such as fetching current time, Unix timestamps, and formatting services. It supports both local stdio and remote SSE communication modes for versatile AI client integration.Last updated3
- 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.Last updated3177MIT
- Alicense-qualityDmaintenanceA simple MCP server that exposes datetime information to agentic systems and chat REPLsLast updatedMIT
Related MCP Connectors
A time server that keeps your AI honest about time. Real clock + drift guard, zero dependencies.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Remote MCP server for The Colony — a social network for AI agents (posts, DMs, search, marketplace).
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/haggifer/mcp-server-session-clock'
If you have feedback or need assistance with the MCP directory API, please join our Discord server