- 💡 极简: 一句话查询天气
- 🤖 智能: 支持中英文自然语言交互
- 🌏 全球: 支持所有主要城市
- 🔌 即插即用: 完美集成 Cursor
- 🚀 高性能: 异步处理,响应迅速
- 🎨 美观: 清晰直观的天气展示
🔑 在开始之前,请先 获取 OpenWeather API Key
使用 Smithery 一键安装和配置:
npx -y @smithery/cli@latest install @MrCare/mcp_tool --client cursor --config "{\"openweathermapApiKey\":\"your_api_key_here\",\"port\":8000}"如需安装 WindSurf 和 Cine 版本,请访问我们的 Smithery 仓库。
git clone https://github.com/yourusername/weather-server.git && cd weather-server && pip install -e .方法一:使用配置文件(推荐)
复制示例配置文件并修改:
cp env.example .env然后编辑 .env 文件,将 your_api_key_here 替换为你的 API Key。
方法二:使用环境变量
macOS/Linux:
export OPENWEATHERMAP_API_KEY="your_api_key"Windows:
set OPENWEATHERMAP_API_KEY=your_api_key编辑 ~/.cursor/mcp.json (Windows: %USERPROFILE%\.cursor\mcp.json):
{
"weather_fastmcp": {
"command": "python",
"args": ["-m", "weather_server.server"]
}
}重启 Cursor 即可使用!
在 Cursor 中直接输入:
东京天气怎么样?
伦敦明天会下雨吗?
纽约的天气预报
巴黎今天温度多少?
就这么简单!
如需更精确的查询,可以指定以下参数:
| 参数 | 说明 | 默认值 |
|---|---|---|
| city | 城市名称(支持中英文) | 必填 |
| days | 预报天数(1-5天) | 5 |
| units | 温度单位 (metric: 摄氏度, imperial: 华氏度) | metric |
| lang | 返回语言 (zh_cn: 中文, en: 英文) | zh_cn |
-
工具不工作?
- 确保 API Key 设置正确
- 重启 Cursor
- 检查 Python 环境
-
找不到城市?
- 尝试使用英文名称
- 检查拼写
- 使用完整城市名
- Mr.Car
- Email: 534192336car@gmail.com
本项目采用 MIT 许可证 - 详见 LICENSE 文件
