🌦️ Weather MCP (Model Context Protocol) Demo

by sturlese

190 downloads
Not rated
GitHub

Description

# 🌦️ Weather MCP (Model Context Protocol) Demo This project demonstrates the implementation of a **Model Context Protocol (MCP)** system for weather information, consisting of a client using OpenAI's agents and a dedicated MCP server. The system allows users to query weather…

About

# 🌦️ Weather MCP (Model Context Protocol) Demo This project demonstrates the implementation of a **Model Context Protocol (MCP)** system for weather information, consisting of a client using OpenAI's agents and a dedicated MCP server. The system allows users to query weather information through a natural language…

Details

Author
sturlese
Downloads
190
Categories
Media

- Server exposes weather endpoint via SSE (http://localhost:4000/sse)
- Provides a fetch-weather tool discoverable by MCP clients
- Client integrates with OpenAI GPT-4 for natural language processing
- Automatic tool discovery from the MCP server
- Interactive command-line interface for user interactions

Clone the repository, create a .env file with your OpenAI API key in both server_weather/ and client_weather_openai/ directories, install dependencies using a Python virtual environment and pip install -r requirements.txt. Start the server with python server_weather.py, then start the client with python weather_agent_openai.py and ask natural language questions like "What's the weather in New York today?"

🌦️ Weather MCP (Model Context Protocol) Demo

This project demonstrates the implementation of a Model Context Protocol (MCP) system for weather information, consisting of a client using OpenAI's agents and a dedicated MCP server. The system allows users to query weather information through a natural language interface powered by GPT-4.

---

🌟 Overview

The project is split into two main components:

Weather MCP Server: A Python-based server that provides weather information.
Weather OpenAI Client: A client that uses OpenAI's GPT-4 model to process natural language requests and interact with the MCP server.

---

🚀 Components

🌐 Weather MCP Server

📁 Located in: /server_weather/

The server component implements a Model Context Protocol server that:

Exposes a weather information endpoint via SSE (Server-Sent Events).
Provides a fetch-weather tool that can be discovered by MCP clients.
Runs on http://localhost:4000/sse.

🤖 Weather OpenAI Client

📁 Located in: /client_weather_openai/

The client component features:

Integration with OpenAI's GPT-4 model.
Automatic tool discovery from the MCP server.
Natural language processing for weather queries.
Interactive command-line interface for user interactions.

---

📋 Prerequisites

Python 3.x
OpenAI API Key (Get yours from OpenAI Platform)
Environment Variables properly configured (.env file)

---

🔧 Setup

1. Clone this repository

git clone git@github.com:sturlese/client_server_mcp.git
cd client_server_mcp

2. Set up environment variables

Create a .env file in the root of each component (/server_weather/ and /client_weather_openai/).
Add your OpenAI API key:

```

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.