weather
Click on "Deploy 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., "@weather Are 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.
Weather MCP Learning
This repository is an educational project created only to learn more about the Model Context Protocol (MCP). It is not intended to be a production weather service.
MCP is an open protocol that gives AI applications a standard way to connect to external tools and data sources. An MCP server exposes capabilities such as tools, resources, or prompts, while an MCP client—such as Claude Desktop—discovers and uses those capabilities through a defined interface.
This project implements a small Python MCP server that retrieves weather information from the United States National Weather Service (NWS) API.
Available tools
get_alerts(state): Returns active weather alerts for a two-letter US state code, such asCAorNY.get_forecast(latitude, longitude): Returns a short forecast for a location in the United States.
The NWS API primarily covers locations in the United States and its territories.
Related MCP server: MCP Weather Server
Requirements
Python 3.12 or later
An MCP client, such as Claude Desktop
Run locally
Clone the repository and start the server with the stdio transport:
git clone https://github.com/hienguyenUET/weather_mcp_learning.git
cd weather_mcp_learning
uv sync
uv run weather.pyConfigure Claude Desktop
Add the server to the mcpServers object in your Claude Desktop configuration file:
{
"mcpServers": {
"weather": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/weather_mcp_learning",
"run",
"weather.py"
]
}
}
}Restart Claude Desktop after saving the configuration. Claude should then discover the get_alerts and get_forecast tools.
Example prompts
"Are there any active weather alerts in California?"
"What is the weather forecast for latitude 34.0522 and longitude -118.2437?"
Project structure
weather_mcp_learning/
├── weather.py # MCP server and weather tools
├── pyproject.toml # Project metadata and dependencies
└── uv.lock # Locked dependency versionsData source
Weather data is provided by the public National Weather Service API. No API key is required.
Available Tools
2 toolsget_alertsD
Inputs: state (required). Returns: result
get_forecastD
Inputs: latitude (required), longitude (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
get_alerts and get_forecast clearly correspond to distinct weather data types—alerts versus forecast—with no semantic overlap. An agent can easily select the right tool based on the resource name alone.
Both tools follow the identical verb_noun pattern get_<noun>, using snake_case consistently. The naming convention is uniform and predictable.
Two tools is at the lower boundary for a useful server. While a minimal weather server could get by with forecast and alerts, the count feels thin for a general-purpose weather service.
The set covers forecast and alerts but lacks common weather operations such as current conditions, historical data, or location-based weather search. These are notable gaps for the apparent domain.
Maintenance
Related MCP Connectors
Get US weather forecasts, active and recent alerts, and current observations.
US NWS weather alerts and 5-day forecasts for AI agents. $0.01 per call.
Active National Weather Service warnings for any US ZIP code. Free weather_alerts tool.
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI assistants to access real-time US weather forecasts and alerts through the National Weather Service API.213 npmMIT
- AlicenseNot gradedqualityDmaintenanceProvides weather information using the US National Weather Service API, including active weather alerts for US states and location-specific forecasts based on latitude and longitude coordinates.79 npmMIT
- FlicenseNot gradedqualityDmaintenanceEnables users to get weather forecasts and alerts for any US city and state through natural language queries using the National Weather Service API.-
- FlicenseBqualityDmaintenanceProvides real-time US weather alerts and forecasts by integrating with the National Weather Service API. It enables AI assistants to fetch state-specific alerts and detailed local forecasts using geographic coordinates.21-