OpenWeatherMap MCP Server

OpenWeatherMap MCP Server

openweathermcp•byqianjue-cn

An MCP server that integrates the OpenWeatherMap API to give AI assistants access to weather data, geocoding, air quality, maps, alerts, and history.

License: Not specified•Runtime: Awaiting documentation review•Category: search web

WHAT IT DOES

  • •Provides current weather queries with temperature, humidity, wind speed and pressure for a location.
  • •Retrieves 5-day/3-hour interval weather forecasts with an optional count of forecast time points.
  • •Offers air quality data and multi-layer weather map tiles such as clouds, precipitation, pressure, wind and temperature.
  • •Supports geocoding and reverse geocoding, converting place names to coordinates and coordinates back to place names.

BEST FOR

  • •AI assistants that need real-time weather conditions and forecasts for a city or coordinates.
  • •Building multilingual weather interactions using city names in Chinese, English or other languages.

ABOUT OPENWEATHERMCP

OpenWeatherMap MCP Server is cataloged as an MCP server attributed to qianjue-cn. An MCP server that integrates the OpenWeatherMap API to give AI assistants access to weather data, geocoding, air quality, maps, alerts, and history. It is categorized under search web. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for OpenWeatherMap MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

How does the server handle city names in different languages?

It first queries weather using the provided city name directly; if that fails, it automatically geocodes the name to coordinates and re-queries, so city names in any language can work.

Which unit systems does the server support?

It supports metric, imperial and standard unit systems.

Are any features limited by OpenWeatherMap subscription requirements?

Historical weather data requires a paid subscription, and weather alerts require a One Call API 3.0 subscription.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 00e7af05f09c · 采集于 2026-11-13 11:23:50 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

OpenWeatherMap MCP Server

English | 中文

A comprehensive OpenWeatherMap API integration server based on Model Context Protocol (MCP), providing AI assistants with full weather data access capabilities.

🌟 Key Features

Core Weather Functions

  • 🌡️ Current Weather Query - Real-time weather data including temperature, humidity, wind speed, pressure, etc.
  • 📅 Weather Forecast - 5-day/3-hour interval detailed weather forecasts with trend analysis
  • 🏭 Air Quality Monitoring - Real-time air quality index and pollutant concentration data
  • 🗺️ Weather Maps - Multi-layer weather map tiles (clouds, precipitation, temperature, etc.)
  • ⚠️ Weather Alerts - Government-issued weather warnings and safety advisories
  • 📊 Historical Weather - Historical weather data queries and multi-day comparison analysis

Smart City Name Query

  • 🧠 Intelligent Fallback - Automatically handles both Chinese and English city names
  • 🔄 Auto-Geocoding - When direct city name query fails, automatically uses geocoding to get coordinates
  • 🌍 Universal Support - Works with city names in any language through geocoding API

Additional Features

  • 🌍 Geocoding - Place name to coordinates conversion with fuzzy search support
  • 📍 Reverse Geocoding - Coordinates to place name conversion
  • 🔄 Multi-Unit Support - Metric, Imperial, and Standard unit systems
  • 🌐 Multi-Language Support - Chinese, English, and many other languages

📦 Installation

Prerequisites

  • Node.js 18.0.0 or higher
  • OpenWeatherMap API key

Get API Key

  1. Visit OpenWeatherMap
  2. Register an account and get a free API key
  3. Set environment variable:
    export OPENWEATHER_API_KEY="your_api_key_here"
    

Installation Methods

Method 1: NPM Global Installation

npm install -g openweather-mcp

Method 2: Build from Source

git clone https://github.com/QianJue-CN/OpenWeatherMCP.git
cd OpenWeatherMCP
npm install
npm run build

🚀 Usage

Run as MCP Server

# Set API key
export OPENWEATHER_API_KEY="your_api_key_here"

# Start server
npx openweather-mcp

Configure in Claude Desktop

Add to Claude Desktop configuration file:

{
  "mcpServers": {
    "openweather": {
      "command": "npx",
      "args": ["openweather-mcp"],
      "env": {
        "OPENWEATHER_API_KEY": "your_api_key_here"
      }
    }
  }
}

Use with Other MCP Clients

Any MCP protocol-compatible client can connect to this server.

🛠️ Available Tools

1. Current Weather Query (get_current_weather)

Get real-time weather information for specified location.

Parameters:

  • city (optional): City name, e.g., "Beijing" or "北京" or "Beijing,CN"
  • lat (optional): Latitude (-90 to 90)
  • lon (optional): Longitude (-180 to 180)
  • zip (optional): Postal code, e.g., "10001,US"
  • units (optional): Unit system (metric/imperial/standard)
  • lang (optional): Language code (zh_cn/en/es/fr/de/ja/ko/ru)

Smart City Name Support:

  • ✅ "北京" (Chinese) → Automatically works
  • ✅ "Beijing" (English) → Automatically works
  • ✅ "上海" (Chinese) → Automatically works
  • ✅ "Shanghai" (English) → Automatically works

Example:

{
  "city": "北京",
  "units": "metric",
  "lang": "zh_cn"
}

2. Weather Forecast (get_weather_forecast)

