Weather MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Weather MCP ServerWhat's the current weather in Tokyo?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Weather MCP Server
A complete, clean, and modular Model Context Protocol (MCP) server for fetching weather data, forecasts, air quality, and alerts. This server is built using Python and uses the OpenWeatherMap API.
Features
Current Weather: Get real-time weather conditions for any location.
Forecasts: Access multi-day (up to 5 days) and hourly weather forecasts.
Air Quality: Retrieve Air Quality Index (AQI) and detailed pollutant data.
Alerts: Check for severe weather alerts (requires OpenWeatherMap OneCall 3.0 API subscription).
Related MCP server: OpenWeatherMap MCP Server
Project Structure
weather-mcp-server/
├── server.py # Main MCP server entry point
├── tools/ # Tool implementations (weather, forecast, air_quality, alerts)
├── services/ # API and business logic (geocoding, openweathermap endpoints)
├── utils/ # Utilities and constants
├── requirements.txt # Project dependencies
├── .env.example # Example environment variables
└── README.md # Project documentationSetup & Installation
1. Install Dependencies
It is recommended to use a virtual environment.
cd weather-mcp-server
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
pip install -r requirements.txt2. Configure Environment Variables
Get a free API key from OpenWeatherMap.
Copy the example environment file:
cp .env.example .envEdit .env and replace your_api_key_here with your actual OpenWeatherMap API key.
Running the Server
Development Mode (Testing)
You can run the server directly or use the MCP CLI to inspect it:
# Optional: Install mcp cli if you want to use the inspector
npm install -g @modelcontextprotocol/inspector
# Run with inspector
npx @modelcontextprotocol/inspector python server.pyConnecting to Claude Desktop
To connect this server to Claude Desktop, you need to configure Claude's mcp.json config file.
Locate your Claude Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add the following to your
mcpServersconfiguration (adjust the absolute path to your project):
{
"mcpServers": {
"weather": {
"command": "/absolute/path/to/your/venv/bin/python",
"args": [
"/absolute/path/to/weather-mcp-server/server.py"
],
"env": {
"OPENWEATHER_API_KEY": "YOUR_ACTUAL_API_KEY_HERE"
}
}
}
}Restart Claude Desktop. The new weather tools should now be available for Claude to use!
Tools Provided
get_current_weather(location, units)get_weather_forecast(location, days, units)get_hourly_forecast(location, hours, units)get_air_quality(location)get_weather_alerts(location)
This server cannot be deployed
Maintenance
Related MCP Connectors
Global weather via Open-Meteo: forecast, historical, marine, air quality, geocoding, elevation.
Global weather API: forecasts, historical data, marine, ski, astronomy and timezone.
Free, keyless real-time weather and 7-day forecasts for any city worldwide.
OpenWeather MCP — wraps the OpenWeatherMap API (openweathermap.org)
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides access to real-time weather data, 5-day forecasts, and air quality information for any city using the OpenWeatherMap API.MIT
- AlicenseNot gradedqualityCmaintenanceProvides weather data integration using the OpenWeatherMap API, enabling users to fetch current weather conditions, hourly and daily forecasts, weather alerts, and geocoding services for any location worldwide.110 npmMIT
- AlicenseNot gradedqualityDmaintenanceProvides access to real-time weather data, 5-day forecasts, air quality information, and weather comparisons across multiple cities using the free OpenWeatherMap API.MIT
- AlicenseNot gradedqualityDmaintenanceProvides real-time weather data and forecasts for locations worldwide using the OpenWeatherMap API. It enables AI assistants to retrieve current conditions, temperature, and forecasts through a simple tool-based interface.MIT