WeatherWork Consumer MCP Server — 基于 weathercn API 的消费者天气工具集
Reason this release was yanked:
有问题
Project description
WeatherWork Consumer MCP
基于 weathercn API 的消费者天气 MCP 服务,提供 17 个工具(地名解析、实况、预报、预警、空气质量、分钟降水、生活指数、台风、天文、潮汐等)。
安装
pip install weatherwork-consumer-mcp
从本目录源码安装(开发):
cd weatherwork-consumer-mcp
pip install -e .
配置密钥
openAPI 标准模式(推荐普通用户):
export WEATHERCN_OPENAPI_KEY="your_openapi_key"
JV 高阶模式(商务授权):
export WEATHERCN_API_KEY="your_api_key"
export WEATHERCN_API_SECRET="your_api_secret"
设置了
WEATHERCN_OPENAPI_KEY时优先走 openAPI;未设置则使用 JV 凭证。详见.env.example。
运行
安装后可直接启动 MCP(stdio):
weatherwork-consumer-mcp
接入 Claude Desktop
编辑 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"weatherwork": {
"command": "weatherwork-consumer-mcp",
"env": {
"WEATHERCN_OPENAPI_KEY": "your_openapi_key"
}
}
}
}
接入 Cursor
.cursor/mcp.json 示例:
{
"mcpServers": {
"weatherwork": {
"command": "weatherwork-consumer-mcp",
"env": {
"WEATHERCN_OPENAPI_KEY": "your_openapi_key"
}
}
}
}
工具列表
| 工具 | 说明 |
|---|---|
resolve_location |
地名解析与消歧义 |
get_weather_alerts |
气象预警(透传,勿解读) |
get_current_weather |
当前实况 |
get_weather_forecast |
逐日预报 |
get_hourly_forecast |
逐小时预报 |
get_activity_advice |
生活指数与活动建议 |
get_air_quality |
空气质量 |
get_minute_precipitation |
分钟级降水(GCJ-02 坐标) |
get_typhoon_* |
台风(JV) |
get_astronomy_* |
天文(JV) |
get_tidal_* |
潮汐(JV) |
本地测试
pip install -e .
export WEATHERCN_OPENAPI_KEY="..."
python tests/test_tools.py
发布到 PyPI(维护者)
pip install build twine
python -m build
twine upload dist/*
目录结构
weatherwork-consumer-mcp/
├── pyproject.toml
├── README.md
├── .env.example
├── SYSTEM_PROMPT.md
├── tests/test_tools.py
└── src/weatherwork_consumer_mcp/
├── server.py # MCP 入口
├── config.py
├── generate_url.py
└── tools/ # 17 个工具实现
环境要求
- Python 3.11+
- 依赖:
mcp>=1.0.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file weatherwork_consumer_mcp-0.3.1.tar.gz.
File metadata
- Download URL: weatherwork_consumer_mcp-0.3.1.tar.gz
- Upload date:
- Size: 46.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f3716bcc0a8242336844909cdd9898562939df40d78226a7639d333ba5d915e
|
|
| MD5 |
18df01ca8d03e0a09c830133fa29ac28
|
|
| BLAKE2b-256 |
c98e834ca9cce8e6a1d6a9e83ea909932f8ba5d7e49663b4c1975862cded7e5b
|
File details
Details for the file weatherwork_consumer_mcp-0.3.1-py3-none-any.whl.
File metadata
- Download URL: weatherwork_consumer_mcp-0.3.1-py3-none-any.whl
- Upload date:
- Size: 61.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
839834dc7c5ff4c828702a859b997b9a436debc56fcb436d9331b062ee3ba066
|
|
| MD5 |
f57bc68aec2478e9ddde30024a610a9a
|
|
| BLAKE2b-256 |
7d30d652723076307d2ec8eca3d6cde3b284a9ab0f52332ff4d5b62110fb7ee8
|