- Home
- MCP servers
- Weather
Weather
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"dbalencar-openai-chatbot-weather-mcp": {
"command": "python",
"args": [
"weather_mcp_server.py"
],
"env": {
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY",
"MCP_SERVER_HOST": "localhost",
"MCP_SERVER_PORT": "8000",
"OPENWEATHER_API_KEY": "YOUR_OPENWEATHERMAP_API_KEY"
}
}
}
}This MCP server provides a modular weather data service that you can query through a dedicated MCP client. It connects to a weather data source to deliver real-time conditions and multi-day forecasts, while keeping conversation context for natural, ongoing chats about the weather.
How to use
You interact with the Weather MCP Server through an MCP client to request current conditions or forecasts for any city. Start the MCP weather service locally, then run the chatbot client to have natural language conversations about weather data. The MCP layer handles requests to fetch weather information and deliver concise results back to you.
How to install
Prerequisites you need before installation:
• Python 3.8 or higher
• Access to OpenAI API key
• Access to OpenWeatherMap API key
Step-by-step setup
# 1. Clone or download the project
git clone <repository-url>
cd <project-directory>
# 2. Install Python dependencies
pip install -r requirements.txt
# 3. Set up environment variables
cp env.example .env
Additional setup details
Configure your API keys and MCP server settings in the environment file. The following keys should be present in your .env file.
OPENAI_API_KEY=your_openai_api_key_here
OPENWEATHER_API_KEY=your_openweather_api_key_here
MCP_SERVER_HOST=localhost
MCP_SERVER_PORT=8000
Starting the MCP Weather Server and chatbot
Run the MCP server first to provide weather data to the MCP client.
python weather_mcp_server.py
Then start the chatbot client in a separate session to begin asking weather questions.
python chatbot.py
Available tools
weather_current
Fetches current weather data for a specified city and optional country code, returning key metrics such as temperature, humidity, wind, and conditions.
weather_forecast
Retrieves a multi-day weather forecast for a city, including daily temperatures and conditions, with an optional days parameter (up to 5 days).
memory_context
Maintains conversational context across turns to improve follow-up weather questions and provide personalized recommendations.