Get 5-day weather forecast data.

Parameters:

  • Location parameters same as above
  • cnt (optional): Number of forecast time points (max 40)

Example:

{
  "lat": 39.9042,
  "lon": 116.4074,
  "cnt": 16,
  "units": "metric"
}

3. Air Quality (get_air_quality)

Get air quality data.

Parameters:

  • lat: Latitude
  • lon: Longitude
  • start (optional): Start timestamp (for historical data)
  • end (optional): End timestamp (for historical data)

4. Weather Maps (get_weather_map)

Get weather map tiles.

Parameters:

  • layer: Layer type (clouds_new/precipitation_new/pressure_new/wind_new/temp_new)
  • z: Zoom level (0-10)
  • x: Tile X coordinate
  • y: Tile Y coordinate

5. Weather Alerts (get_weather_alerts)

Get weather warning information.

Parameters:

  • lat: Latitude
  • lon: Longitude

6. Historical Weather (get_historical_weather)

Query historical weather data.

Parameters:

  • lat: Latitude
  • lon: Longitude
  • dt: Unix timestamp for query date
  • units: Unit system
  • lang: Language code

7. Geocoding (geocoding)

Get coordinates from place names.

Parameters:

  • q: Location query string
  • limit: Number of results to return (1-5)

8. Reverse Geocoding (reverse_geocoding)

Get place names from coordinates.

Parameters:

  • lat: Latitude
  • lon: Longitude
  • limit: Number of results to return (1-5)

📝 Usage Examples

Query Beijing Current Weather

{
  "tool": "get_current_weather",
  "parameters": {
    "city": "北京",
    "units": "metric",
    "lang": "zh_cn"
  }
}

Get Shanghai 5-Day Weather Forecast

{
  "tool": "get_weather_forecast",
  "parameters": {
    "city": "上海",
    "units": "metric",
    "lang": "zh_cn"
  }
}

Query Air Quality

{
  "tool": "get_air_quality",
  "parameters": {
    "lat": 39.9042,
    "lon": 116.4074
  }
}

🌍 How Smart City Name Query Works

  1. Direct Query: First attempts to query weather using the provided city name directly
  2. Auto Fallback: If direct query fails (404 error), automatically triggers geocoding
  3. Coordinate Conversion: Converts city name to precise coordinates via geocoding API
  4. Re-query: Uses obtained coordinates to re-query weather data
  5. Seamless Experience: The entire process is transparent to users, no manual handling required

This means you can use city names in any language:

  • Chinese: 北京、上海、广州、深圳
  • English: Beijing, Shanghai, Guangzhou, Shenzhen
  • Other languages: 東京、ソウル、Paris, London

🔧 Development

Project Structure

src/
├── index.ts              # MCP server entry point
├── types/
│   ├── weather.ts        # Weather data type definitions
│   └── mcp.ts           # MCP tool type definitions
├── services/
│   └── openweather.ts   # OpenWeatherMap API service
└── tools/
    ├── current-weather.ts    # Current weather tool
    ├── forecast.ts          # Weather forecast tool
    ├── air-pollution.ts     # Air quality tool
    ├── weather-maps.ts      # Weather maps tool
    ├── weather-alerts.ts    # Weather alerts tool
    └── historical-weather.ts # Historical weather tool

Build and Test

# Install dependencies
npm install

# Build project
npm run build

# Development mode (watch file changes)
npm run dev

# Run tests
npm test

# Code linting
npm run lint

🌍 Supported Location Formats

City Names

  • "北京" - Chinese city name
  • "Beijing" - English city name
  • "Beijing,CN" - City name + country code
  • "New York,US" - Full format

Coordinates

  • Latitude: -90 to 90
  • Longitude: -180 to 180
  • Example: lat: 39.9042, lon: 116.4074

Postal Codes

  • "10001,US" - US postal code
  • "100000,CN" - Chinese postal code

📊 Data Formats

Temperature Units

  • metric: Celsius (°C)
  • imperial: Fahrenheit (°F)
  • standard: Kelvin (K)

Wind Speed Units

  • metric: Meters per second (m/s)
  • imperial: Miles per hour (mph)

Language Support

  • zh_cn: Simplified Chinese
  • en: English
  • es: Spanish
  • fr: French
  • de: German
  • ja: Japanese
  • ko: Korean
  • ru: Russian

⚠️ Important Notes

  1. API Limits: Free accounts have call limits, please use reasonably
  2. Historical Data: Historical weather data requires paid subscription
  3. One Call API: Weather alerts feature requires One Call API 3.0 subscription
  4. Network Connection: Ensure server can access OpenWeatherMap API

🤝 Contributing

Issues and Pull Requests are welcome!

📄 License

MIT License

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for OpenWeatherMap MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/openweathermcp)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related search web MCP Servers

Alternative and complementary servers in the same category

View all in search web →

An MCP server that merges Google Search Console history with a live first-party crawl of your site to produce a prioritised, evidence-backed technical SEO audit inside Claude, complete with paste-ready fixes.

Repository stats unavailable
Search & Web Research

An MCP server that offers intelligent web search using OpenAI reasoning models, with support for fast iterations and deep research.

94
Search & Web Research