The OpenWeatherMap MCP Server provides access to comprehensive weather data and location services through the OpenWeatherMap API:
- Current Weather: Get real-time conditions for any location
- Weather Forecasts:
- 5-day forecasts with 3-hour intervals
- Hourly forecasts (up to 48 hours)
- Daily forecasts (up to 8 days) with temperature ranges and astronomical data
- Minute-by-minute precipitation forecasts for the next hour
- Weather Alerts: Access active warnings with severity classification
- Air Quality: Monitor real-time pollution data, historical measurements, and forecasts
- Location Services:
- Convert coordinates to location details (reverse geocoding)
- Convert location names/addresses to coordinates (geocoding)
- Customization Options:
- Choose temperature units (metric, imperial, or standard)
- Control data scope and result limits
Used as the runtime environment for the OpenWeatherMap MCP server, supporting its installation, development, and execution.
Supports environment variable configuration for the OpenWeatherMap MCP server, including API key storage and transport settings.
Used for version control and installation of the OpenWeatherMap MCP server through repository cloning.
Hosts the OpenWeatherMap MCP server repository for download and installation, and provides issue tracking for support.
OpenWeatherMap MCP Server
A Model Context Protocol (MCP) server that provides comprehensive weather data and forecasts through the OpenWeatherMap API. This server enables AI assistants to access real-time weather information, forecasts, air quality data, and location services.
Features
Weather Tools
- Current Weather - Get current conditions for any location
- Weather Forecast - 5-day weather forecast with 3-hour intervals
- Hourly Forecast - Detailed hourly forecasts for up to 48 hours
- Daily Forecast - Daily weather forecasts for up to 8 days with temperature ranges and astronomical data
- Minutely Forecast - Minute-by-minute precipitation forecasts for the next hour
- Weather Alerts - Active weather warnings and alerts with severity classification
Air Quality & Location
- Current Air Pollution - Real-time air quality index and pollutant measurements
- Location Info - Reverse geocoding to get location details from coordinates
- OneCall Weather - Comprehensive weather data combining multiple forecasts
- Air Pollution - Historical and forecast air quality data
- Geocoding - Convert location names to coordinates
Installation
Prerequisites
- Bun runtime
- OpenWeatherMap API key (free at openweathermap.org)
Setup
- Clone the repository:
- Install dependencies:
- Set up your environment variables:
Environment variables:
OPENWEATHER_API_KEY
- Your OpenWeatherMap API key (required for stdio transport only)PORT
- Server port for HTTP transport (default: 3000)MCP_TRANSPORT
- Transport type:stdio
orhttpStream
(default: stdio)MCP_ENDPOINT
- HTTP endpoint path (default: /stream)
Usage
Running the Server
Stdio Transport (default):
HTTP Stream Transport:
Claude Desktop Configuration
Add this configuration to your Claude Desktop MCP settings:
API Tools
Weather Information
get-current-weather
- Current weather conditionsget-weather-forecast
- 5-day forecastget-hourly-forecast
- Hourly forecasts (up to 48 hours)get-daily-forecast
- Daily forecasts (up to 8 days)get-minutely-forecast
- Minute-by-minute precipitation
Alerts & Air Quality
get-weather-alerts
- Weather warnings and alertsget-current-air-pollution
- Current air quality dataget-air-pollution
- Air quality forecasts and history
Location Services
get-location-info
- Reverse geocoding from coordinatesgeocode-location
- Convert addresses to coordinatesget-onecall-weather
- Comprehensive weather data
Development
Running in Development
Testing with MCP Inspector
Then connect the MCP Inspector to test the tools interactively.
Build
Authentication
Stdio Transport: Requires OPENWEATHER_API_KEY
environment variable.
HTTP Transport: The OpenWeatherMap API key is passed as a bearer token in the HTTP request headers. No environment variable needed.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- OpenWeatherMap API Documentation
- openweather-api-node Library - The underlying API client
- Model Context Protocol Documentation
- Issue Tracker
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
A Model Context Protocol server that provides comprehensive weather data and forecasts through the OpenWeatherMap API, enabling AI assistants to access real-time weather information, forecasts, air quality data, and location services.
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that retrieves current weather information for specified cities using the Open-Meteo API, requiring no API key.Last updated -34PythonApache 2.0
- AsecurityFlicenseAqualityA Model Context Protocol server that provides AI agents with tools to retrieve weather alerts and detailed forecasts for US locations using the National Weather Service API.Last updated -280TypeScript
- -security-license-qualityA Model Context Protocol server that provides current weather information and 3-day forecasts for specified cities using the Open-Meteo API.Last updated -Python
- -securityFlicense-qualityA production-ready Model Context Protocol server that provides weather data from OpenWeatherMap API, allowing users to query current weather by city name or coordinates with support for different temperature units.Last updated -Python