weather-mcp-server

1morshed1/weather-mcp-server

3.1

If you are the rightful owner of weather-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Weather MCP Server is a two-part Python application designed to provide weather data and AI-powered assistance through a FastMCP backend and an interactive Streamlit web client.

Weather MCP Server

Demo Screenshot 1 Demo Screenshot 2

A two-part Python application for weather data and AI-powered assistance, featuring:

  • MCP Server: FastMCP backend for weather data and API integration.
  • Streamlit Client: Interactive web UI for users.

Project Structure

.
├── client/
│   └── client.py
│   └── Dockerfile
├── mcp/
│   └── weather.py
│   └── Dockerfile
├── requirements.txt
├── docker-compose.yml
├── .env

Prerequisites

  • Docker & Docker Compose installed
  • Python 3.11+ (for local development)
  • A valid GROQ_API_KEY (for Groq API access)

Setup

  1. Clone the repository

    git clone https://github.com/1morshed1/weather-mcp-server.git
    cd mcp-project
    
  2. Create a .env file

    GROQ_API_KEY=your_api_key_here
    

Running with Docker Compose

  1. Build and start the services

    docker compose up --build
    
  2. Access the application

  3. Stop the services Press Ctrl+C in the terminal, then:

    docker compose down
    

Local Development

  1. Install dependencies

    python -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
    
  2. Run MCP Server

    python mcp/weather.py
    
  3. Run Streamlit Client

    streamlit run client/client.py
    

Environment Variables

  • GROQ_API_KEY: Your Groq API key

Troubleshooting

  • Docker cannot access .env file
    Remove the volumes section mounting .env in docker-compose.yml. Docker Compose will automatically use .env for environment variables.

  • Ports already in use
    Change the exposed ports in docker-compose.yml if 8000 or 8501 are busy.

  • Healthcheck fails
    Ensure weather.py exposes a /health endpoint.

File Overview

  • client/client.py: Streamlit web client
  • mcp/weather.py: FastMCP server
  • requirements.txt: Python dependencies
  • docker-compose.yml: Multi-service orchestration
  • .env: Secrets and API keys

License

MIT