weather-mcp-server

weather-mcp-server

0

The Weather CLI App is a tool for fetching weather alerts and forecasts using the National Weather Service API. It functions as an MCP server for integration with AI assistants, offering tools to get alerts by state and forecasts by location coordinates.

Weather CLI App

A simple application to fetch weather alerts and forecasts from the National Weather Service API using Model Context Protocol (MCP).

Features

  • Get active weather alerts for any US state
  • Get weather forecasts for any location by coordinates
  • MCP server implementation for integration with AI assistants

Installation

  1. Ensure you have Python 3.11 or higher installed
  2. Clone this repository
  3. Install the package with pip:
# Install with pip
pip install -e .

# Or if you have pip3 specifically
pip3 install -e .

Note: This project uses the MCP framework and does NOT require the uv tool specifically, despite what the lock file might suggest.

Usage as an MCP Server

Once installed, the weather MCP server can be accessed by AI assistants that support the Model Context Protocol. The server provides two main tools:

  1. get_alerts - Get weather alerts for a US state (using two-letter state code)
  2. get_forecast - Get weather forecast for specific coordinates (latitude, longitude)

Development

This project uses:

  • httpx for asynchronous HTTP requests
  • MCP server tools for structured data handling

Troubleshooting

If you see errors like spawn uv ENOENT in the logs:

  1. Make sure you've installed the package with pip, not uv
  2. Check that your Python environment is properly configured
  3. Try running the server manually to see any additional stderr output: python -m weather

API Information

This application uses the National Weather Service (NWS) API to retrieve weather data. No API key is required, but please be respectful of their rate limits.