mcpField
🌩
🌩️ MCP Weather Alerts Tool using FastMCP + Claude Desktop

🌩️ MCP Weather Alerts Tool using FastMCP + Claude Desktop

Local
github.com/nahilahmedMedia & Design1Updated 78w ago

About 🌩️ MCP Weather Alerts Tool using FastMCP + Claude Desktop

A Python MCP server built with FastMCP that retrieves real-time weather alerts by U.S. state for Claude Desktop and other MCP clients. It returns structured alert details and can be tested with MCP Inspector.

Key features

  1. 01Look up alerts by U.S. state
  2. 02Fetch real-time alert data
  3. 03Return structured alert details
  4. 04Test with MCP Inspector
  5. 05Integrate with Claude Desktop

Use cases

  1. 01Check current alerts for a state
  2. 02Ask about weather risks in Claude Desktop
  3. 03Debug and test the MCP tool

MCP support

The server exposes a `get_alerts` tool through FastMCP for MCP clients. It retrieves alert data from api.weather.gov.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

🌩️ MCP Weather Alerts Tool using FastMCP + Claude Desktop

This project demonstrates how to build an MCP (Model Context Protocol) tool using the official 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.


πŸš€ What This Project Does

  • βœ… 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

🧱 Tech Stack

Tool/LibraryPurpose
mcp[cli]MCP server toolkit with CLI tools
httpxAsync HTTP client
uvModern Python package/dependency manager
Claude DesktopAI interface for LLM + MCP
MCP InspectorUI to debug MCP endpoints

πŸ“ Project Structure

mcpcrashcourse/
β”œβ”€β”€ server/
β”‚   └── weather.py         # MCP server logic (get_alerts)
β”œβ”€β”€ pyproject.toml         # Project metadata + dependencies
β”œβ”€β”€ uv.lock                # Locked versions (auto-generated by uv)
└── README.md              # You're reading it!

🧠 Tool Logic: get_alerts

@mcp.tool()
async def get_alerts(state: str) -> list[dict]:
    # Fetch weather alerts for a given U.S. state (e.g., 'CA')
    url = "https://api.weather.gov/alerts/active"
    params = {"area": state.upper()}
    async with httpx.AsyncClient() as client:
        response = await client.get(url, params=params)
        data = response.json()

    return [
        {
            "event": alert.get("event"),
            "severity": alert.get("severity"),
            "description": alert.get("description"),
            "instruction": alert.get("instruction"),
        }
        for alert in data.get("features", [])
        if alert.get("properties")
    ]

πŸ› οΈ Installation & Setup

1. Create & Configure Project
pipx install uv               # install uv if you haven't
uv init mcpcrashcourse        # start new project
cd mcpcrashcourse
uv add "mcp[cli]" httpx       # add dependencies
2. Add Your Tool

Place your weather.py in the server/ folder, containing the logic for get_alerts.


πŸ§ͺ Run & Inspect

Launch with MCP Inspector
uv run mcp dev server/weather.py

Then open http://localhost:6757 to:

  • View your get_alerts tool
  • Try calling it with input like "TX"

πŸ€– Claude Desktop Integration

  1. Update your claude_desktop_config.json:
{
  "mcpServers": {
    "weather": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "mcp[cli]",
        "mcp",
        "run",
        "<your-project-directory>/server/weather.py"
      ]
    }
  }
}
  1. Restart Claude Desktop
  2. Prompt:

    "What are the weather alerts for Texas?"

Claude will call your MCP tool and display structured output.


πŸ’‘ 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.

Three core primitives:

TypeUse CaseAnalogy
ToolsExecute functionsPOST endpoint
ResourcesProvide static dataGET endpoint
PromptsReusable interactionsLLM templates

πŸ“Ž Credits


πŸ“„ License

This project is open-sourced under the MIT License.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.