Skip to main content
Glama

Time MCP Server

by ConechoAI

时间 MCP 服务器

提供时间和时区转换功能的模型上下文协议 (MLM) 服务器。该服务器使 LLM 能够获取当前时间信息,并使用 IANA 时区名称执行时区转换,并自动检测系统时区。

可用工具

  • get_current_time - 获取特定时区或系统时区的当前时间。
    • 必需参数:
      • timezone (字符串):IANA 时区名称(例如,“America/New_York”、“Europe/London”)
  • convert_time - 在时区之间转换时间。
    • 必需参数:
      • source_timezone (字符串):源 IANA 时区名称
      • time (字符串):24 小时格式的时间(HH:MM)
      • target_timezone (字符串):目标 IANA 时区名称

安装

使用 uv(推荐)

使用uv时无需特殊安装。我们将使用uvx直接运行mcp-server-time

使用 PIP

或者,您可以通过 pip 安装time-mcp-local

pip install time-mcp-local

安装后,您可以使用以下命令将其作为脚本运行:

python -m time-mcp-local

配置

为 Claude.app 配置

添加到您的 Claude 设置:

"mcpServers": { "time": { "command": "uvx", "args": ["time-mcp-local"] } }
"mcpServers": { "time": { "command": "python", "args": ["-m", "time_mcp_local"] } }

为 Zed 配置

添加到您的 Zed settings.json:

"context_servers": [ "mcp-server-time": { "command": "uvx", "args": ["time-mcp-local"] } ],
"context_servers": { "mcp-server-time": { "command": "python", "args": ["-m", "time_mcp_local"] } },

自定义 - 系统时区

默认情况下,服务器会自动检测您系统的时区。您可以通过在配置文件的args列表中添加参数--local-timezone来覆盖此设置。

例子:

{ "command": "python", "args": ["-m", "time_mcp_local", "--local-timezone=America/New_York"] }

交互示例

  1. 获取当前时间:
{ "name": "get_current_time", "arguments": { "timezone": "Europe/Warsaw" } }

回复:

{ "timezone": "Europe/Warsaw", "datetime": "2024-01-01T13:00:00+01:00", "is_dst": false }
  1. 在时区之间转换时间:
{ "name": "convert_time", "arguments": { "source_timezone": "America/New_York", "time": "16:30", "target_timezone": "Asia/Tokyo" } }

回复:

{ "source": { "timezone": "America/New_York", "datetime": "2024-01-01T12:30:00-05:00", "is_dst": false }, "target": { "timezone": "Asia/Tokyo", "datetime": "2024-01-01T12:30:00+09:00", "is_dst": false }, "time_difference": "+13.0h", }

调试

您可以使用 MCP 检查器来调试服务器。对于 uvx 安装:

npx @modelcontextprotocol/inspector uvx time-mcp-local

或者,如果您已将软件包安装在特定目录中或正在其上进行开发:

cd path/to/servers/src/time npx @modelcontextprotocol/inspector uv run time-mcp-local

克劳德的问题示例

  1. “现在几点?”(将使用系统时区)
  2. “东京现在几点?”
  3. “当纽约时间下午 4 点时,伦敦时间是几点?”
  4. “将东京时间上午 9:30 转换为纽约时间”

建造

uv build --wheel uv publish --token xxx

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

提供时间和时区转换功能的模型上下文协议服务器,使 LLM 能够获取当前时间信息并使用 IANA 时区名称执行时区转换。

  1. 可用工具
    1. 安装
      1. 使用 uv(推荐)
      2. 使用 PIP
    2. 配置
      1. 为 Claude.app 配置
      2. 为 Zed 配置
      3. 自定义 - 系统时区
    3. 交互示例
      1. 调试
        1. 克劳德的问题示例
          1. 建造

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              A Model Context Protocol server that provides LLM Agents with a comprehensive toolset for IP geolocation, network diagnostics, system monitoring, cryptographic operations, and QR code generation.
              Last updated -
              16
              3
              4
              TypeScript
              Apache 2.0
            • A
              security
              A
              license
              A
              quality
              A Model Context Protocol server that gives LLMs the ability to interact with Ethereum networks, manage wallets, query blockchain data, and execute smart contract operations through a standardized interface.
              Last updated -
              31
              323
              2
              TypeScript
              MIT License
            • A
              security
              A
              license
              A
              quality
              A Model Context Protocol server that provides basic mathematical and statistical functions to LLMs, enabling them to perform accurate numerical calculations through a simple API.
              Last updated -
              13
              13
              TypeScript
              MIT License
            • -
              security
              F
              license
              -
              quality
              A Model Context Protocol server that connects LLMs to the Compiler Explorer API, enabling them to compile code, explore compiler features, and analyze optimizations across different compilers and languages.
              Last updated -
              Python

            View all related MCP servers

            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/ConechoAI/time-mcp-local'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server