{"slug": "show-hn-i-built-an-mcp-server-that-gives-ai-agents-a-reliable-clock", "title": "Show HN: I built an MCP server that gives AI agents a reliable clock", "summary": "A developer launched AgentClock, a public streamable-HTTP MCP server at https://agentclock.andalabx.com/mcp that gives AI agents an authoritative clock through five tools: clock_now, clock_status, clock_sync, clock_gap and clock_beats. The service queries five public NTP servers and takes a median offset so one bad source cannot move it, then anchors on that value and advances with a monotonic counter, citing AgentTime research (arXiv:2610.09944) showing agent time-estimation error collapses when a real elapsed-time tool is available. AgentClock enforces and caches no timezone, resolving local rendering on every call from an IANA name or offset.", "body_md": "# AGENTCLOCK\n\nAgentClock gives AI agents authoritative time.\n\nhttps://agentclock.andalabx.com/mcp\n\nAgentClock is a public MCP service that any agent can call. A normal agent process does not check the time between messages, so an agent cannot feel time passing or say how long it has been idle, how long a task has taken, or whether it has passed a deadline.\n\nThe [AgentTime research (arXiv:2610.09944)](https://arxiv.org/abs/2610.09944) shows that an agent's time estimation error collapses to almost nothing when it has a real elapsed-time tool, and AgentClock is that tool. It is a working clock that an agent can call directly.\n\nPoint your agent at the public MCP URL, and your agent will have a public MCP service it can call whenever it needs the real time.\n\n## Add it to your agent\n\nAgentClock is a standard streamable HTTP MCP server, so any agent that can add an MCP server by URL can use it. The configuration format below is common to most agents, but if your agent uses a different key name, use the same URL and type in that format.\n\n```\n{\n  \"mcpServers\": {\n    \"agentclock\": {\n      \"type\": \"streamable-http\",\n      \"url\": \"https://agentclock.andalabx.com/mcp\"\n    }\n  }\n}\n```\n\nReload the agent, and the five tools will register automatically.\n\n## Make your agent use it\n\nAn MCP tool is something that your agent calls when it decides to, so it is not fused into your agent, and nothing runs inside your agent between turns. The tool only helps when your agent actually calls it, so add this line to your agent's instructions to make it a habit:\n\n```\nAt the start of every task and during long work, call AgentClock clock_now to get the authoritative time, and use clock_gap to measure elapsed time instead of guessing it. Check clock_status to confirm the clock is healthy and synchronized, and clock_beats to confirm it kept ticking during silence. Call clock_sync when a result looks stale. Never estimate elapsed time from your own sense of duration.\n```\n\nThe clock service itself runs continuously, and it stays anchored to external time references while nobody is talking to it. That is why the answer is trustworthy whenever the agent asks, but it does not give the agent a subjective sense of time passing, and no MCP server can create one. Instead, the service gives the agent a real clock to check rather than a duration to guess.\n\n## Timezones\n\nThe instant is universal, while the timezone is only a display layer that belongs to the agent rather than to AgentClock. AgentClock enforces and caches no timezone, so it resolves the local rendering afresh on every call, and any change in the agent's timezone shows up on the next call without a restart.\n\nPass an IANA name such as `America/New_York` or an offset such as `+02:00` as the `tz` argument, and the IANA database will handle daylight saving. If no zone is given, the clock will use its own local zone, and the UTC time and Unix timestamp in every response will remain the same instant regardless of the display zone.\n\n## The tools\n\nclock_now returns the current authoritative instant in UTC and Unix, along with the local rendering in the caller's zone, the source tier, the offset from the host clock, and the NTP sources from the last sync. It also accepts an optional `tz` argument.\n\nclock_status returns the full status, which includes the source tier, anchor age, sources, offset, and both UTC and caller-local time. It accepts the same optional `tz` argument.\n\nclock_sync forces a re-sync against the NTP servers and re-anchors the clock, so use it when a result looks stale or you need a fresh reference.\n\nclock_gap reports the time that has passed since the last turn recorded by the clock.\n\nclock_beats reports the service heartbeat count, which shows that the clock kept ticking during silence.\n\n## How it works\n\nThe clock queries five public NTP servers and takes a median offset so that one bad source cannot move it, then it anchors on that value and advances with a monotonic counter. A change to the system clock does not move AgentClock, and if no anchor exists, it falls back to the system clock and reports its source as \"system\".\n\nNo software creates time, and every physical clock drifts, so AgentClock disciplines itself against external references instead of pretending to generate time. It is independent of the host wall clock, but it is not independent of physics.\n\n## Troubleshooting\n\n- A 421 Misdirected Request means that the Host header is wrong, so use `agentclock.andalabx.com` as the host.\n- A 502 Bad Gateway means that the service is starting or down, so retry briefly.\n- There is no 401 and no token to configure. A bare GET to /mcp returns 400 because it is not a valid MCP request, but an MCP client that connects normally will work.\n\n© [AndaLabX](https://andalabx.com) 2026. All rights are reserved.\n\nAgentClock is a public MCP service.\n\nFor feedback and support, email [\\[email protected\\]](https://agentclock.andalabx.com/cdn-cgi/l/email-protection#f385968192b3929d97929f92918bdd909c9e).", "url": "https://wpnews.pro/news/show-hn-i-built-an-mcp-server-that-gives-ai-agents-a-reliable-clock", "canonical_source": "https://agentclock.andalabx.com/", "published_at": "2026-11-23 16:57:29+00:00", "updated_at": "2026-11-23 17:16:41.198582+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "developer-tools"], "entities": ["AgentClock", "Andalabx", "arXiv", "AgentTime", "NTP"], "also_reported_by": [], "takeaway": "Adding the AgentClock MCP server by URL registers five tools — clock_now, clock_status, clock_sync, clock_gap and clock_beats — and agents must be instructed to call clock_gap for elapsed time rather than estimating duration themselves.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/show-hn-i-built-an-mcp-server-that-gives-ai-agents-a-reliable-clock", "markdown": "https://wpnews.pro/news/show-hn-i-built-an-mcp-server-that-gives-ai-agents-a-reliable-clock.md", "text": "https://wpnews.pro/news/show-hn-i-built-an-mcp-server-that-gives-ai-agents-a-reliable-clock.txt", "jsonld": "https://wpnews.pro/news/show-hn-i-built-an-mcp-server-that-gives-ai-agents-a-reliable-clock.jsonld"}}