pragaurav44

WeatherMCP

Community pragaurav44
Updated

WeatherMCP

This project is an MCP server built as a hands-on exercise. It provides weather data and alerts from the US National Weather Service (NWS) via a simple API using the FastMCP framework.

Features

  • Weather Alerts: Get active weather alerts for any US state.
  • Forecast: Retrieve weather forecasts for a specific latitude and longitude.

Requirements

  • Python 3.8+
  • uv (for dependency management and running)

Installation

  1. Install dependencies using uv:

    uv pip install -r requirements.txt
    

    Or, if you use pyproject.toml:

    uv pip install -r pyproject.toml
    
  2. (Optional) Create a virtual environment:

    uv venv .venv
    source .venv/bin/activate
    

Running the MCP Server

To start the server using uv:

uv pip install -e .  # if you want to install as editable, or just ensure dependencies are installed
uv python weather.py

The server will start and listen for MCP requests via stdio.

Available Tools

1. get_alerts(state: str)

  • Description: Get active weather alerts for a US state.
  • Argument: state โ€” Two-letter US state code (e.g., CA, NY).
  • Returns: Formatted string of current alerts or a message if none are found.

2. get_forecast(latitude: float, longitude: float)

  • Description: Get weather forecast for a specific location.
  • Arguments:
    • latitude โ€” Latitude of the location (float)
    • longitude โ€” Longitude of the location (float)
  • Returns: Formatted string with the next 5 forecast periods.

Notes

Feel free to extend or modify the project for your own experiments!

MCP Server ยท Populars

MCP Server ยท New

    Prismer-AI

    Signet

    Cryptographic action receipts for AI agents โ€” sign, audit, verify.

    Community Prismer-AI
    ctxray

    ctxray

    See how you really use AI โ€” X-ray your AI coding sessions locally

    Community ctxray
    vkhanhqui

    figma-mcp-go

    Figma MCP for free users โ€” no rate limits, full read/write, text to designs, designs to code

    Community vkhanhqui
    cerul-ai

    Cerul

    The video search layer for AI agents. Search video by meaning โ€” across speech, visuals, and on-screen text.

    Community cerul-ai
    GuyMannDude

    โšก Mnemo Cortex v2.2

    Open-source memory coprocessor for AI agents. Persistent recall, semantic search, crash-safe capture. No hooks required.

    Community GuyMannDude