OpenWeatherMap
Provides comprehensive weather data and forecasts using the OpenWeatherMap API.
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:
git clone https://github.com/robertn702/mcp-openweathermap.git
cd mcp-openweathermap
- Install dependencies:
bun install
- Set up your environment variables:
cp .env.example .env
# Edit .env and add your OpenWeatherMap API key
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:stdioorhttpStream(default: stdio)MCP_ENDPOINT- HTTP endpoint path (default: /stream)
Usage
Running the Server
Stdio Transport (default):
bun run src/main.ts
HTTP Stream Transport:
MCP_TRANSPORT=httpStream PORT=3000 bun run src/main.ts
Claude 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.ts
Testing with MCP Inspector
bun run src/main.ts
Then connect the MCP Inspector to test the tools interactively.
Build
bun run 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
Related Servers
Flespi MCP Server
Interact with the Flespi telematics platform API for fleet management, device tracking, and telemetry data processing.
Unsplash MCP Server
An MCP server for accessing the Unsplash API to search for and retrieve photos.
AWS Knowledge Base Retrieval
Retrieve information from an AWS Knowledge Base using the Bedrock Agent Runtime.
Cumulocity MCP Server
Access the Cumulocity IoT platform to manage devices, measurements, and alarms.
Google Analytics Data API
Access the Google Analytics Data API to retrieve and analyze website traffic data.
LlamaIndex MCP demos
Expose LlamaCloud services as MCP tools for building and managing LLM applications.
Remote MCP Server on Cloudflare
An MCP server deployed on Cloudflare Workers, featuring OAuth login and data storage via Cloudflare KV.
Litmus MCP Server
Enables LLMs and intelligent systems to interact with Litmus Edge for device configuration, monitoring, and management.
RAD Security
Interact with the RAD Security platform which provides AI-powered security insights for Kubernetes and cloud environments.
Spotify
Control Spotify playback and manage your liked songs using LLMs.