npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

local-time-mcp-service-ysd

v1.0.0

Published

一个简单的MCP时间服务器,提供获取当前系统时间的功能

Downloads

9

Readme

本地时间 MCP 服务器

一个简单而实用的 Model Context Protocol (MCP) 时间服务器,提供获取当前系统时间的功能。

特性

  • 🕒 获取当前系统时间,支持自定义格式
  • 📝 完整的日志记录功能
  • 🔧 易于配置和使用
  • 📦 支持 npx 直接运行
  • 🌐 兼容 MCP 协议标准

安装

使用 npx(推荐)

无需安装,直接运行:

npx local-time-mcp-service-ysd

全局安装

npm install -g local-time-mcp-service-ysd

项目中安装

npm install local-time-mcp-service-ysd

使用方法

基本使用

启动 MCP 时间服务器:

npx local-time-mcp-service-ysd

服务器将通过标准输入输出(STDIO)监听 MCP 协议请求。

在 MCP 客户端中配置

在您的 MCP 客户端配置文件中添加以下配置:

{
  "mcpServers": {
    "time-server": {
      "command": "npx",
      "args": ["local-time-mcp-service-ysd"],
      "env": {}
    }
  }
}

或者如果您已经全局安装:

{
  "mcpServers": {
    "time-server": {
      "command": "local-time-mcp-service-ysd",
      "args": [],
      "env": {}
    }
  }
}

可用工具

getSystemTime

获取当前系统时间。

参数:

  • format (可选): 时间格式字符串,默认为 YYYY-MM-DD HH:mm:ss

示例格式:

  • YYYY-MM-DD HH:mm:ss2024-01-15 14:30:25
  • YYYY/MM/DD2024/01/15
  • HH:mm:ss14:30:25
  • MMMM Do YYYY, h:mm:ss aJanuary 15th 2024, 2:30:25 pm

使用示例:

{
  "name": "getSystemTime",
  "arguments": {
    "format": "YYYY-MM-DD HH:mm:ss"
  }
}

日志功能

服务器会自动创建日志文件,记录运行状态:

  • 日志文件位置:logs/mcp-time-server-YYYY-MM-DD.log
  • 包含启动时间、请求记录、错误信息等
  • 同时输出到控制台和文件

开发和调试

本地开发

# 克隆项目
git clone <your-repo-url>
cd local-time-mcp-service-ysd

# 安装依赖
npm install

# 运行服务器
node index.js

测试

您可以使用任何支持 MCP 协议的客户端来测试服务器功能。

技术栈

  • Node.js (>= 18)
  • @modelcontextprotocol/sdk - MCP 协议实现
  • dayjs - 时间处理和格式化

许可证

MIT License

贡献

欢迎提交 Issue 和 Pull Request!

更新日志

v1.0.0

  • 初始版本
  • 支持获取系统时间
  • 完整的日志记录功能
  • 支持自定义时间格式