Israel Weather Forecast MCP Server
Israel Weather Forecast MCP Server
一个独立的 MCP 服务器,通过启动真实浏览器 (Playwright) 来获取以色列天气预报,而不是调用常规 API。其思路是:模型 (Host,例如 Claude Desktop / Claude Code) 会像浏览网站的人类用户一样逐个调用工具:打开页面、输入城市名称、从自动补全列表中选择该城市,最后提取页面内容来回答用户的问题。
项目结构
israel-weather-mcp/
├── server.py # השרת עצמו - כל ה-tools מוגדרים כאן
├── requirements.txt
└── README.mdRelated MCP server: Israel Weather MCP Agent
已实现的工具
第一阶段 - 导航与城市搜索
工具 | 描述 |
| 打开 Chromium 浏览器 (Playwright) 并导航到 ims.gov.il 的预报页面 |
| 在页面的搜索框中输入城市名称 |
| 从出现的自动补全列表中选择相应的城市 |
第二阶段 - 内容提取 (RAG)
工具 | 描述 |
| 从预报页面 (选择城市后) 提取文本,清理 HTML/script/style,并返回干净的文本,LLM 可以直接据此在聊天中作答 |
| 在工作结束时关闭浏览器 |
典型流程 (LLM 预期的调用顺序):
open_weather_forecast_israel
↓
enter_weather_forecast_city_israel("תל אביב")
↓
select_weather_forecast_city_israel("תל אביב")
↓
get_weather_forecast_content() → הטקסט חוזר למודל, שמנסח תשובה למשתמש安装
cd israel-weather-mcp
python -m venv .venv
source .venv/bin/activate # ב-Windows: .venv\Scripts\activate
pip install -r requirements.txt
playwright install chromium # מוריד את הדפדפן שה-Playwright מפעיל连接 Host (例如 Claude Desktop)
在 MCP 的配置文件 (例如 claude_desktop_config.json) 中需要添加:
{
"mcpServers": {
"israel-weather-forecast": {
"command": "python",
"args": ["/נתיב-מלא/israel-weather-mcp/server.py"]
}
}
}保存后需要重新启动 Host。这些工具将出现在可用工具列表中,届时可以请求,例如:“今天海法的天气预报是什么?”,Host 将逐个调用这些工具来回答。
关于选择器 (Selectors) 的重要说明
ims.gov.il 网站的确切 HTML 结构 (搜索框的 class/id 名称、自动补全项目以及预报区域) 可能会随网站更新而变化,因此所有选择器都集中在 server.py 顶部的 SELECTORS 字典中,并为每个元素提供了一些备选方案 (fallback)。建议:
使用
server.py文件中的HEADLESS = False运行 (该行位于通用设置附近),以便实际看到浏览器。在普通浏览器中打开预报网站,对搜索框 / 自动补全列表 / 预报区域点击右键 → “检查” (Inspect),并相应更新
SELECTORS字典中的列表。
这样,即使决定将其指向另一个以色列预报网站 (例如私营机构的网站) 而不是 ims.gov.il,也可以调整服务器——只需更新 IMS_FORECAST_URL 和 SELECTORS。
上传到 GitHub
该项目已经是一个本地 git 仓库 (包含一个初始 commit)。要将其上传到 GitHub 并获得一个可发送给讲师/老师的链接:
进入 github.com,点击 New repository (不要勾选 “Add README” / “.gitignore” / “license”——这些我们已经有了)。
给它命名,例如
israel-weather-mcp,然后点击 Create repository。在终端中,在项目文件夹 (
israel-weather-mcp/) 内运行:git remote add origin https://github.com/<שם-המשתמש-שלכם>/israel-weather-mcp.git git branch -M main git push -u origin mainpush 之后,发送给老师的链接就是仓库地址:
https://github.com/<שם-המשתמש-שלכם>/israel-weather-mcp
如果还没有在这台电脑上首次配置 git,可能需要运行一次:
git config --global user.name "השם שלכם"
git config --global user.email "האימייל שלכם"直接运行测试 (不带 Host)
也可以使用 MCP CLI 快速运行测试:
mcp dev server.py这会打开一个本地测试界面 (MCP Inspector),可以在其中直接调用工具并查看输出,无需连接 Claude Desktop。
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
- FlicenseBqualityDmaintenanceEnables LLMs to query real-time weather data in Israel by automating a browser to scrape weather2day.co.il.4
- FlicenseNot gradedqualityDmaintenanceEnables users to retrieve real-time weather forecasts for Israeli cities by autonomously browsing a weather website using Playwright.
- FlicenseBqualityCmaintenanceEnables users to query weather forecasts for Israeli cities through natural language using browser automation and Gemini.4
- FlicenseNot gradedqualityCmaintenanceProvides LLMs with real-time weather forecasts for Israeli cities using browser automation with Playwright to scrape live data from a weather website.
Related MCP Connectors
US weather, alerts, earthquakes and elevation for AI agents, from NWS/NOAA and USGS. No API keys.
Real-time weather conditions and multi-day forecasts via Open-Meteo — free, no API key required
Global weather via Open-Meteo: forecast, ERA5 archive, marine, air quality, geocoding, elevation.
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/mali8573/israel-weather-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server