Weather MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Weather MCP Server
基于 MCP 协议 的天气查询服务,使用 Open-Meteo 免费 API,无需任何 API Key。
功能
智能自动定位:所有工具的城市参数均可留空,系统会自动获取当前位置
优先使用环境变量
DEFAULT_CITY支持GPS定位(需要GPS硬件模块)
支持WiFi定位(通过WiFi BSSID)
支持IP定位(备用方案,多个服务)
定位结果缓存1小时,避免频繁请求
工具:
get_current_weather(city)— 查询任意城市当前天气工具:
get_hourly_forecast(city, hours)— 查询未来逐小时天气预报工具:
get_weather_alerts(city)— 查询未来3天气象预警工具:
get_activity_suggestion(city, activity)— 根据天气提供户外活动建议支持:爬山(hiking)、跑步(running)、骑行(cycling)、野餐(picnic)
根据温度、风速、降水概率、天气状况综合评分
给出适宜度评级(EXCELLENT/GOOD/FAIR/POOR/AVOID)和具体建议
支持中文/英文城市名
支持 stdio 模式(本地)和 SSE 模式(远程部署)
Related MCP server: WeatherMCP
安装
cd D:\mcp
pip install -r requirements.txt本地运行测试
# 直接运行(stdio 模式,会等待 MCP 协议输入,Ctrl+C 退出)
python main.py
# SSE 模式本地测试
MCP_MODE=sse python main.py
# Windows:
set MCP_MODE=sse && python main.py配置 Claude Desktop
编辑 Claude Desktop 配置文件:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
添加以下内容:
{
"mcpServers": {
"weather": {
"command": "python",
"args": ["D:\\mcp\\main.py"]
}
}
}保存后重启 Claude Desktop,即可在对话中使用天气查询。
配置 Claude Code(CLI)
claude mcp add weather -- python D:\mcp\main.py上传 GitHub
cd D:\mcp
git init
git add .
git commit -m "feat: weather MCP server"
git remote add origin https://github.com/你的用户名/weather-mcp.git
git push -u origin main部署到阿里云(SSE 模式)
上传代码到服务器(
git clone或scp)安装依赖:
pip install -r requirements.txt启动 SSE 服务:
MCP_MODE=sse MCP_PORT=8000 python main.py配置 Nginx 反向代理(可选,用于 HTTPS):
location /sse { proxy_pass http://127.0.0.1:8000; proxy_buffering off; proxy_cache off; proxy_set_header Connection ''; proxy_http_version 1.1; } location /messages { proxy_pass http://127.0.0.1:8000; }客户端连接:将 Claude 配置中的
command改为 SSE URL:{ "mcpServers": { "weather-remote": { "url": "http://你的服务器IP:8000/sse" } } }
项目结构
D:\mcp\
├── main.py # MCP Server 主程序
├── requirements.txt # 依赖列表
└── README.md # 本文件Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Global weather via Open-Meteo: forecast, historical, marine, air quality, geocoding, elevation.
Get current weather for any city and create images from your prompts. Streamline planning, reports…
Weather forecast for any city, UV index, sunrise and sunset, pollen and air quality. Free, no key.
Weather forecasts from MET Norway (Yr): geocoding plus hourly forecasts worldwide.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to fetch current weather conditions and forecasts for any city using the Open-Meteo API. Provides temperature, precipitation, and hourly forecast data through natural language queries.ISC
- FlicenseNot gradedqualityDmaintenanceProvides weather information using Open-Meteo API without requiring an API key. Supports weather queries by city name or coordinates with customizable temperature units.-
- FlicenseNot gradedqualityDmaintenanceEnables querying current weather, 7-day forecast, UV index, and air quality for any city using the free Open-Meteo API, without requiring an API key.-
- AlicenseNot gradedqualityDmaintenanceProvides live weather data (current conditions, forecasts) and city geocoding through Open-Meteo API, enabling AI assistants to answer weather queries without an API key.MIT