current_time
Get Current Time
Returns the current time in UTC and a specified or guessed timezone.
formattimezone
io.github.mcpcentral-io由 GitHub 帳號 mcpcentral-io 發布v0.0.3更新於 Oct 28, 2026
Time MCP server via HTTP
發布方自己的服務:Jsoncanvas
時間類 MCP 伺服器,讓助理取得目前時間、轉換時區、計算相對時間、時間戳、月份天數與 ISO 週數,可本機執行或透過 HTTP 連線。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。
閱讀 https://sourceweft.com/mcp/io.github.mcpcentral-io%2Fmcp-time/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。把它新增到你客戶端的 mcpServers 設定中。
{
"mcpServers": {
"time": {
"type": "http",
"url": "https://mcp.time.mcpcentral.io/"
}
}
}A Model Context Protocol (MCP) server providing time-related tools with dual-mode support:
This server allows LLMs to access various date/time functions through multiple connection methods.
MCP Central Server Card: https://guide-gen.mcpcentral.io/servers/io-github-mcpcentral-io-mcp-time
Provides the following MCP tools:
current_time: Get the current date and time in specified formats and timezones.relative_time: Get a human-readable relative time string (e.g., "in 5 minutes", "2 hours ago").days_in_month: Get the number of days in a specific month.get_timestamp: Get the Unix timestamp (milliseconds) for a given time.convert_time: Convert a time between different IANA timezones.get_week_year: Get the week number and ISO week number for a given date.Install the package globally or use with npx:
Connect directly to the deployed Cloudflare Worker:
Example:
Configure your MCP client (e.g., Claude Desktop) to use the stdio transport:
Or with global installation:
Configure your MCP client to use the remote HTTP endpoint:
Clone the Repository:
Install Dependencies:
Build: Compile the TypeScript code:
(This compiles src/index.ts to dist/index.js)
Test Locally:
Test Stdio Mode:
Test HTTP Mode (via Wrangler):
This will start the server on http://localhost:8787. You can then test with curl or point your MCP client to this local endpoint.
Configure Cloudflare:
Edit wrangler.toml to configure your domain (optional).
Login and Deploy:
Build the package:
Publish:
NEW: Major providers have adopted the Model Context Protocol and now support Streamable HTTP servers directly. Anthropic, OpenAI, and Microsoft have all adopted this modern transport protocol.
📋 Protocol Note: Streamable HTTP is the modern replacement for the deprecated HTTP+SSE transport.
Anthropic's MCP Connector allows you to use Streamable HTTP servers directly through the Messages API without needing a separate MCP client.
The MCP Connector is perfect for this server since it uses the Streamable HTTP architecture. Simply include the server in your API requests:
OpenAI also supports Streamable HTTP servers through their Agents SDK using the MCPServerStreamableHttp class:
Microsoft Copilot Studio now supports Streamable HTTP servers with MCP integration generally available. You can connect this server to Copilot Studio by:
Keep an eye out as more MCP clients adopt support for Streamable HTTP. Here are a few resources that maintain lists of MCP clients and their capabilities:
Test your server using these web-based inspection tools:
The official MCP Inspector is also available:
npx @modelcontextprotocol/inspectorStart your server:
Connect with an inspector:
http://localhost:8787 or https://mcp.time.mcpcentral.ioTest the stdio transport directly:
The inspector will show all six time-related tools:
current_time: Test with different timezones (e.g., "America/New_York", "Europe/London")relative_time: Test with various time strings (e.g., "2024-12-25T00:00:00Z")days_in_month: Test with different months and yearsget_timestamp: Convert date-time strings to Unix timestampsconvert_time: Convert between different timezonesget_week_year: Get week numbers for specific datesTry these test cases in the inspector:
Use the inspector to verify:
The MCP Inspector provides the most comprehensive way to test your server before integrating it with AI clients.
⚠️ IMPORTANT: This example server has NO authentication or security measures implemented.
來源:README.md,提交 10003c7
Get Current Time
Returns the current time in UTC and a specified or guessed timezone.
formattimezoneGet Relative Time
Calculates the relative time from now to a given time string.
time必填Get Days in Month
Returns the number of days in the month of a given date.
dateGet Timestamp
Converts a date-time string to a Unix timestamp in milliseconds.
timeConvert Timezone
Converts a time from a source timezone to a target timezone.
time必填sourceTimezone必填targetTimezone必填Get Week of Year
Returns the week and ISO week number for a given date.
date已滿足適用檢查項的 90%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
請在儲存庫或註冊中心條目中宣告授權條款。
mcp-time/├── src/│ └── index.ts # Cloudflare Worker entry point & MCP logic├── package.json # Project dependencies and scripts├── tsconfig.json # TypeScript configuration└── wrangler.toml # Cloudflare Worker configuration# Global installationnpm install -g @mcpcentral/mcp-time
# Or use directly with npxnpx @mcpcentral/mcp-timehttps://mcp.time.mcpcentral.io{ "mcpServers": { "time-server": { "command": "npx", "args": ["@mcpcentral/mcp-time"] } }}{ "mcpServers": { "time-server": { "command": "/path/to/node/bin/mcp-time" } }}{ "mcpServers": { "time-server": { "url": "https://mcp.time.mcpcentral.io", "transport": "streamable-http" } }}git clone https://github.com/mcpcentral-io/mcp-time.gitcd mcp-timenpm installnpm run buildecho '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | node dist/index.jsnpx wrangler devcp wrangler.toml.example wrangler.tomlwrangler loginnpx wrangler deploynpm run buildnpm publish --access publiccurl https://api.anthropic.com/v1/messages \ -H "Content-Type: application/json" \ -H "X-API-Key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: mcp-client-2025-04-04" \ -d '{ "model": "claude-sonnet-4-20250514", "max_tokens": 1000, "messages": [{ "role": "user", "content": "What time is it in Tokyo?" }], "mcp_servers": [{ "type": "url", "url": "https://your.worker.url.workers.dev", "name": "http-time-server" }] }'from agents.mcp.server import MCPServerStreamableHttp
# Connect to this Streamable HTTP serverserver = MCPServerStreamableHttp({ "url": "https://your.worker.url.workers.dev", "headers": {"Authorization": "Bearer your-token"}, # if needed})
# Use the server in your OpenAI agentawait server.connect()tools = await server.list_tools()result = await server.call_tool("current_time", {"timezone": "Asia/Tokyo"})# Local HTTP servernpx wrangler dev
# Or use deployed URL: https://mcp.time.mcpcentral.io# Test initializationecho '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | npx @mcpcentral/mcp-time
# Test tool callecho '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"current_time","arguments":{"timezone":"America/New_York"}}}' | npx @mcpcentral/mcp-time// current_time{"timezone": "Asia/Tokyo", "format": "iso"}
// relative_time {"time": "2024-12-25T00:00:00Z"}
// days_in_month{"month": 2, "year": 2024}
// get_timestamp{"time": "2024-06-15T12:00:00Z"}
// convert_time{"time": "2024-06-15T12:00:00", "from": "UTC", "to": "America/Los_Angeles"}
// get_week_year{"date": "2024-06-15"}