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., "@Weather MCP Serverget the forecast for New York City"
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 Model Context Protocol (MCP) server that provides weather data tools using the National Weather Service (NWS) API.
Overview
This MCP server exposes two main tools for accessing weather information:
get_alerts: Fetch active weather alerts for a US state
get_forecast: Retrieve detailed weather forecasts for a specific latitude/longitude
The server is built using FastMCP and communicates over stdio transport, making it compatible with MCP clients like Claude Desktop.
Features
š¤ļø Real-time weather forecasts from the National Weather Service
ā ļø Active weather alerts by state
š Async API calls for efficient data retrieval
š”ļø Robust error handling and user-friendly responses
š¦ Easy integration with MCP-compatible clients
Requirements
Python 3.11 or higher
uv package manager (recommended)
Installation
Using uv (recommended)
Using pip
Usage
Running the Server
Integration with MCP Clients
To use this server with an MCP client like Claude Desktop, add it to your MCP configuration:
Available Tools
get_alerts
Fetch active weather alerts for a US state.
Parameters:
state(string): Two-letter US state code (e.g., "CA", "NY")
Example:
get_forecast
Retrieve weather forecast for a specific location.
Parameters:
latitude(float): Latitude coordinatelongitude(float): Longitude coordinate
Example:
API Integration
This server uses the National Weather Service API (api.weather.gov):
/alerts/active/area/{state}- Weather alerts by state/points/{lat},{lon}- Forecast grid endpointsForecast URLs from points response - Detailed forecasts
All API requests include proper User-Agent and Accept headers as required by the NWS API.
Development
Project Structure
Adding New Tools
Define an async function in
weather.pyDecorate it with
@mcp.tool()Use
make_nws_request()for NWS API callsReturn formatted strings, not raw JSON
Handle errors gracefully
Testing
Test the server by:
Running it and providing input via stdin
Integrating with an MCP client
Using MCP CLI tools
Error Handling
Network errors return user-friendly error messages
No raw exceptions are exposed to clients
All responses are formatted strings with clear labels
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
BSD-3-Clause License - see LICENSE file for details
Author
Bryan Kemp (bryan@kempville.com)
Acknowledgments
Built with FastMCP
Weather data from National Weather Service API