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

mcp-local-time

v1.0.3

Published

MCP server for getting current time - use via npx

Readme

MCP Time Server

基于 Model Context Protocol (MCP) 的时间服务器,通过 npx 提供给第三方使用。

功能特性

  • ✅ 使用 Stdio 传输(标准 MCP 传输方式)
  • ✅ 通过 npx 直接运行,无需服务器部署
  • ✅ 获取当前时间工具

安装依赖(开发用)

npm install

发布到 npm

发布后,第三方可以通过 npx 直接使用:

npm publish

第三方使用方式

方式 1:通过 npx 直接运行

npx -y mcp-local-time

方式 2:在 MCP 客户端配置中使用

在 MCP 客户端(如 Claude Desktop)的配置文件中:

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

方式 3:本地安装后使用

npm install -g mcp-local-time
mcp-local-time

本地开发

运行服务器

npm start
# 或
node server.js

使用 MCP Inspector 调试

npx @modelcontextprotocol/inspector node server.js

工具说明

get_current_time

返回当前本地时间,格式形如:现在是晚上 21:05。工具会根据小时自动判定“凌晨 / 上午 / 中午 / 晚上”,并输出 24 小时制的具体时间。

参数:

  • 无需参数

返回示例:

{
  "content": [
    {
      "type": "text",
      "text": "现在是上午 09:15"
    }
  ]
}

第三方使用

在 Claude Desktop 中配置

  1. 编辑配置文件(macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  2. 添加以下配置:
{
  "mcpServers": {
    "local-time": {
      "command": "npx",
      "args": ["-y", "mcp-local-time"]
    }
  }
}
  1. 重启 Claude Desktop

使用方式

配置完成后,在对话中直接请求获取时间即可,例如:

  • “现在几点了?”
  • “告诉我当前时间”
  • “现在是什么时段?”

AI 会自动调用工具并返回结果。

详细使用指南请查看 USAGE_GUIDE.md

项目结构

  • server.js - MCP 服务器主文件(Stdio 传输)
  • package.json - 项目配置和依赖
  • mcp.json - MCP 服务器配置示例

环境要求

  • Node.js >= 18.0.0

注意事项

  1. 使用 npx 时,-y 参数会自动确认安装,无需交互
  2. 首次运行时会自动下载包,后续运行会使用缓存
  3. 获取时间功能在客户端本地运行,不需要服务器