Weather MCP Server
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 MCP Server Any weather alerts in Texas?"
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 Server
A mini project demonstrating how to build and use a Model Context Protocol (MCP) server with Python.
Features
Weather Alerts Tool
Weather Forecast Tool
SSE Transport
STDIO Transport
MCP Client Integration
Docker Support
Async Python Implementation
Related MCP server: Weather MCP Server
Project Structure
mcpcrashcourse/
│
├── server/
│ └── mcpserver/
│ ├── server.py
│ ├── client-sse.py
│ ├── client-stdio.py
│ ├── Dockerfile
│ └── requirements.txt
│
├── weather.py
├── weather.json
├── client.py
├── README.md
├── pyproject.toml
└── uv.lockTools
get_alerts
Returns active weather alerts for a US state.
Example:
get_alerts("CA")get_forecast
Returns forecast information based on latitude and longitude.
Example:
get_forecast(
latitude=37.7749,
longitude=-122.4194
)Transports
STDIO
Used for local MCP communication.
SSE
Used for remote communication through HTTP.
Running the Server
STDIO
uv run server/mcpserver/server.pySSE
Configure transport as:
mcp.run(transport="sse")Then:
uv run server/mcpserver/server.pyRunning Clients
SSE Client
uv run server/mcpserver/client-sse.pySTDIO Client
uv run server/mcpserver/client-stdio.pyDocker
Build:
docker build -t weather-mcp .Run:
docker run weather-mcpTechnologies Used
Python
MCP
FastMCP
HTTPX
AsyncIO
Docker
SSE
STDIO
Learning Outcomes
Building MCP tools
Creating MCP servers
Working with MCP clients
Using SSE transport
Using STDIO transport
Tool invocation
Agent-tool communication
Dockerizing MCP applications
Available Tools
2 toolsget_alertsA
Get weather alerts for a US state.
Args: state: Two-letter US state code (e.g. CA, NY)
Inputs: state (required). Returns: result
get_forecastC
Get weather forecast for a location.
Args: latitude: Latitude of the location longitude: Longitude of the location
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
The two tools have clearly distinct purposes: one retrieves alerts by state, the other provides forecasts by coordinates. There is no functional overlap or ambiguity.
Both tools follow a consistent 'get_noun' pattern with snake_case, making the names predictable and easy to understand.
With only two tools, the server is minimal but still covers two core weather functionalities. It feels slightly thin but is acceptable for a focused server.
The server covers alerts and forecasts but lacks current conditions, historical data, or other common weather endpoints. Notable gaps exist, but the core stated purpose is partially met.
Related MCP Connectors
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
NOAA and ECMWF weather forecast MCP for discovery, validation, and GribStream OAuth queries.
Smarter Weather MCP: forecasts, alerts, outlooks, observations, AQI, grids, and map imagery.
Weather MCP — wraps Open-Meteo API (free, no auth)
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides weather information tools based on the National Weather Service APIs through an SSE-based MCP server that can run as a standalone process or Docker container.-
- AlicenseNot gradedqualityDmaintenanceProvides weather forecasts and active alerts for US locations using the National Weather Service API. It supports both local stdio and remote HTTP/SSE transport modes for flexible integration with MCP clients.104 npmGPL 3.0
- FlicenseBqualityDmaintenanceProvides weather alerts for US states and forecasts for given coordinates via MCP tools.2-
- AlicenseNot gradedqualityBmaintenanceMCP server that provides tools to retrieve weather information from a weather API, supporting both local stdio and remote Streamable HTTP transports.511 npm1MIT