Mcp Time

io.github.mcpcentral-io由 GitHub 账号 mcpcentral-io 发布v0.0.3更新于 Oct 28, 2026

Time MCP server via HTTP

发布方自己的服务:Jsoncanvas

已验证Streamable HTTP可网页运行效率与工作流开发者工具

概览

AI 生成的概览

时间类 MCP 服务器,让助手获取当前时间、转换时区、计算相对时间、时间戳、月份天数与 ISO 周数,可本地运行或通过 HTTP 连接。

可以做什么
  • 获取 UTC 或指定(或推测)时区的当前日期时间,并支持格式选项
  • 在 IANA 时区之间转换时间,并换算为毫秒级 Unix 时间戳
  • 计算从当前时刻到指定时间的相对时间,例如“5 分钟后”“2 小时前”
  • 查询日期的日历信息:某月天数、周数与 ISO 周数
适用场景
适合需要可靠时钟与日历计算的场景:回答某地现在几点、跨时区换算会议时间,或把日期转成时间戳和周数,而不是让模型自行猜测。
运行要求
需要远程 Streamable HTTP 端点,或本地 Node.js 环境通过 npx 或全局安装运行该 npm 包。未声明任何账号、API 密钥、环境变量或请求头。
安装前请注意
README 明确说明该服务器未实现任何身份验证或安全措施,自建 HTTP 端点若可被访问,任何人都能调用。工具均为只读查询,不会修改数据。时区结果取决于服务器自身时钟与时区数据库。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Time,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.mcpcentral-io%2Fmcp-time/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "time": {
      "type": "http",
      "url": "https://mcp.time.mcpcentral.io/"
    }
  }
}

README

MCP Time Server

A Model Context Protocol (MCP) server providing time-related tools with dual-mode support:

  • Stdio transport for local MCP clients (via npm)
  • Streamable HTTP transport for remote access (via Cloudflare Workers)

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

Features

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.

Project Structure

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

Installation

Option 1: Install from npm (Stdio Mode)

Install the package globally or use with npx:

bash
# Global installationnpm install -g @mcpcentral/mcp-time
# Or use directly with npxnpx @mcpcentral/mcp-time

Option 2: Use Remote Server (HTTP Mode)

Connect directly to the deployed Cloudflare Worker:

Example:

https://mcp.time.mcpcentral.io

Usage

Stdio Transport (Local)

Configure your MCP client (e.g., Claude Desktop) to use the stdio transport:

json
{  "mcpServers": {    "time-server": {      "command": "npx",      "args": ["@mcpcentral/mcp-time"]    }  }}

Or with global installation:

json
{  "mcpServers": {    "time-server": {      "command": "/path/to/node/bin/mcp-time"    }  }}

Streamable HTTP Transport (Remote)

Configure your MCP client to use the remote HTTP endpoint:

json
{  "mcpServers": {    "time-server": {      "url": "https://mcp.time.mcpcentral.io",      "transport": "streamable-http"    }  }}

Development

  1. Clone the Repository:

    bash
    git clone https://github.com/mcpcentral-io/mcp-time.gitcd mcp-time
  2. Install Dependencies:

    bash
    npm install
  3. Build: Compile the TypeScript code:

    bash
    npm run build

    (This compiles src/index.ts to dist/index.js)

  4. Test Locally:

    Test Stdio Mode:

    bash
    echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | node dist/index.js

    Test HTTP Mode (via Wrangler):

    bash
    npx wrangler dev

    This will start the server on http://localhost:8787. You can then test with curl or point your MCP client to this local endpoint.

Deployment

Deploy to Cloudflare Workers (HTTP Mode)

  1. Configure Cloudflare:

    bash
    cp wrangler.toml.example wrangler.toml

    Edit wrangler.toml to configure your domain (optional).

  2. Login and Deploy:

    bash
    wrangler loginnpx wrangler deploy

Publish to npm (Stdio Mode)

  1. Build the package:

    bash
    npm run build
  2. Publish:

    bash
    npm publish --access public

Connectors for Streamable HTTP Servers

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 MCP Connector

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:

bash
curl 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"    }]  }'
Anthropic MCP Connector Benefits:
  • No client setup required - Connect directly through the API
  • Native Streamable HTTP support - Designed for servers like this one
OpenAI Agents SDK

OpenAI also supports Streamable HTTP servers through their Agents SDK using the MCPServerStreamableHttp class:

python
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"})
Microsoft Copilot Studio

Microsoft Copilot Studio now supports Streamable HTTP servers with MCP integration generally available. You can connect this server to Copilot Studio by:

  1. Building a custom connector that links your MCP server to Copilot Studio
  2. Adding the tool in Copilot Studio by selecting 'Add a Tool' and searching for your MCP server
  3. Using the server directly in your agents with generative orchestration enabled
More MCP Clients Coming Soon

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:

Testing and Validation

MCP Inspector Tools (HTTP Mode)

Test your server using these web-based inspection tools:

MCPCentral Tools (Recommended)
Official MCP Inspector

The official MCP Inspector is also available:

Testing Steps
  1. Start your server:

    bash
    # Local HTTP servernpx wrangler dev
    # Or use deployed URL: https://mcp.time.mcpcentral.io
  2. Connect with an inspector:

    • Transport: Streamable HTTP
    • URL: http://localhost:8787 or https://mcp.time.mcpcentral.io
    • Click Connect

Command Line Testing (Stdio Mode)

Test the stdio transport directly:

bash
# 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

Available Tools to Test

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 years
  • get_timestamp: Convert date-time strings to Unix timestamps
  • convert_time: Convert between different timezones
  • get_week_year: Get week numbers for specific dates

Example Test Cases

Try these test cases in the inspector:

json
// 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"}

Validation Checklist

Use the inspector to verify:

  • ✅ Server connects successfully
  • ✅ All 6 tools are listed
  • ✅ Tool schemas are properly defined
  • ✅ Tools execute without errors
  • ✅ Results are formatted correctly
  • ✅ Error handling works for invalid inputs

The MCP Inspector provides the most comprehensive way to test your server before integrating it with AI clients.


Authentication & Security Considerations

⚠️ IMPORTANT: This example server has NO authentication or security measures implemented.

来源:README.md,提交 10003c7

工具

6

current_time

Get Current Time

Returns the current time in UTC and a specified or guessed timezone.

输入参数formattimezone

relative_time

Get Relative Time

Calculates the relative time from now to a given time string.

输入参数time必填

days_in_month

Get Days in Month

Returns the number of days in the month of a given date.

输入参数date

get_timestamp

Get Timestamp

Converts a date-time string to a Unix timestamp in milliseconds.

输入参数time

convert_time

Convert Timezone

Converts a time from a source timezone to a target timezone.

输入参数time必填sourceTimezone必填targetTimezone必填

get_week_year

Get Week of Year

Returns the week and ISO week number for a given date.

输入参数date

版本历史

1
  1. v0.0.3最新Sep 16, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。

其他 Mcpcentral 集成