DateTime Context Provider

搜索与获取

by pinkpixel-dev

Provide LLMs with the current date and time context based on the server's system clock. Enable your agents to access accurate and up-to-date temporal information seamlessly. Simplify time-related queries and operations within your LLM workflows.

什么是 DateTime Context Provider

Provide LLMs with the current date and time context based on the server's system clock. Enable your agents to access accurate and up-to-date temporal information seamlessly. Simplify time-related queries and operations within your LLM workflows.

核心功能 (1 个工具)

get_current_datetime

Get the current server date and time. Optionally specify a timezone (e.g., 'America/New_York', 'Europe/London', 'Asia/Tokyo'). Defaults to server's configured timezone or UTC.

README

<div align="center"> <img src="./icon.png" alt="Date Time MCP Icon" width="300"/> </div>

Date & Time MCP Server

A powerful MCP server that provides LLMs with current date and time context with comprehensive timezone support. Get the current time in any timezone, with configurable defaults and intelligent fallbacks.

This is a TypeScript-based MCP server built with the Model Context Protocol that demonstrates timezone-aware datetime functionality.

Features

Tools

  • get_current_datetime: Returns the current date and time with full timezone support
    • Optional timezone parameter: Specify any IANA timezone (e.g., America/New_York, Europe/London, Asia/Tokyo)
    • Configurable defaults: Set server default timezone via environment variables
    • Smart fallbacks: Automatically falls back to UTC if no timezone is configured
    • Robust validation: Validates timezone identifiers and provides helpful error messages
    • ISO-compatible format: Returns properly formatted datetime strings with timezone information

Installation

There are two ways to install and configure this MCP server:

Installing via Smithery

To install datetime-mcp for Claude Desktop automatically via Smithery:

bash
npx -y @smithery/cli install @pinkpixel-dev/datetime-mcp --client claude

1. Installation from NPM (Recommended)

Install the package globally using npm:

bash
npm install -g @pinkpixel/datetime-mcp

Then, add the following configuration to your MCP client's settings file.

Basic Configuration (Uses UTC)

json
{
  "mcpServers": {
    "datetime": {
      "command": "npx",
      "args": [
        "-y",
        "@pinkpixel/datetime-mcp"
      ]
    }
  }
}

Configuration with Default Timezone

json
{
  "mcpServers": {
    "datetime": {
      "command": "npx",
      "args": [
        "-y",
        "@pinkpixel/datetime-mcp"
      ],
      "env": {
        "TZ": "America/New_York"
      }
    }
  }
}

2. Local Development Setup

If you want to run the server directly from a cloned repository for development or testing:

  1. Clone the repository:

    bash
    # git clone https://github.com/pinkpixel/datetime-mcp.git
    cd datetime-mcp
    
  2. Install dependencies:

    bash
    npm install
    
  3. Build the server:

    bash
    npm run build
    
  4. Add the following configuration to your MCP client's settings file, making sure to replace /path/to/datetime-mcp with the actual absolute path to where you cloned the repository:

    Basic Local Configuration

    json
    {
      "mcpServers": {
        "datetime-local": {
          "command": "node",
          "args": ["/path/to/datetime-mcp/build/index.js"],
        }
      }
    }
    

    Local Configuration with Timezone

    json
    {
      "mcpServers": {
        "datetime-local": {
          "command": "node",
          "args": ["/path/to/datetime-mcp/build/index.js"],
          "env": {
            "TZ": "Europe/London"
          }
        }
      }
    }
    

(Restart your MCP client application after updating the settings)

🌍 Timezone Configuration Examples

Common Timezone Identifiers

United States

json
"TZ": "America/New_York"      // Eastern Time (EST/EDT)
"TZ": "America/Chicago"       // Central Time (CST/CDT)
"TZ": "America/Denver"        // Mountain Time (MST/MDT)
"TZ": "America/Los_Angeles"   // Pacific Time (PST/PDT)
"TZ": "America/Phoenix"       // Arizona (no DST)
"TZ": "America/Anchorage"     // Alaska Time
"TZ": "America/Honolulu"      // Hawaii Time

Europe

json
"TZ": "Europe/London"         // GMT/BST (Greenwich Mean Time)
"TZ": "Europe/Paris"          // CET/CEST (Central European Time)
"TZ": "Europe/Berlin"         // CET/CEST
"TZ": "Europe/Rome"           // CET/CEST
"TZ": "Europe/Madrid"         // CET/CEST
"TZ": "Europe/Amsterdam"      // CET/CEST
"TZ": "Europe/Stockholm"      // CET/CEST
"TZ": "Europe/Moscow"         // MSK (Moscow Time)

Asia

