Skip to main content
Glama
r0556763949

Weather MCP Server

by r0556763949
README.md
\# Weather MCP Server 🌤️



\## About



This project implements an MCP Server that provides weather information to an LLM Agent.



The project demonstrates two different approaches:



\- \*\*USA Weather MCP\*\* - retrieves weather information using the National Weather Service API.

\- \*\*Israel Weather MCP\*\* - retrieves weather information using Playwright browser automation from the weather2day website.



The main goal is to demonstrate how an LLM Agent can use MCP Tools to interact with external sources and enrich its context.



\---



\## Technologies



\- Python

\- MCP SDK (FastMCP)

\- OpenAI API

\- Playwright

\- httpx



\---



\## Project Structure



```

weather-mcp/

│

├── host.py

├── client.py

├── weather\\\_USA.py

├── weather\\\_Israel.py

└── README.md

```



\---



\# 🇺🇸 USA Weather MCP



The USA MCP uses the National Weather Service API.



Available tools:



\### get\_forecast\_in\_USA



Returns weather forecast by location coordinates.



Input:

\- Latitude

\- Longitude



\### get\_alerts\_in\_USA



Returns active weather alerts for a USA state.



Input:

\- State code (example: CA, NY)



\---



\# 🇮🇱 Israel Weather MCP



The Israel MCP uses Playwright to automate a browser and extract weather information from:



https://www.weather2day.co.il/forecast



The Agent can:



1\. Open the weather website.

2\. Enter a city name.

3\. Select the requested city.

4\. Extract weather information from the page.

5\. Use the extracted information to answer the user.



Available tools:



\### open\_weather\_forecast\_israel



Opens the weather forecast website.



\### enter\_weather\_forecast\_city\_israel



Receives a city name and enters it into the search field.



\### select\_weather\_forecast\_city\_israel



Selects the first city from the autocomplete list.



\### extract\_weather\_forecast\_content\_israel



Extracts weather information from the selected city page and provides it as context for the LLM.



\### close\_weather\_browser



Closes the browser session.



\---



\## Installation



Install dependencies:



```bash

uv sync

```



Install Playwright browser:



```bash

uv run playwright install chromium

```



\---



\## Running



Run the project:



```bash

uv run host.py

```



\---



\## Example Questions



Israel:



```

מה מזג האוויר בבני ברק?

```



USA:



```

What is the weather in Miami?

```



\---



\## Learning Goals



This project demonstrates:



\- Building a custom MCP Server

\- Creating MCP Tools with FastMCP

\- Connecting an LLM Agent to external tools

\- Browser automation with Playwright

\- Extracting information from websites

\- Providing external context to an LLM (RAG)

```


TDQS

B3.2/5.0

Scored across 2 tools

Disambiguation5/5

The two tools target clearly different data types: weather alerts versus weather forecasts. An agent can easily distinguish when to call each one.

Naming Consistency5/5

Both tools follow the same predictable verb_noun pattern with a consistent USA suffix: get_alerts_in_USA and get_forecast_in_USA.

Tool Count3/5

Only two tools is thin for a weather server. While they cover two useful operations, the surface feels under-scoped for general weather queries.

Completeness2/5

The server lacks current conditions, hourly/daily forecasts, historical data, location search, and any non-USA coverage. These are significant gaps for a general weather MCP server.

Maintenance

ActivityStale
ResponsivenessNo issues