OpenWeatherMap MCP Server

OpenWeatherMap MCP Server

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.

Category
Visit Server

Tools

get-current-weather

Get current weather conditions for a location

get-weather-forecast

Get weather forecast for up to 5 days

get-hourly-forecast

Get hourly weather forecast for up to 48 hours

get-daily-forecast

Get daily weather forecast for up to 8 days

get-minutely-forecast

Get minute-by-minute precipitation forecast for next hour

get-weather-alerts

Get active weather alerts and warnings

get-current-air-pollution

Get current air quality data

get-location-info

Get location information from coordinates (reverse geocoding)

get-onecall-weather

Get comprehensive weather data (current + 7-day forecast)

get-air-pollution

Get air quality index and pollution data

geocode-location

Convert location name to coordinates or vice versa

README

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

Setup

  1. Clone the repository:
git clone https://github.com/robertn702/mcp-openweathermap.git
cd mcp-openweathermap
  1. Install dependencies:
bun install
  1. 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: stdio or httpStream (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 conditions
  • get-weather-forecast - 5-day forecast
  • get-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 alerts
  • get-current-air-pollution - Current air quality data
  • get-air-pollution - Air quality forecasts and history

Location Services

  • get-location-info - Reverse geocoding from coordinates
  • geocode-location - Convert addresses to coordinates
  • get-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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured