accton-mcpdemo-weather
一个基于 MCP (Model Context Protocol) 的天气查询服务器,通过 OpenWeatherMap API 提供实时天气和未来天气预报。
功能
- 🌍 查询全球城市的当前实时天气(温度、湿度、风速、气压、日出日落等)
- 📅 查询未来 5 天的天气预报(每 3 小时一个时段,含降水概率)
- 🌐 支持中文和英文城市名称
安装
pip install accton-mcpdemo-weather
配置
使用前需要设置环境变量:
export OPENWEATHER_API_KEY="your-api-key"
在 OpenWeatherMap 注册即可免费获取 API Key。
使用
命令行运行
accton-mcpdemo-weather
作为 MCP Server 配置
在 Claude Desktop 或其他 MCP 客户端的配置文件中添加:
{
"mcpServers": {
"weather": {
"command": "uvx",
"args": ["accton-mcpdemo-weather"],
"env": {
"OPENWEATHER_API_KEY": "your-api-key"
}
}
}
}
提供的工具
| 工具 | 说明 |
|---|---|
get_current_weather |
获取指定城市的当前实时天气 |
get_weather_forecast |
获取指定城市未来某天的天气预报 |
get_weather |
综合查询:不传日期返回当前天气,传日期返回预报 |
开发
# 克隆仓库
git clone https://github.com/your-repo/accton-mcpdemo-weather.git
cd accton-mcpdemo-weather
# 安装依赖
uv sync
# 运行
uv run accton-mcpdemo-weather
License
MIT
Metadata
Release files for accton-mcpdemo-weather 0.1.9
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 | |
|---|---|---|---|---|
| accton_mcpdemo_weather-0.1.9.tar.gz | 5.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| accton_mcpdemo_weather-0.1.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.2 kB
Release files / accton_mcpdemo_weather-0.1.9.tar.gz
| Download URL | accton_mcpdemo_weather-0.1.9.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f65edd815f429df9a667b0132fcfb1d98bf88187be21a59e6734259068bec9d
|
|
BLAKE2b-256 checksum How to use checksums |
bcfafac0035b49d97e71428c2a665d84a40d660662f5a8ac54cf3d79e744cf43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / accton_mcpdemo_weather-0.1.9-py3-none-any.whl
| Download URL | accton_mcpdemo_weather-0.1.9-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8a0cbf3c079e4fd8a2aced3b6255d8ec295f425acf4451128f33f665fda689b2
|
|
BLAKE2b-256 checksum How to use checksums |
f7223886a23ab669a5e1354dbc3141851c71fa9c4811370eed25b9718846db57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for accton-mcpdemo-weather 0.1.9
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.