{"id":50717607,"url":"https://github.com/ptbsare/qweather-mcp-server","last_synced_at":"2026-06-09T20:01:46.249Z","repository":{"id":362062244,"uuid":"1257056345","full_name":"ptbsare/qweather-mcp-server","owner":"ptbsare","description":"和风天气MCP","archived":false,"fork":false,"pushed_at":"2026-06-02T12:56:40.000Z","size":816,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-02T13:11:28.858Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ptbsare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-02T10:21:11.000Z","updated_at":"2026-06-02T12:56:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ptbsare/qweather-mcp-server","commit_stats":null,"previous_names":["ptbsare/qweather-mcp-server"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ptbsare/qweather-mcp-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptbsare%2Fqweather-mcp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptbsare%2Fqweather-mcp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptbsare%2Fqweather-mcp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptbsare%2Fqweather-mcp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ptbsare","download_url":"https://codeload.github.com/ptbsare/qweather-mcp-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptbsare%2Fqweather-mcp-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34123172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-09T20:01:41.936Z","updated_at":"2026-06-09T20:01:46.242Z","avatar_url":"https://github.com/ptbsare.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 和风天气 MCP 服务 (qweather-mcp-server)\n\n基于 Model Context Protocol (MCP) 的和风天气服务，提供天气预报、气象预警、空气质量、历史数据、天文信息等气象数据查询功能。\n\n## 快速开始\n\n使用 `uvx` 直接运行（无需安装）：\n\n```bash\nHEFENG_API_HOST=你的API主机地址 HEFENG_API_KEY=你的API密钥 uvx --from git+https://github.com/ptbsare/qweather-mcp-server.git qweather-mcp-server stdio\n```\n\n## 配置\n\n### 环境变量\n\n| 变量 | 必填 | 默认值 | 说明 |\n|---|---|---|---|\n| `HEFENG_API_HOST` | ✅ | - | API 主机地址 |\n| `HEFENG_API_KEY` | ✅* | - | API KEY |\n| `HEFENG_PROJECT_ID` | - | - | 项目 ID（JWT 模式） |\n| `HEFENG_KEY_ID` | - | - | 凭据 ID（JWT 模式） |\n| `HEFENG_PRIVATE_KEY_PATH` | - | - | 私钥文件路径（JWT 模式） |\n| `HEFENG_MAX_RETRIES` | - | 3 | 最大重试次数 |\n| `HEFENG_CACHE_TTL` | - | 600 | 城市缓存 TTL（秒） |\n\n*API KEY 和 JWT 认证二选一，推荐 API KEY。\n\n### 客户端配置\n\n```json\n{\n  \"qweather-mcp-server\": {\n    \"command\": \"uvx\",\n    \"args\": [\"--from\", \"git+https://github.com/ptbsare/qweather-mcp-server.git\", \"qweather-mcp-server\", \"stdio\"],\n    \"env\": {\n      \"HEFENG_API_HOST\": \"你的API主机地址\",\n      \"HEFENG_API_KEY\": \"你的API密钥\"\n    }\n  }\n}\n```\n\n## 数据覆盖\n\n覆盖和风天气 API 以下全部数据类别（不含海洋和热带气旋）：\n\n### 天气类\n\n| 数据项目 | MCP 工具 | 时间范围 | 地理范围 |\n|---|---|---|---|\n| 实况天气 | `get_weather_now` | 实时 | 全球 |\n| 逐天预报 | `get_weather` | 1-30天 | 全球 |\n| 逐小时预报 | `get_hourly_weather` | 1-168小时 | 全球 |\n| 格点实况天气 | `get_grid_weather_now` | 实时 | 全球 |\n| 格点逐天预报 | `get_grid_weather_daily` | 1-7天 | 全球 |\n| 格点逐小时预报 | `get_grid_weather_hourly` | 1-72小时 | 全球 |\n| 分钟级降水 | `get_minutely_5m` | 1-2小时 | 中国 |\n\n### 天气指数\n\n| 数据项目 | MCP 工具 |\n|---|---|\n| 16种生活指数 | `get_indices` |\n\n### 空气类\n\n| 数据项目 | MCP 工具 | 时间范围 | 地理范围 |\n|---|---|---|---|\n| 空气质量实况 | `get_air_quality` | 实时 | 全球 |\n| 空气质量每日预报 | `get_air_quality_daily` | 1-7天 | 全球 |\n| 空气质量每小时预报 | `get_air_quality_hourly` | 1-72小时 | 全球 |\n| 监测站数据 | `get_air_quality_stations` | 实时 | 全球 |\n\n### 预警类\n\n| 数据项目 | MCP 工具 |\n|---|---|\n| 灾害预警 | `get_warning` |\n\n### 天文类\n\n| 数据项目 | MCP 工具 | 时间范围 |\n|---|---|---|\n| 日出日落时间 | `get_astronomy_sun` | 1-60天 |\n| 月升月落时间/月相 | `get_astronomy_moon` | 1-60天 |\n\n### 时光机（历史数据）\n\n| 数据项目 | MCP 工具 | 时间范围 |\n|---|---|---|\n| 历史天气 | `get_weather_history` | 最多10天 |\n| 历史空气质量 | `get_air_quality_history` | 最多10天 |\n\n### GeoAPI\n\n| 数据项目 | MCP 工具 |\n|---|---|\n| 热门城市 | `get_top_cities` |\n| POI关键词搜索 | `search_poi` |\n| POI范围搜索 | `search_poi_range` |\n\n## MCP 工具\n\n### get_weather_now - 实时天气\n\n```\nget_weather_now(city=\"北京\")\nget_weather_now(location=\"101010100\")\n```\n\n### get_weather - 逐天预报\n\n```\nget_weather(\"北京\", \"3d\")\nget_weather(\"上海\", \"7d\")\n```\n\n### get_hourly_weather - 逐小时预报\n\n```\nget_hourly_weather(hours=\"24h\", city=\"北京\")\nget_hourly_weather(hours=\"72h\", city=\"上海\")\n```\n\n### get_minutely_5m - 分钟级降水\n\n```\nget_minutely_5m(\"北京\")\nget_minutely_5m(\"116.41,39.92\")\n```\n\n### get_warning - 气象预警\n\n```\nget_warning(\"北京\")\n```\n\n### get_indices - 生活指数\n\n```\nget_indices(\"北京\")\nget_indices(\"上海\", \"3d\")\nget_indices(\"广州\", \"1d\", \"1,2,3\")\n```\n\n指数类型：1-运动 2-洗车 3-穿衣 4-感冒 5-紫外线 6-旅游 7-过敏 8-舒适度 9-交通 10-防晒 11-化妆 12-空调 13-晾晒 14-钓鱼 15-太阳镜 16-空气污染扩散\n\n### get_astronomy_sun - 日出日落\n\n```\nget_astronomy_sun(\"北京\", \"20260615\")\n```\n\n### get_astronomy_moon - 月相月升月落\n\n```\nget_astronomy_moon(\"北京\", \"20260615\")\n```\n\n### get_air_quality - 实时空气质量\n\n```\nget_air_quality(\"北京\")\n```\n\n### get_air_quality_hourly - 空气质量小时预报\n\n```\nget_air_quality_hourly(\"39.92,116.41\", \"24h\")\n```\n\n### get_air_quality_daily - 空气质量每日预报\n\n```\nget_air_quality_daily(\"39.92,116.41\", \"3d\")\n```\n\n### get_air_quality_stations - 监测站数据\n\n```\nget_air_quality_stations(\"P58911\")\n```\n\n### get_air_quality_history - 历史空气质量\n\n```\nget_air_quality_history(\"北京\", days=3)\n```\n\n### get_grid_weather_now - 格点实时天气\n\n```\nget_grid_weather_now(\"116.41,39.92\")\n```\n\n### get_grid_weather_daily - 格点每日预报\n\n```\nget_grid_weather_daily(\"116.41,39.92\", \"3d\")\n```\n\n### get_grid_weather_hourly - 格点逐小时预报\n\n```\nget_grid_weather_hourly(\"116.41,39.92\", \"24h\")\n```\n\n### get_weather_history - 历史天气\n\n```\nget_weather_history(city=\"北京\", days=7)\n```\n\n### get_top_cities - 热门城市\n\n```\nget_top_cities(10, \"cn\")\n```\n\n### search_poi - POI关键词搜索\n\n```\nsearch_poi(\"北京\", \"故宫\", \"scenic\")\nsearch_poi(\"116.41,39.92\", \"博物馆\", \"scenic\", radius=5000)\n```\n\n### search_poi_range - POI范围搜索\n\n```\nsearch_poi_range(\"116.41,39.92\", \"scenic\", radius=5)\n```\n\n## 项目结构\n\n```\nqweather-mcp-server/\n├── pyproject.toml\n├── LICENSE\n├── README.md\n├── .env.example\n└── src/qweather_mcp_server/\n    ├── __init__.py\n    ├── main.py\n    ├── core/\n    │   ├── config.py\n    │   ├── http.py\n    │   └── cache.py\n    ├── tools/\n    │   ├── weather.py\n    │   ├── air.py\n    │   ├── grid.py\n    │   └── geo.py\n    └── utils/\n```\n\n## 相关链接\n\n- [和风天气官网](https://www.qweather.com/)\n- [和风天气开发者控制台](https://console.qweather.com/project/)\n- [和风天气 API 文档](https://dev.qweather.com/docs/api/)\n- [Model Context Protocol](https://modelcontextprotocol.io/)\n\n## 许可证\n\nGPL-3.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fptbsare%2Fqweather-mcp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fptbsare%2Fqweather-mcp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fptbsare%2Fqweather-mcp-server/lists"}