Skip to main content
Glama

Weather MCP Server

Weather MCP Server

A powerful weather information server built with FastMCP that provides weather alerts and tools through multiple interfaces.

Features

  • 🌤️ Weather Alerts: Get real-time weather alerts for any US state
  • 🔊 Echo Resource: Simple message echoing functionality
  • 🖥️ Multiple Interfaces: Choose between MCP server or web interface
  • 🎨 Beautiful UI: Modern, responsive web interface

Quick Start

python run_server.py

This will present you with options to run either the MCP server or web interface.

Option 2: Direct Web Interface

python server/web_interface.py

Then open your browser to: http://localhost:8000

Option 3: MCP Server Only

python main.py

Installation

  1. Install dependencies:
    uv sync
  2. Run the server:
    python run_server.py

Usage

Web Interface

  1. Start the web interface
  2. Open http://localhost:8000 in your browser
  3. Use the forms to:
    • Get weather alerts for a US state (e.g., CA, NY, TX)
    • Echo messages through the resource system

MCP Server

The MCP server provides these tools:

  • get_alerts(state): Get weather alerts for a US state
    • state: Two-letter US state code (e.g., "CA", "NY")
  • echo_resource(message): Echo a message as a resource
    • message: Any text message to echo

API Endpoints

  • GET /: Main web interface
  • POST /api/alerts: Get weather alerts (form data: state)
  • POST /api/echo: Echo a message (form data: message)

Dependencies

  • mcp[cli]>=1.13.0: MCP server framework
  • fastapi>=0.104.0: Web framework
  • uvicorn[standard]>=0.24.0: ASGI server
  • httpx>=0.25.0: HTTP client
  • python-multipart>=0.0.6: Form data handling

Project Structure

secondproject/ ├── main.py # MCP server entry point ├── run_server.py # Interactive launcher ├── server/ │ ├── weather.py # MCP server implementation │ └── web_interface.py # Web interface ├── pyproject.toml # Project configuration └── README.md # This file

Troubleshooting

Common Issues

  1. Port already in use: Change the port in web_interface.py or stop other services
  2. Dependencies missing: Run uv sync to install all dependencies
  3. API errors: Check your internet connection for weather data

Getting Help

  • Check the console output for error messages
  • Ensure all dependencies are installed
  • Verify Python version (requires 3.12+)

License

This project is open source and available under the MIT License.

-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Enables users to get real-time weather alerts for US states and echo messages through both MCP server tools and a modern web interface. Provides weather information access with multiple deployment options for different use cases.

  1. Features
    1. Quick Start
      1. Option 1: Interactive Launcher (Recommended)
      2. Option 2: Direct Web Interface
      3. Option 3: MCP Server Only
    2. Installation
      1. Usage
        1. Web Interface
        2. MCP Server
      2. API Endpoints
        1. Dependencies
          1. Project Structure
            1. Troubleshooting
              1. Common Issues
              2. Getting Help
            2. License

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                A Model Control Protocol (MCP) based service that allows users to query weather forecasts by coordinates and receive weather alerts for U.S. states.
                Last updated -
                4
                Python
                • Linux
                • Apple
              • -
                security
                F
                license
                -
                quality
                An MCP server that provides weather information like forecasts and alerts for US locations using the National Weather Service API.
                Last updated -
                2
                JavaScript
              • A
                security
                F
                license
                A
                quality
                An MCP server that provides weather information and alerts for US locations using the National Weather Service API, enabling retrieval of weather forecasts and active weather alerts.
                Last updated -
                2
                Python

              View all related MCP servers

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/onceagainarise/MCP-second-project-weather-forecaster-'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server