weather_mcp_server

Siddhant-kochhar/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.

A weather information server built with FastAPI and MCP that provides weather data through a web interface.

Weather MCP Server

A weather information server built with FastAPI and MCP (Machine Conversation Protocol) that provides weather data through a beautiful web interface.

Features

  • 🌤️ Real-time weather information
  • 🎨 Modern, responsive web interface
  • 🔄 Asynchronous API endpoints
  • 🔒 Secure API key management
  • 🚀 Fast and efficient data delivery

Prerequisites

  • Python 3.8 or higher
  • Virtual environment (recommended)

Installation

  1. Clone the repository:
git clone <repository-url>
cd weather_mcp_server
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create a .env file in the root directory with your API keys:
OPENWEATHER_API_KEY=your_api_key_here

Running the Server

  1. Start the server:
python run_server.py
  1. Open your browser and navigate to:
http://localhost:8000

Project Structure

  • src/
    • fastapi_server.py - Frontend server with web UI
    • mcp_server.py - MCP server implementation
    • main.py - Entry point for MCP server
    • weather_tools.py - Weather API integration
    • config.py - Configuration management
  • run_server.py - Server startup script
  • requirements.txt - Project dependencies

API Endpoints

  • GET / - Web interface
  • POST /weather - Get weather data
  • GET /health - Health check endpoint

License

MIT License