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-alarm-clock

v1.0.4

Published

MCP Alarm Clock for xiaozhi-client integration

Readme

MCP闹钟应用

一个基于Node.js的MCP闹钟应用,可以集成到xiaozhi-client项目中供AI小智使用。

功能特性

  • ✅ 支持创建未来秒级闹钟
  • ✅ 支持闹钟的查询、删除操作
  • ✅ 支持闹钟启用/禁用切换
  • ✅ 支持音乐提醒和人工提醒两种模式
  • ✅ 数据持久化存储
  • ✅ 符合MCP协议标准

安装依赖

npm install

集成到xiaozhi-client

方法1: 通过npm安装(推荐)

首先将此项目发布为npm包,然后在xiaozhi-client项目中安装:

npm install mcp-alarm-clock

然后在xiaozhi-client项目的xiaozhi.config.json文件中添加以下配置:

{
  "mcpServers": {
    "alarm-clock": {
      "command": "npx",
      "args": ["mcp-alarm-clock"]
    }
  }
}

方法2: 本地路径引用

如果不想发布到npm,也可以在xiaozhi-client项目中直接引用本地路径:

{
  "mcpServers": {
    "alarm-clock": {
      "command": "node",
      "args": ["index.js"],
      "cwd": "/path/to/mcp-clock"
    }
  }
}

请将/path/to/mcp-clock替换为此项目的实际路径。

MCP接口说明

createAlarm

创建一个新的闹钟

参数:

  • name (string): 闹钟名称
  • time (string): 闹钟触发时间 (ISO 8601格式)
  • reminderType (string): 提醒类型: "sound"(音乐提醒) 或 "manual"(人工提醒)

listAlarms

列出所有闹钟

getAlarm

根据ID获取闹钟详情

参数:

  • id (string): 闹钟ID

deleteAlarm

删除指定的闹钟

参数:

  • deleteId (string): 要删除的闹钟ID

toggleAlarm

启用或禁用闹钟

参数:

  • toggleId (string): 闹钟ID
  • enabled (boolean): true表示启用,false表示禁用

开发和构建

发布为npm包

  1. 注册npm账号
  2. 登录npm: npm login
  3. 发布包: npm publish

本地测试

# 启动应用
node index.js

# 或者使用CLI
node bin/cli.js

数据存储

闹钟数据存储在项目目录下的alarms.json文件中。

故障排除

1. 闹钟应用无法启动

检查:

  • Node.js是否已安装(建议使用Node.js 14或更高版本)
  • 依赖是否已正确安装(npm install)
  • 路径配置是否正确

2. MCP通信问题

检查:

  • xiaozhi-client配置是否正确
  • CLI是否能正常响应JSON-RPC请求
  • 端口或权限问题

3. 闹钟不触发

检查:

  • 系统时间是否正确
  • 闹钟时间是否设置正确
  • 应用是否有足够的运行时间

4. npm安装错误

如果遇到依赖解析错误,可以尝试以下解决方案:

  1. 清除npm缓存:

    npm cache clean --force
  2. 删除node_modules和package-lock.json重新安装:

    rm -rf node_modules package-lock.json
    npm install
  3. 使用--legacy-peer-deps参数安装:

    npm install --legacy-peer-deps
  4. 使用--omit=dev参数只安装生产依赖:

    npm install --omit=dev
  5. 如果仍然遇到ERESOLVE错误,可以尝试:

    npm install --legacy-peer-deps --omit=dev
  6. 或者完全跳过依赖解析:

    npm install --force
  7. 全局安装问题:如果在全局安装时出现问题,请尝试指定版本号进行安装和卸载:

    npm uninstall -g mcp-alarm-clock
    npm install -g [email protected]
  8. 权限问题:在Linux或macOS上,如果遇到权限问题,请使用sudo:

    sudo npm install -g [email protected]
  9. 旧版本问题:如果您之前安装了1.0.0版本并遇到问题,请升级到最新版本:

    npm uninstall -g mcp-alarm-clock
    npm install -g [email protected]

    注意:1.0.0版本由于存在关键bug已被废弃,请勿使用该版本。

  10. 完全清理并重新安装:如果您遇到持续的问题,可以完全清理并重新安装:

    npm uninstall -g mcp-alarm-clock
    npm cache clean --force
    npm install -g [email protected]

    我们也提供了自动化脚本来完成此过程:

    • Windows系统:运行 reinstall-mcp-alarm-clock.bat
    • Unix/Linux/Mac系统:运行 chmod +x ./reinstall-mcp-alarm-clock.sh && ./reinstall-mcp-alarm-clock.sh

MCP协议连接问题

如果遇到MCP协议连接问题(如"Connection closed"错误),请确保:

  1. CLI应用正确处理异步操作
  2. MCP请求和响应通过stdin/stdout正确传输
  3. 使用正确的JSON格式发送MCP请求
  4. 保持CLI进程运行直到收到响应

版本历史

  • 1.0.4: 修复了依赖声明问题,确保安装时使用正确的版本
  • 1.0.3: 修复了一些关键bug(已废弃,请升级到1.0.4)
  • 1.0.0: 初始版本(已废弃,存在关键bug)

许可证

MIT