MCP Weather Assistant
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Weather AssistantAre there any active weather alerts in California?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Weather Assistant
An interactive weather assistant built with the Model Context Protocol (MCP). The host connects to two local MCP servers, publishes their tools to an OpenRouter-compatible language model, and lets the model decide when to retrieve weather information.
Features
Weather forecasts for locations in the United States through the National Weather Service API.
Active weather alerts for a United States state.
Israeli weather forecasts through the
weather2day.co.ilwebsite and a visible Chromium browser controlled by Playwright.One interactive terminal chat interface.
Multiple MCP servers connected over stdio.
Automatic tool discovery and namespacing to avoid collisions between servers.
Related MCP server: MCP Weather Assistant
Project Structure
File | Purpose |
| Main application. Connects to MCP servers, calls OpenRouter, routes tool calls, and runs the chat loop. |
| Reusable MCP stdio client wrapper. Starts a server with the current Python interpreter and lists its tools. |
| MCP server backed by the National Weather Service API. |
| MCP server backed by |
| Python project metadata and declared dependencies. |
| Locked dependency versions for uv-based environments. |
| Local environment variables. This file is ignored by Git. |
Requirements
Windows, macOS, or Linux.
Python 3.13 or newer.
An OpenRouter API key.
Internet access to OpenRouter,
api.weather.gov, andweather2day.co.il.Chromium, installed through Playwright, for Israeli weather queries.
A virtual environment is recommended.
Installation
Using uv
From the project directory:
uv sync
uv run playwright install chromiumThe project currently imports httpx directly. If it is not already present in the locked environment, install it with:
uv add httpxUsing standard Python tooling
py -3.13 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install anthropic mcp python-dotenv playwright openai google-genai httpx
python -m playwright install chromiumOn macOS or Linux, activate the environment with:
source .venv/bin/activateThe declared dependencies include several provider SDKs that are not currently used by host.py; they remain part of the project metadata for compatibility with the template.
Configuration
Create a .env file in the project root:
OPENROUTER_API_KEY=your_openrouter_api_keyhost.py loads this file with python-dotenv and sends the key as a Bearer token to OpenRouter. Do not commit .env or expose the key in source control, logs, screenshots, or error reports.
The current model is configured in host.py:
MODEL = "nvidia/nemotron-3-super-120b-a12b:free"Change this constant if you want to use another OpenRouter model that supports tool calling.
Running the Assistant
With uv:
uv run python host.pyWith an activated virtual environment:
python host.pyYou should see a startup message followed by a Query: prompt. Type a question and press Enter. Type quit to stop the application.
Example questions:
What is the forecast for 34.05, -118.25?
Are there any active weather alerts in California?
What is the weather forecast in Tel Aviv?The host prints tool calls as they occur, followed by the model's final response.
MCP Servers and Tools
United States server
weather_USA.py starts an MCP server named weather-USA and provides:
get_alerts_in_USA(state)state: two-letter state code such asCAorNY.Uses the NWS active-alerts endpoint.
get_forecast_in_USA(latitude, longitude)latitude: decimal latitude.longitude: decimal longitude.Resolves the location through the NWS points endpoint, then returns the first five forecast periods.
The NWS API request uses Accept: application/geo+json and a custom User-Agent.
Israel server
weather_Israel.py starts an MCP server named weather-Israel and provides:
open_weather_forecast_israel()Opens a non-headless Chromium browser and navigates to the Israeli forecast website.
enter_weather_forecast_city_israel(city)Enters a city name and waits for autocomplete suggestions.
select_weather_forecast_city_israel()Selects the first autocomplete suggestion and waits for the forecast page.
get_forecast_content_israel()Extracts visible text from the loaded page, cleans empty lines, and limits the result to 4,000 characters.
The Israeli tools are stateful and must be called in order. The browser must be opened before entering a city, and a city must be selected before extracting the forecast.
Architecture
User terminal
|
v
host.py (ChatHost)
|-- OpenRouter chat-completions API
|
|-- client.py -> weather_USA.py -> api.weather.gov
|
`-- client.py -> weather_Israel.py -> Playwright -> weather2day.co.ilAt startup, ChatHost creates one MCPClient for each weather server. Each client launches its server as a child process using the same Python interpreter as the host. The host discovers all MCP tools and exposes them to OpenRouter using function-calling schemas.
To prevent duplicate names, tools are exposed to the model as:
<server_script_name>__<tool_name>For example, the USA alert tool is exposed as weather_USA__get_alerts_in_USA. When OpenRouter requests a tool, the host maps that public name back to the owning MCP client and original tool name, executes it, and sends the result back into the model conversation.
Running an Individual MCP Server
Each server can be started directly for MCP-compatible clients or for basic smoke testing:
python weather_USA.py
python weather_Israel.pyThese programs use MCP stdio transport, so they are intended to communicate with an MCP client rather than display a normal web page or command prompt.
Troubleshooting
ModuleNotFoundError: No module named 'httpx'
Install the missing dependency:
uv add httpxor:
python -m pip install httpxChromium does not start
Install the Playwright browser binary:
python -m playwright install chromiumThe Israeli server intentionally launches Chromium with headless=False, so a desktop session is required for that provider.
OpenRouter authentication fails
Check that .env is in the same directory as host.py, that the variable is named exactly OPENROUTER_API_KEY, and that the key is active. Restart the host after changing the file.
No tools are available
Confirm that both server scripts exist in the project root and that the host is started from that directory. The host currently uses the relative paths ./weather_USA.py and ./weather_Israel.py.
A weather request fails
The application depends on external services. Check internet access, the NWS response for the requested coordinates or state, and whether the Israeli website's HTML selectors have changed.
Security and Operational Notes
host.pyand the NWS client disable TLS certificate verification withverify=False. This may be necessary in the current network environment, but it reduces transport security and should be replaced with normal certificate verification in production.OpenRouter receives the user's query and the results returned by weather tools.
The Israeli provider opens a visible browser and scrapes the page's body text. Website layout changes can break the selectors or alter the extracted content.
The application has no persistent conversation history; each terminal query starts a new model message list.
Errors are printed to the terminal and are not written to a logging service.
Development Notes
The MCP server scripts expose tools through FastMCP decorators and use async functions for network and browser operations. Keep the stdio channel reserved for MCP protocol traffic when modifying a server; diagnostic output should be handled carefully so it does not corrupt protocol communication.
There are currently no automated tests in the repository. A useful next test layer would mock the NWS responses, OpenRouter tool-call responses, and Playwright page interactions so the orchestration can be verified without network access or a browser.
License
No license file is currently included in this repository.
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
- FlicenseNot gradedqualityBmaintenanceEnables fetching weather forecasts for the USA via NWS API and for Israel via browser automation using Playwright.
- FlicenseAqualityCmaintenanceEnables 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.4
- FlicenseNot gradedqualityCmaintenanceEnables natural language weather queries for Israeli cities with real-time data extracted via Playwright, plus USA weather alerts and forecasts via NWS API, all orchestrated by Groq LLM.
- -licenseNot gradedqualityCmaintenanceMCP server that enables LLMs to retrieve weather forecasts for Israeli cities by automating a browser with Playwright, and also provides US weather alerts and forecasts via NWS API.
Related MCP Connectors
US weather, alerts, earthquakes and elevation for AI agents, from NWS/NOAA and USGS. No API keys.
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
Get US weather forecasts, active alerts, and current observations.
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/sara-simi-git/MCP_Weather_Agent-'
If you have feedback or need assistance with the MCP directory API, please join our Discord server