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

@supos-os-edge/demo-mcp-server

v1.0.4

Published

一个基于 Model Context Protocol (MCP) 的演示服务器,提供天气查询功能。

Readme

Demo MCP Server

一个基于 Model Context Protocol (MCP) 的演示服务器,提供天气查询功能。

功能特性

  • 🌤️ 天气查询:获取指定城市的实时天气信息
  • 🔄 多种传输协议:支持 stdio、SSE 和 HTTP 流式传输
  • 🛠️ 标准化接口:基于 MCP 协议,兼容各种 MCP 客户端
  • 📦 易于部署:提供 npm 包和 CLI 工具

安装

作为全局工具安装

npm install -g @supos-os-edge/demo-mcp-server

作为项目依赖安装

npm install @supos-os-edge/demo-mcp-server

使用方法

1. 标准输入输出模式 (stdio)

# 使用全局安装
npx @supos-os-edge/demo-mcp-server stdio

# 或使用本地安装
node_modules/.bin/@supos-os-edge/demo-mcp-server stdio

2. SSE 服务器模式

# 启动 SSE 服务器
npx @supos-os-edge/demo-mcp-server sse

3. HTTP 流式传输模式

# 启动 HTTP 流式传输服务器
npx @supos-os-edge/demo-mcp-server streamableHttp

配置

在 Claude Desktop 中配置

在 Claude Desktop 的配置文件中添加:

{
  "mcpServers": {
    "demo-mcp-server": {
      "command": "npx",
      "args": ["-y", "@supos-os-edge/demo-mcp-server"]
    }
  }
}

环境变量

  • PORT:服务器端口(默认为 3000)
  • HOST:服务器主机(默认为 localhost)

可用工具

get_weather

获取指定城市的天气信息。

参数:

  • city:城市名称(例如:北京、上海、杭州)

返回示例:

🌤️ 天气信息:

📍 位置:浙江省 - 杭州市
🌡️ 温度:25°C
🌤️ 天气:多云 (多云)
💧 湿度:65%
💨 风向:东南风 3级
🌊 气压:1013hPa
💦 降水量:0mm
🕐 更新时间:2024-01-01 12:00:00

天气代码:01

开发

项目结构

src/
├── index.ts              # 主入口文件
├── server/
│   └── index.ts          # MCP 服务器实现
├── tools/
│   └── weather.ts        # 天气工具实现
├── transport/
│   ├── stdio.ts          # 标准输入输出传输
│   ├── sse.ts            # SSE 传输
│   └── streamableHttp.ts # HTTP 流式传输
└── utils/
    └── log.ts            # 日志工具

构建项目

# 安装依赖
pnpm install

# 开发模式(监听文件变化)
pnpm run dev

# 构建项目
pnpm run build

# 启动服务器
pnpm start

测试

# 使用 MCP 检查器测试
pnpm run inspector

API 文档

天气数据来源

本服务使用腾讯天气 API 获取实时天气数据。

错误处理

  • 城市不存在:返回友好的错误提示
  • 网络错误:提供重试建议
  • 参数错误:详细的参数验证信息

许可证

ISC License

贡献

欢迎提交 Issue 和 Pull Request!

更新日志

v1.0.1

  • 初始版本发布
  • 实现基本的天气查询功能
  • 支持多种传输协议

技术支持

如有问题,请提交 Issue 或联系开发团队。