MCP Weather Project

MCP Weather Project

An MCP server that provides real-time weather alerts for US states using the National Weather Service (NWS) API. It also includes utility features for message echoing and generating customizable greeting prompts.

Category
Visit Server

README

MCP Weather Project

A Model Context Protocol (MCP) server implementation that provides weather alerts via the National Weather Service (NWS) API. This project includes both a FastMCP server and a LangChain-based client with memory capabilities.

Features

  • Weather Alerts: Fetch active weather alerts for any US state using the NWS API.
  • Echo Resource: A simple resource that echoes back messages.
  • Greeting Prompt: A customizable greeting prompt generator.
  • Interactive Client: A CLI-based chat client powered by Groq's Llama 3.3 model with conversation memory.

Prerequisites

  • Python 3.12 or higher
  • uv (recommended for dependency management)
  • A Groq API Key for the client.

Installation

  1. Clone the repository:

    git clone <repository_url>
    cd mcpfile
    
  2. Install dependencies: Using uv (recommended):

    uv sync
    

    Or using pip:

    pip install -r requirements.txt
    

    (Note: You may need to generate a requirements.txt from pyproject.toml if not using uv)

  3. Set up Environment Variables: Create a .env file in the root directory and add your Groq API key:

    GROQ_API_KEY=your_groq_api_key_here
    

Usage

Running the Entry Point

The main.py is a simple entry point script that prints a welcome message.

uv run main.py
# OR
python main.py

Running the interactive Client

The client connects to the weather server and allows you to interact with it using natural language.

  1. Ensure the server configuration in server/weather.json is correct (it points to server/weather.py).

  2. Run the client:

    uv run server/client.py
    # OR if using a virtual environment directly:
    # python server/client.py
    
  3. Example Interaction:

    You: Check weather alerts for TX
    Assistant: Checking weather alerts for Texas...
    [Agent responds with alerts]
    

Running the MCP Server Standalone

You can run the MCP server directly using uv. This is useful for inspection or debugging with the MCP Inspector.

uv run --with mcp[cli] mcp run server/weather.py

Configuration Verification

Ensure that server/weather.json points to the correct absolute path of your server/weather.py file.

{
  "mcpServers": {
    "weather": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "mcp[cli]",
        "mcp",
        "run",
        "/your/absolute/path/to/mcp/mcpfile/server/weather.py" 
      ]
    }
  }
}

Project Structure

  • server/weather.py: The main MCP server implementation using FastMCP. Defines tools (get_alerts), resources, and prompts.
  • server/client.py: An MCP client implementation using LangChain and ChatGroq. Handles the interactive chat session.
  • server/weather.json: Configuration file for the MCP client to locate the server.
  • main.py: Simple entry point script.
  • pyproject.toml: Project configuration and dependencies.

Tools Available

  • get_alerts(state: str): Get active weather alerts for a US state (e.g., "CA", "NY").

Resources

  • echo://{message}: Echoes a message.

Prompts

  • greet_user(name: str, style: str): Generates a greeting in a specified style ("friendly", "formal", or "casual").

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
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
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
Qdrant Server

Qdrant Server

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

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
E2B

E2B

Using MCP to run code via e2b.

Official
Featured