MCP Weather Alerts Tool logo

MCP Weather Alerts Tool

by nahilahmed

This project demonstrates how to build an MCP (Model Context Protocol) tool using the FastMCP Python SDK. It integrates with Claude Desktop to enable an AI assistant to retrieve weather alerts by U.S. state via the api.weather.gov API.

View on GitHub

Last updated: N/A

What is MCP Weather Alerts Tool?

The MCP Weather Alerts Tool is a custom MCP server built with FastMCP that allows an AI assistant (Claude Desktop) to retrieve real-time weather alerts for a given U.S. state using the api.weather.gov API.

How to use MCP Weather Alerts Tool?

To use the tool, you need to install the dependencies, configure the MCP server with the provided weather.py logic, and integrate it with Claude Desktop by updating the claude_desktop_config.json file. You can then prompt Claude to retrieve weather alerts for a specific state.

Key features of MCP Weather Alerts Tool

  • Implements a custom MCP server with FastMCP

  • Uses httpx to call real-time weather alerts from api.weather.gov

  • Returns structured information: event, severity, description, and instructions

  • Integrates with Claude Desktop

  • Can be tested interactively via MCP Inspector

Use cases of MCP Weather Alerts Tool

  • Integrating weather alerts into AI assistants

  • Providing real-time weather information through conversational interfaces

  • Building custom tools for accessing and processing weather data

  • Demonstrating the use of MCP for connecting applications with LLMs

FAQ from MCP Weather Alerts Tool

What is MCP?

The Model Context Protocol standardizes how apps send context (data, tools, prompts) to LLMs. It separates the 'context provider' from the LLM layer.

What is FastMCP?

FastMCP is a Python SDK for building MCP servers.

Where does the weather data come from?

The weather data is retrieved from the api.weather.gov API.

How do I integrate this with Claude Desktop?

You need to update your claude_desktop_config.json file with the correct command to run the MCP server and then restart Claude Desktop.

What is MCP Inspector?

MCP Inspector is a UI to debug MCP endpoints.