weather-serviceslocation-services
321 查看 · 2026-07-07 更新
天气 MCP 服务器
这是一个使用 FastAPI 和 MCP 框架构建的天气数据 Model Context Protocol (MCP) 服务器。该服务器提供了多种与天气相关的工具,可供 AI 助手用来检索当前天气状况、预报、空气质量数据等。
特性
- 当前天气状况
- 天气预报(1-14天)
- 历史天气数据
- 天气警报
- 空气质量信息
- 天文数据(日出、日落、月相)
- 位置搜索
- 时区信息
- 体育赛事
要求
- Python 3.13+
- uv 包管理器
- WeatherAPI API 密钥
安装
通过 Smithery 安装
要通过 Smithery 自动为 Claude Desktop 安装 Weather Data Server:
bash npx -y @smithery/cli install @devilcoder01/weather-mcp-server --client claude
手动安装
-
克隆此仓库:
git clone https://github.com/yourusername/Weather_mcp_server.git cd Weather_mcp_server
-
使用 uv 安装依赖项:
uv venv uv pip install -e .
-
在项目根目录下创建一个
.env文件,并添加您的 WeatherAPI 密钥:WEATHER_API_KEY=your_api_key_here
使用
运行服务器:
python main.py
默认情况下,服务器将在 http://localhost:8000 启动。
许可证
本项目采用 MIT 许可证 - 详情请参阅 LICENSE 文件。
来源
- 来源:github
- 链接:https://github.com/devilcoder01/weather-mcp-server