Weather MCP Server

Weather MCP Server

Provides real-time weather alerts and forecasts for US locations by integrating with the National Weather Service API. Supports both server and client interactions with optional LLM summarization.

Category
Visit Server

README

🌦️ Weather MCP Server and Client

Welcome to the Weather Model Context Protocol (MCP) Project! This project provides real-time weather intelligence by integrating with external APIs like the National Weather Service (NWS). It is built using the FastMCP framework and supports both server and client interactions.

🚀 Features

  • Weather Alerts: Fetch weather alerts for any US state.
  • Weather Forecasts: Get detailed weather forecasts for specific locations.
  • Asynchronous Operations: Fully asynchronous for high performance.
  • Modular Design: Clean separation of server, client, and utility logic.
  • LLM Integration: Summarize weather data using a language model (DistilGPT-2).

📂 Project Structure

  • server.py: The main server file that registers tools for fetching weather alerts and forecasts.
  • client.py: A command-line client to interact with the server.
  • app.py: A Streamlit-based web app for user-friendly interaction.
  • agent.py: An advanced client integrating a language model for summarizing weather data.

🛠️ Setup Instructions

  1. Clone the Repository:

    git clone <repository-url>
    cd mcp
    
  2. Install Dependencies: Ensure Python 3.8+ is installed, then run:

    pip install -r requirements.txt
    
  3. Run the Server: Start the FastMCP server:

    python server.py
    
  4. Interact with the Client: Use the command-line client or the Streamlit app to interact with the server.

🖥️ Usage

Command-Line Client

  1. List Available Tools:
    python client.py list_tools
    
  2. Fetch Alerts:
    python client.py get_alerts --state CA
    
  3. Fetch Forecasts:
    python client.py get_forecast --latitude 34.05 --longitude -118.25
    

Streamlit Web App

  1. Run the app:
    streamlit run app.py
    
  2. Use the sidebar to select actions like "List Tools," "Get Alerts," or "Get Forecast."

LLM Integration

  1. Summarize weather data using the language model:
    python agent.py interact_with_llm --llm_action get_alerts --state CA
    python agent.py interact_with_llm --llm_action get_forecast --latitude 34.05 --longitude -118.25
    

🎥 Video Demonstration

Watch a quick demonstration of the Weather MCP Project in action:

[Weather MCP Demo]

🌐 External Dependencies

  • FastMCP: Framework for building MCP servers and clients.
  • httpx: For making asynchronous HTTP requests.
  • Streamlit: For building the web app.
  • Transformers: For integrating the DistilGPT-2 language model.

📋 Notes

  • Ensure the server is running before using the client or web app.
  • Follow the asynchronous programming model to avoid blocking operations.

❤️ Acknowledgments

  • FastMCP for the server-client framework.
  • National Weather Service (NWS) for providing weather data.
  • Hugging Face Transformers for the DistilGPT-2 model.

🤝 Contributing

We welcome contributions to the Weather MCP Project! Here's how you can help:

  1. Report Bugs: If you encounter any issues, please open an issue on the GitHub repository.
  2. Suggest Features: Have an idea for a new feature? Let us know by creating a feature request.
  3. Submit Pull Requests: Fork the repository, make your changes, and submit a pull request for review.
  4. Improve Documentation: Help us enhance the documentation by fixing typos, adding examples, or clarifying instructions.

Contribution Guidelines

  • Follow the project's coding conventions and structure.
  • Ensure all new code is covered by tests.
  • Use clear and concise commit messages.
  • Test your changes thoroughly before submitting.

Enjoy exploring the weather with Weather MCP! 🌤️

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured