OpenWeatherMap MCP Server
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.
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., "@OpenWeatherMap MCP Server what's the weather forecast for New York this weekend?"
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.
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
Related MCP server: Weather MCP
Installation
Prerequisites
Bun runtime
OpenWeatherMap API key (free at openweathermap.org)
Setup
Clone the repository:
git clone https://github.com/robertn702/mcp-openweathermap.git
cd mcp-openweathermapInstall dependencies:
bun installSet up your environment variables:
cp .env.example .env
# Edit .env and add your OpenWeatherMap API keyEnvironment 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:stdioorhttpStream(default: stdio)MCP_ENDPOINT- HTTP endpoint path (default: /stream)
Usage
Running the Server
Stdio Transport (default):
bun run src/main.tsHTTP Stream Transport:
MCP_TRANSPORT=httpStream PORT=3000 bun run src/main.tsClaude Desktop Configuration
Add this configuration to your Claude Desktop MCP settings:
{
"mcpServers": {
"openweathermap": {
"command": "npx",
"args": ["mcp-openweathermap"],
"env": {
"OPENWEATHER_API_KEY": "your-api-key-here"
}
}
}
}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
bun run src/main.tsTesting with MCP Inspector
bun run src/main.tsThen connect the MCP Inspector to test the tools interactively.
Build
bun run buildAuthentication
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
openweather-api-node Library - The underlying API client
Available Tools
11 toolsgeocode-locationC
Convert location name to coordinates or vice versa
Inputs: query (required), limit.
get-air-pollutionC
Get air quality index and pollution data
Inputs: latitude (required), longitude (required).
get-current-air-pollutionC
Get current air quality data
Inputs: location (required).
get-current-weatherC
Get current weather conditions for a location
Inputs: location (required), units.
get-daily-forecastC
Get daily weather forecast for up to 8 days
Inputs: location (required), days, include_today, units.
get-hourly-forecastB
Get hourly weather forecast for up to 48 hours
Inputs: location (required), hours, units.
get-location-infoB
Get location information from coordinates (reverse geocoding)
Inputs: latitude (required), longitude (required).
get-minutely-forecastC
Get minute-by-minute precipitation forecast for next hour
Inputs: location (required), limit.
get-onecall-weatherC
Get comprehensive weather data (current + 7-day forecast)
Inputs: latitude (required), longitude (required), exclude, units.
get-weather-alertsC
Get active weather alerts and warnings
Inputs: location (required).
get-weather-forecastC
Get weather forecast for up to 5 days
Inputs: location (required), days, units.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Most tools are clearly distinct, covering specific weather and location data types like current weather, forecasts, air pollution, and geocoding. However, there is some overlap between 'get-daily-forecast', 'get-weather-forecast', and 'get-onecall-weather', which could cause confusion as they all provide forecast data with different scopes or formats.
All tool names follow a consistent 'get-' or 'geocode-' prefix pattern with descriptive kebab-case nouns, such as 'get-current-weather' and 'geocode-location'. This uniformity makes the tools predictable and easy to understand at a glance.
With 11 tools, the server is well-scoped for an OpenWeatherMap integration, covering a comprehensive range of weather and location services. Each tool serves a distinct purpose, from basic weather queries to specialized forecasts and alerts, without feeling bloated or sparse.
The tool set provides complete coverage for weather and location data, including current conditions, various forecast types (minutely, hourly, daily), air pollution, alerts, and geocoding. There are no obvious gaps, enabling agents to handle a wide range of weather-related queries effectively.
Maintenance
Related MCP Connectors
The official Model Context Protocol server for Ambee. It gives any MCP-compatible AI assistant — Claude, ChatGPT, Cursor, VS Code, Ollama, and more direct access to live air quality, pollen, and weather data. To get started, including information on signing up and obtaining your Ambee key, check out the Ambee documentation on https://docs.ambeedata.com
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
MCP server for weather with reasoning — umbrella advice, outdoor checks, city comparisons.
OpenWeather MCP — wraps the OpenWeatherMap API (openweathermap.org)
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that enables AI assistants and LLMs to access real-time weather data and forecasts by connecting to the OpenWeatherMap API.-
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables natural language weather queries for global cities, integrating with OpenWeather API to provide real-time weather information in an easy-to-read format.1-
- FlicenseBqualityDmaintenanceA Model Context Protocol server that provides real-time weather data to AI clients through Server-Sent Events, enabling them to fetch current weather conditions, multi-day forecasts, and location-based weather information.5-
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides weather information using the Open-Meteo API, allowing users to get current weather for specific cities and retrieve weather data for date ranges.Apache 2.0