Skip to main content
Glama
Sara-Git-2259

Israel Weather MCP Server

🌤️ Israel Weather MCP Server

一个自定义的 Model Context Protocol (MCP) 服务器,使 LLM 能够获取以色列城市实时、高精度的本地化天气预报。

该代理不依赖通用的全球 API,而是利用 Playwright 自主导航到以色列本地天气门户网站(weather2day.co.il),与 DOM 交互,并将实时数据(RAG)直接提取到聊天上下文中。

🎯 项目目的

本项目探索了在 AI Agent 架构中集成自主浏览器控制的可能性。 实现的主要学习目标包括:

  1. 自定义 MCP 服务器开发: 构建专用服务器,向 LLM 暴露特定工具。

  2. 通过 AI 实现浏览器自动化: 使用 Microsoft 的 Playwright 为 LLM 赋予网络上的"手"和"眼"——使其能够导航、搜索、从自动补全下拉菜单中选择选项,并动态抓取数据。

  3. 克服语言与状态障碍: 处理有状态的 Web 交互(等待动画、顺序输入),并确保 LLM 在与本地 UI 元素交互之前正确将查询翻译为希伯来语。

🛠️ 技术栈

  • MCP SDK: 用于定义协议和暴露工具的官方 Anthropic 库。

  • Playwright: 用于以编程方式控制 Chromium 的现代浏览器自动化工具。

  • uv: 超快速的 Python 包和环境管理器。

🚀 如何运行

1. 前置条件

确保你的系统已安装 uv

  • Windows (PowerShell): powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

  • Mac/Linux: curl -LsSf https://astral.sh/uv/install.sh | sh

2. 设置环境

克隆仓库,进入 project-template 文件夹,并同步依赖:

uv sync

3. 安装浏览器引擎

安装 Playwright 所需的 Chromium 浏览器:

uv run playwright install chromium

4. 启动主机

运行交互式终端聊天,开始与 Agent 通信:

uv run host.py

💬 示例查询

主机运行后,你可以向 Agent 提出如下问题:

  • "耶路撒冷的天气预报是什么?"

  • "מה מזג האוויר בתל אביב היום?"

  • "海法明天会下雨吗?"

见证奇迹发生: Agent 将自动打开 Chromium,将城市名称翻译为希伯来语,搜索该城市,选择正确的自动补全选项,抓取最新预报,并直接在终端中为你提供简洁、本地化的答案!


由 SARA DEI 开发

-
license - not tested
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • Provides cloud browser automation capabilities using Stagehand and Browserbase, enabling LLMs to i…

  • Enable language models to perform advanced AI-powered web scraping with enterprise-grade reliabili…

  • AI-powered browser automation — navigate, click, fill forms, and extract data from any website.

View all MCP Connectors

Latest Blog Posts

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/Sara-Git-2259/-Weather-MCP-with-Playwright'

If you have feedback or need assistance with the MCP directory API, please join our Discord server