json
"TZ": "Asia/Tokyo"            // JST (Japan Standard Time)
"TZ": "Asia/Shanghai"         // CST (China Standard Time)
"TZ": "Asia/Seoul"            // KST (Korea Standard Time)
"TZ": "Asia/Kolkata"          // IST (India Standard Time)
"TZ": "Asia/Dubai"            // GST (Gulf Standard Time)
"TZ": "Asia/Singapore"        // SGT (Singapore Time)
"TZ": "Asia/Bangkok"          // ICT (Indochina Time)

Other Regions

json
"TZ": "Australia/Sydney"      // AEST/AEDT (Australian Eastern)
"TZ": "Australia/Melbourne"   // AEST/AEDT
"TZ": "Australia/Perth"       // AWST (Australian Western)
"TZ": "Pacific/Auckland"      // NZST/NZDT (New Zealand)
"TZ": "Africa/Cairo"          // EET (Eastern European Time)
"TZ": "America/Sao_Paulo"     // BRT (Brazil Time)
"TZ": "UTC"                   // Coordinated Universal Time

Usage Examples

Tool Usage Without Timezone Parameter

code
User: What time is it?
Assistant: (calls get_current_datetime with no parameters)
Response: "The current date and time is: 2025-09-06T19:30:00.000-04:00 (America/New_York)"

Tool Usage With Timezone Parameter

code
User: What time is it in Tokyo?
Assistant: (calls get_current_datetime with timezone: "Asia/Tokyo")
Response: "The current date and time in Asia/Tokyo is: 2025-09-07T08:30:00.000+09:00"

Multiple Timezone Queries

code
User: What time is it in London and Los Angeles?
Assistant: 
- London: (calls with timezone: "Europe/London")
- Los Angeles: (calls with timezone: "America/Los_Angeles")

2. Local Development Setup

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:

bash
npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

License 📄

Apache 2.0 License - Copyright (c) 2025 Pink Pixel

常见问题

DateTime Context Provider 是什么?

Provide LLMs with the current date and time context based on the server's system clock. Enable your agents to access accurate and up-to-date temporal information seamlessly. Simplify time-related queries and operations within your LLM workflows.

DateTime Context Provider 提供哪些工具?

提供 1 个工具,包括 get_current_datetime

相关 Skills

技能搜索

by daymade

Universal
热门

通过CCPM直接搜索、查看、安装、更新和卸载Claude Code Skill,适合查找PDF、代码审查等场景插件,也能列出已装Skill并自动执行命令返回结果。

想给Claude Code找对技能时,用它能一站式搜索、安装和管理CCPM注册表里的能力,省去到处翻找的时间。

搜索与获取
未扫描1.4k

深度研究

by daymade

Universal
热门

围绕既定模板拆题、多轮检索、整理证据表并交叉校验引用,产出格式严格、可追溯的研究报告,适合市场调研、竞品分析、政策追踪等高要求写作任务

把网页搜索、信息检索和研究分析串成一条链路,适合需要快速汇总线索、做深度判断的开发与研究工作。

搜索与获取
未扫描1.4k

标准研究员

by levnikolaevich

Universal

基于项目技术栈和 Epic/Story 需求,用 MCP Ref 检索相关 RFC、行业标准与架构模式,整理成可直接写入 Story Technical Notes 的研究结论与参考链接。

做技术方案时先让标准研究员帮你查标准与设计模式,基于 MCP Ref 产出可复用的技术注释研究,省下大量检索整理时间。

搜索与获取
未扫描559

相关 MCP Server

网页抓取

编辑精选

by Anthropic

热门

Fetch 是 MCP 官方参考服务器,让 AI 能抓取网页并转为 Markdown 格式。

这个服务器解决了 AI 直接处理网页内容时格式混乱的问题,适合需要让 Claude 分析在线文档或新闻的开发者。不过作为参考实现,它缺乏生产级的安全配置,你得自己处理反爬虫和隐私风险。

搜索与获取
89.8k

Brave 搜索

编辑精选

by Anthropic

热门

Brave Search 是让 Claude 直接调用 Brave 搜索 API 获取实时网络信息的 MCP 服务器。

如果你想让 AI 助手帮你搜索最新资讯或技术文档,这个工具能绕过传统搜索的限制,直接返回结构化数据。特别适合需要实时信息的开发者,比如查 API 更新或竞品动态。不过它依赖 Brave 的 API 配额,高频使用可能受限。

搜索与获取
89.7k

by Anthropic

热门

Puppeteer 是让 Claude 自动操作浏览器进行网页抓取和测试的 MCP 服务器。

这个服务器解决了手动编写 Puppeteer 脚本的繁琐问题,适合需要自动化网页交互的开发者,比如抓取动态内容或做端到端测试。不过,作为参考实现,它可能缺少生产级的安全防护,建议在可控环境中使用。

搜索与获取
89.2k

评论