MCP ExplorerExplorer

Mcp Python Weather Forecast

@arun2728on 10 months ago
2 MIT
FreeCommunity
AI Systems
A Python weather app using MCP and OpenAI's GPT-4o-mini.

Overview

What is Mcp Python Weather Forecast

mcp-python-weather-forecast is a weather application built using Python that leverages the OpenAI API for enhanced weather forecasting capabilities.

Use cases

Use cases include developing a personal weather assistant, creating educational tools for students learning about APIs and Python, and integrating weather forecasting into larger applications.

How to use

To use mcp-python-weather-forecast, set up a virtual environment, install the required packages, configure the .env file with your OpenAI API key, and run the server and client scripts.

Key features

Key features include integration with OpenAI’s GPT-4o-mini for advanced forecasting, a user-friendly setup process, and the ability to run both server and client applications locally.

Where to use

mcp-python-weather-forecast can be used in various fields such as personal weather forecasting, educational projects for learning Python, and as a backend service for weather-related applications.

Content

Weather App with MCP

Prerequisites

Before diving in, make sure you have the following:

  • Python 3.10 or later: Make sure it’s installed on your computer.
  • Basic Python Knowledge: You should know how to run Python scripts and install packages.
  • OpenAI API Key: We’ll use OpenAI’s GPT-4o-mini. You can get your API key here.

Step 1: Setting Up Your Environment

Let’s set up a clean space for your project and install the necessary tools.

  1. Create a Virtual Environment

    python -m venv mcp-env
    
  2. Activate the Virtual Environment

    • On macOS/Linux:
      source mcp-env/bin/activate
      
    • On Windows:
      mcp-env\Scripts\activate
      
  3. Install Required Packages:

    pip install mcp openai
    
  4. Setup the .env file:
    Create a .env file in your project directory with the following content:

    OPENAI_API_KEY=your-openai-api-key
    MCP_SSE_URL=http://localhost:8080/sse
    

Step 2: Running the Server

Once you have server.py ready, launch your server with:

python server.py --host localhost --port 8080

Step 3: Running the Client

Once the server is running, launch the client by running:

python client.py

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers