Weather-X 天气查询工具
Weather-X 是一个基于 FastMCP 框架开发的天气查询工具,可以获取中国各城市的天气信息和警报。
功能特性
- 获取指定城市的天气信息
- 查询天气警报
- 基于高德地图天气API实现
- 支持异步请求处理
安装
pip install weather-x
或从源码安装:
git clone <repository-url>
cd weather-x
pip install -e .
使用方法
from weather import mcp
# 运行MCP服务器
mcp.run(transport='stdio')
或直接运行:
python main.py
API接口
get_alerts(city: str) -> str
获取指定城市的天气警报信息。
参数:
- city: 城市名称(例如:北京、上海)
返回:
- 包含天气信息的字符串
依赖
- Python >= 3.12
- fastmcp >= 2.12.4
- httpx >= 0.28.1
- mcp[cli] >= 1.18.0
配置
项目使用高德地图天气API,需要在代码中配置API密钥。
开发
安装开发依赖:
pip install -e ".[dev]"
许可证
MIT
Metadata
Release files for weather-mcp-x 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| weather_mcp_x-0.1.2.tar.gz | 2.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| weather_mcp_x-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.5 kB
Release files / weather_mcp_x-0.1.2.tar.gz
| Download URL | weather_mcp_x-0.1.2.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
555d951280971b316cb16cbf24216d16483b6aede640330d56861df2d24e2f87
|
|
BLAKE2b-256 checksum How to use checksums |
50cf64a5e2f4d6a07912b4d4c43d5bf4dad8e905d8e63dbedc665a9988dd6489
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Release files / weather_mcp_x-0.1.2-py3-none-any.whl
| Download URL | weather_mcp_x-0.1.2-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
200b53b629de652aa39bf10ae7e89b94b8bfe4ac5bb00962d3da5fb6f5d3b8b7
|
|
BLAKE2b-256 checksum How to use checksums |
bc17112928e43e383516e119e5bdbe57e6dd4ed6d1d63518a1a9e3a24ddc44c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Security for weather-mcp-x 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.