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 🙏

© 2025 – Pkg Stats / Ryan Hefner

hefeng-weather-mcp

v0.2.5

Published

an mcp server for hefeng weather api

Downloads

17

Readme

HeFeng Weather MCP Server

A Model Context Protocol server that provides weather forecast data for locations in China through HeFeng Weather API.

Features

  • 获取实时天气、逐小时和多天预报
  • 城市名称模糊搜索及经纬度查询
  • 获取天气灾害预警信息
  • 获取天气生活指数(如穿衣、洗车、运动等)
  • 支持JWT认证,API主机可配置

配置参数

  • apiHost:API主机地址(如 https://devapi.qweather.com)
  • privateKey:EdDSA私钥
  • keyId:密钥ID
  • projectId:项目ID

可用工具及参数

1. get-weather

获取实时天气、逐小时或多天预报。

  • location (string, 必填):经纬度或LocationID(如 101010100 或 116.41,39.92)
  • days (string, 可选):now(实时)、24h、72h、168h、3d、7d、10d、15d、30d,默认now

2. city-lookup

根据城市名称模糊搜索,返回经纬度、城市ID等信息。

  • location (string, 必填):城市名称,支持模糊搜索
  • adm (string, 可选):上级行政区划
  • range (string, 可选):搜索范围(如cn)
  • number (number, 可选):返回结果数量,1-20,默认10

3. weather-warning

获取指定地区的天气灾害预警信息。

  • location (string, 必填):LocationID或经纬度
  • lang (string, 可选):多语言,默认zh

4. indices-forecast

获取天气生活指数预报(如穿衣、洗车、运动等)。

  • location (string, 必填):LocationID或经纬度
  • type (string, 必填):指数类型ID,多个用英文逗号分隔(如1,2,3)
  • days (string, 可选):1d或3d,默认1d
  • lang (string, 可选):多语言,默认zh

使用示例

{
  "mcpServers": {
    "hefeng-weather": {
      "command": "npx",
      "args": [
        "hefeng-weather-mcp@latest",
        "--apiHost=https://devapi.qweather.com",
        "--privateKey=${YOUR_PRIVATE_KEY}",
        "--keyId=${YOUR_KEY_ID}",
        "--projectId=${YOUR_PROJECT_ID}"
      ]
    }
  }
}

工具调用示例

get-weather

{
  "name": "get-weather",
  "arguments": { "location": "101010100", "days": "3d" }
}

city-lookup

{
  "name": "city-lookup",
  "arguments": { "location": "北京" }
}

weather-warning

{
  "name": "weather-warning",
  "arguments": { "location": "101010100" }
}

indices-forecast

{
  "name": "indices-forecast",
  "arguments": { "location": "101010100", "type": "1,2", "days": "1d" }
}

License

This MCP server is licensed under the MIT License. For more details, please see the LICENSE file in the project repository.

致谢

本项目基于 https://github.com/shanggqm/hefeng-mcp-weather 开发,感谢原作者开源贡献。