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., "@weatherAre 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
| Name | Required | Description | Default |
|---|---|---|---|
| state | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_forecastD
| Name | Required | Description | Default |
|---|---|---|---|
| latitude | Yes | ||
| longitude | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v0.1.0- First observed
get_alerts - First observed
get_forecast
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 alerts, and current observations.
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
US weather alerts (NWS): warnings, watches. $0.01/query. Register in-session — free testnet funds.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI assistants to access real-time US weather forecasts and alerts through the National Weather Service API.25 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.55 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-