MCP 天气服务器
提供美国天气数据的 MCP 服务器,支持警报和预报查询。
快速入门
安装
使用 Smithery 安装
运行以下命令: npx -y @smithery/cli install @asifdotpy/mcp-weather-server --client claude
手动安装
- 克隆仓库:git clone
- 进入目录:cd weather
- 安装依赖(需要 Python 3.11+):pip install -e .
使用
- 获取天气警报:get_alerts(state: str)
- 获取天气预报:get_forecast(latitude: float, longitude: float)
启动服务器
运行命令:python weather.py
开发配置
- 设置环境变量
ENV
为 "production" 以启用 JSON 格式日志 - 使用
LOG_LEVEL
配置日志级别