weather-mcp
weather-mcp
一个 MCP(Model Context Protocol)服务器,让 AI 助手(如 Claude、Gemini CLI 或任何兼容 MCP 的客户端)能使用实时数据回答真实天气问题,而不只是获取原始数字。
由 Open-Meteo 提供支持 — 免费,无需 API 密钥。
为什么这不只是一个原始的天气 API 封装
大多数天气集成只会返回 temperature: 22°C。本项目在原始数据之上增加了一个推理层,因此你可以提出纯 API 无法直接回答的问题:
get_weather("Bangalore")— 当前状况 + 今日预报should_i_carry_umbrella("Mumbai")— 给出带理由的是/否答案,而不只是降水百分比is_good_for_outdoors("Delhi")— 综合雨量、风力和温度,判断今天是否适合待在户外compare_weather("Bangalore", "Delhi")— 同时比较两个城市的天气
Related MCP server: Weather MCP Server
安装
git clone https://github.com/darshan0548/weather-mcp.git
cd weather-mcp
python3 -m venv venv
source venv/bin/activate # on Windows: venv\Scripts\activate
pip install -r requirements.txt运行测试
对真实 API 进行快速验证(无需 mock,无需 API 密钥):
python test_weather.py将其连接到 Claude Desktop
把这部分添加到你的 Claude Desktop 配置(claude_desktop_config.json)中:
{
"mcpServers": {
"weather": {
"command": "python",
"args": ["/absolute/path/to/weather-mcp/server.py"]
}
}
}将其连接到 Gemini CLI
把这部分添加到 ~/.gemini/settings.json 中:
{
"mcpServers": {
"weather": {
"command": "python",
"args": ["/absolute/path/to/weather-mcp/server.py"]
}
}
}重启你的客户端,然后直接问它类似 “今天在金奈需要带伞吗?” 这样的问题。
项目结构
weather_core.py # talks to the Open-Meteo API, no MCP-specific code
weather_advice.py # reasoning layer built on top of raw weather data
server.py # MCP server — wires the above into tools
test_weather.py # sanity tests against the real API刻意拆分为独立的文件——weather_core.py 和 weather_advice.py 完全不依赖 MCP,因此可以单独测试或复用。
贡献
欢迎提交 PR。如果你想添加一个工具,这里有一些想法:
提供分小时的预报明细,而不只是今日概况
空气质量数据(Open-Meteo 同样提供免费的接口)
多日出行规划(本周最适合户外活动的日子)
恶劣天气警报
如果新工具是在原始数据之上增加推理,就放在 weather_advice.py 中;如果只是纯数据获取,就放在 weather_core.py 中——然后用新的 @mcp.tool() 把它们接入 server.py。
许可证
MIT — 请参阅 LICENSE。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot 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.
- AlicenseNot gradedqualityFmaintenanceEnables AI assistants to retrieve current weather, forecasts, and summaries for any global location using the Open-Meteo API, with no API key required.21Creative Commons Zero v1.0 Universal
- FlicenseNot gradedqualityBmaintenanceProvides real-time weather data via 12 tools (current weather, forecasts, air quality, umbrella advice, etc.) using Open-Meteo and FastMCP, enabling LLMs to answer weather-related queries.1
- AlicenseNot gradedqualityCmaintenanceProvides 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
Related MCP Connectors
Global weather via Open-Meteo: forecast, ERA5 archive, marine, air quality, geocoding, elevation.
Real-time weather conditions and multi-day forecasts via Open-Meteo — free, no API key required
US weather, alerts, earthquakes and elevation for AI agents, from NWS/NOAA and USGS. No API keys.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/darshan0548/weather-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server