MCP Weather Assistant
Enables users to query weather information for Israel via Playwright browser automation and for the USA via a weather API, allowing an LLM to access real-time weather data and alerts.
README
🌤️ MCP Weather Assistant
פרויקט זה הוא דוגמה קטנה ופרקטית ליישום של MCP (Model Context Protocol) עם מודל שפה, שמאפשר למודל לעבוד עם כלים חיצוניים אמיתיים.
🎯 מה הפרויקט עושה?
הפרויקט מאפשר למשתמש לשאול שאלות על מזג האוויר, וה-LLM בוחר אילו כלים להשתמש כדי לענות על השאלה.
יש בו שני סוגי כלים:
- עבור ישראל — נעשה שימוש ב-Playwright כדי לפתוח דפדפן, להזין שם עיר, לבחור את התוצאה ולחלץ את תוכן הדף.
- עבור ארצות הברית — נעשה שימוש ב-API רשמי של מזג האוויר כדי לקבל תחזית ו-alerts.
הדבר מיועד להדגים איך מודל שפה יכול לא רק לענות, אלא גם לבצע פעולה בעולם האמיתי דרך כלים חיצוניים.
🎯 המטרה של הפרויקט
המטרה היא להראות כיצד אפשר להרחיב את יכולות של LLM באמצעות MCP Tools:
- לאסוף מידע בזמן אמת
- לבצע פעולות בדפדפן באופן אוטומטי
- להעניק למודל קונטקסט נוסף מהאתר עצמו (RAG)
- לשלב בין כלים שונים לממשק צ'אט אחד
זהו פרויקט לימודי שמדגים עקרונות של Agents, MCP Servers ו-Tool Calling.
🧩 מבנה הפרויקט
- client.py — לקוח MCP גנרי שמתחבר לשרתים.
- host.py — צ'אט Host שמקבל שאלות, שולח אותן למודל ומחבר בין ה-LLM לכלים.
- weather_USA.py — שרת MCP עבור מזג אוויר בארצות הברית דרך API.
- weather_Israel.py — שרת MCP עבור מזג אוויר בישראל דרך Playwright.
🛠️ טכנולוגיות בשימוש
- Python
- MCP SDK
- Playwright
- Anthropic API
- UV
🚀 איך מריצים את הפרויקט
1. התקנת התלויות
uv sync
2. התקנת דפדפן עבור Playwright
uv run playwright install chromium
3. הגדרת מפתח API
ודאו שיש לכם משתנה סביבה בשם:
ANTHROPIC_API_KEY=your_api_key_here
4. הרצת הממשק
uv run host.py
💬 דוגמאות לשאלות שניתן לשאול
- מה מזג האוויר היום בירושלים?
- תבדוק לי בבקשה מה התחזית בטבריה.
- האם ירד גשם היום בתל אביב?
- מה המצב במזג האוויר באילת?
- What is the weather in New York?
⚠️ דברים חשובים לשים לב אליהם
- הפרויקט מיועד ללימוד והדגמה, לאו דווקא למוצר סופי יציב.
- עבור ישראל, התהליך תלוי באתר חיצוני, ולכן הוא עלול להישבר אם האתר ישנה את מבנה הדף.
- כדי שה-LLM יוכל לענות, צריך להיות מוגדר מפתח API תקין.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.