天气信息MCP服务器
一个使用OpenWeatherMap API提供实时天气数据的Modern Code Protocol服务器。
快速入门
前置条件
- Python 3.12 或更高版本
- OpenWeatherMap API 密钥
安装方式
使用 Smithery 安装
运行以下命令: npx -y @smithery/cli install @CodeByWaqas/weather-mcp-server --client claude
手动安装
- 克隆仓库 git clone https://github.com/CodeByWaqas/weather-mcp-server
- 创建虚拟环境并激活 uv venv source .venv/bin/activate (MacOS/Linux) .venv\Scripts\activate (Windows)
- 安装依赖 uv add "mcp[cli]" python-dotenv requests httpx
配置
- 复制
src/resources/env.example
为src/resources/.env
- 在
.env
文件中添加 OpenWeatherMap API 密钥 WEATHER_API_KEY=your_api_key_here
启动
配置完成后,运行 Claude Desktop 并通过 LLM 获取天气信息。