Skip to main content
Glama

Weather Forecast MCP Portfolio Project

This project is an advanced portfolio piece that demonstrates a professional-grade workflow for integrating LLMs with custom MCP servers and browser automation.

It showcases how to build a multi-agent system in Python that uses:

  • Anthropic MCP SDK for exposing custom tools to a language model.

  • Playwright for automated browser control and web interaction.

  • Groq for LLM orchestration and tool selection.


Project Overview

The solution includes three main components:

  • host.py — the chat host that connects to multiple MCP clients, discovers available tools, and forwards user requests to the LLM.

  • client.py — a generic MCP client wrapper that launches MCP server scripts and manages STDIO communication.

  • weather_USA.py — a classic MCP server that fetches weather data from the NWS API for the USA.

  • weather_Israel.py — a new MCP server that performs browser automation to retrieve Israeli weather forecast data from a website.

The architecture intentionally separates concerns: one MCP handles API-based weather data, while another MCP handles browser-driven Israeli weather retrieval.


Related MCP server: Israel Weather MCP Server

Why this project is portfolio-worthy

This project is designed to reflect both technical depth and learning progress:

  • Building a custom MCP Server from scratch.

  • Integrating browser automation with an LLM workflow.

  • Enabling the model to choose and orchestrate tools dynamically.

  • Solving a real-world problem with non-conventional data access.

It demonstrates the ability to design and implement advanced AI tooling, not just consume existing APIs.


Learning Goals

This project highlights the key professional and educational outcomes:

  • Build an independent MCP Server that exposes custom tools to an LLM.

  • Use Playwright to extend the LLM with browser automation capabilities.

  • Design a multi-step flow that answers real user queries through tool orchestration.

  • Apply RAG-style contextual enrichment by extracting and using page content.


Technical Stack

  • MCP SDK — Anthropic's official toolkit for defining the MCP protocol and exposing tools to the model.

  • Playwright — Microsoft's modern browser automation framework, used here to automate a real website and perform human-like interactions.


Project Requirements

The main goal is to build a new MCP Server that handles Israeli weather forecast requests by opening a browser and navigating to a specific site, rather than using a conventional API.

Recruiter-worthy highlights:

  • A custom MCP Server focused on browser-based data retrieval.

  • Playwright-driven automation for searching and selecting a city in a live website.

  • A multi-step tool chain that simulates manual browsing from within an AI agent.

  • Page extraction and contextualization for the LLM.


Development Stages

Stage 0 — Project Structure

project-template/
├── client.py          # generic MCP Client
├── host.py            # terminal chat host that ties everything together
├── weather_USA.py     # MCP Server for USA using API
└── weather_Israel.py  # ← your core Israel-focused MCP

Stage A — Implement Tools with Playwright

Goal: implement MCP tools that allow the LLM to fetch Israeli weather forecast directly from the browser.

The new MCP should load the forecast page from: https://www.weather2day.co.il/forecast

The MCP exposes three Playwright-based tools that automate the complete flow:

  1. open_weather_forecast_israel — open the browser and navigate to the weather page.

  2. enter_weather_forecast_city_israel — enter the city name into the search field.

  3. select_weather_forecast_city_israel — select the first city suggestion from the list.

To make this work professionally:

  • define each function as an MCP tool using the decorator.

  • add the new MCP to the host's MCP client list.

  • run the system and verify the host selects the new MCP and executes the functions sequentially.

Example command:

uv run host.py

Then ask the system for a forecast in a given city and confirm that the host opened the forecast page in the browser.


Stage B — Let the LLM Finish the Answer

Goal: move beyond tool execution and give the LLM page content so it can answer directly in chat.

Add another tool that extracts the page content, cleans it, and returns a useful context snippet for the LLM. This is the RAG-style enhancement: the model receives actual page text and can incorporate it into the response.


How it works

  1. host.py connects to the MCP clients defined in client.py.

  2. It asks Groq to decide which tool should run for a given user query.

  3. The selected MCP tool runs and returns real data.

  4. If the browser-based MCP is used, Playwright drives the website and extracts context from the page.

  5. The result is returned to the user as a fully formed chat answer.


Why this project matters for AI recruiting

This project shows that I can:

  • architect multi-agent systems.

  • implement custom MCP tools for business logic.

  • use browser automation to access data behind interactive websites.

  • enrich LLM responses with real-world context.

  • solve engineering problems that involve both AI and automation.


Run Instructions

  1. Install dependencies:

python -m pip install -U pip
python -m pip install groq>=0.4.0 mcp>=1.27.0 python-dotenv>=1.2.2 playwright>=1.44.0
python -m playwright install
  1. Create a .env file with:

GROQ_API_KEY=your_groq_api_key_here
GROQ_MODEL=mixtral-8x7b-32768
  1. Run the host:

python host.py
  1. Ask a query about weather forecast in Israel or the USA.


Sample Questions

  • What is the weather forecast for Jerusalem today?

  • Open the Israeli weather site and get the forecast for Tel Aviv.

  • Are there any weather alerts in California?

  • Use the Israel browser tool and answer from the page content.

  • How do I get a 5-day forecast for a US location?


Notes

  • The Israeli MCP is intentionally browser-driven rather than API-driven.

  • The project emphasizes autonomous tool orchestration and dynamic LLM-driven execution.

  • This is a strong portfolio example for AI engineering, agent design, and browser automation skills.

Available Tools

4 tools
enter_weather_forecast_city_israelB

Enter city name in the weather forecast search field.

Args: city_name: Name of the city to search for weather forecast

Returns: dict: Operation result with city entered and search ready

Inputs: city_name (required).

extract_page_context_for_llmA

Extract page content, clean it, and return context-ready text for an LLM.

Inputs: no named parameters.

open_weather_forecast_israelA

Open browser and navigate to Israel weather forecast page.

Returns: dict: Operation result with open and ready page for further queries

Inputs: no named parameters.

select_weather_forecast_city_israelB

Select the first item from the city suggestions list.

Returns: dict: Operation result with selected city

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool maps to a discrete step in the weather forecast automation flow: open the page, enter a city, select the suggestion, and extract content. The descriptions clearly separate entering from selecting, so an agent should have little trouble picking the right tool.

    Naming Consistency3/5

    The first three tools follow a similar verb_weather_forecast_city_israel pattern, but extract_page_context_for_llm breaks the convention entirely. The naming is still readable overall, but the mix of domain-specific and generic names prevents it from being highly consistent.

    Tool Count5/5

    Four tools is well-scoped for a focused browser automation workflow: open, enter, select, and extract. Each tool has a distinct role and none feels redundant or missing.

    Completeness4/5

    The set covers the core weather forecast workflow end-to-end, from opening the page to returning LLM-ready content. There are minor assumptions, such as always selecting the first suggestion, but the flow is complete enough for its stated purpose.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers