Skip to main content

An unofficial MCP (Multiagent Conversation Protocol) wrapper for the QWeather API

Project description

Unofficial QWeather MCP

An unofficial MCP (Multiagent Conversation Protocol) wrapper for the QWeather API. This package provides tools to easily access QWeather's comprehensive weather data services through MCP, allowing integration with AI agents, chatbots, and other applications.

Features

  • City Lookup: Search for cities by name, coordinates, LocationID or Adcode
  • POI Lookup: Find points of interest like scenic spots and stations
  • Real-time Weather: Get current weather conditions for global locations
  • Weather Forecasts: Daily forecasts for 3-30 days and hourly forecasts up to 7 days
  • Weather Warnings: Access real-time disaster warnings and warning lists by region
  • Weather Indices: Get lifestyle indices like UV index, sports conditions, etc.
  • Air Quality: Real-time and forecast air quality data with detailed pollutant information

Installation

pip install unoff-qweather-mcp

Authentication

This package requires a QWeather API key. You'll need to:

  1. Register for an account at QWeather Developer Platform
  2. Create an API key in the developer console
  3. Set the following environment variables:
export QWEATHER_API_KEY="your_api_key_here"
export QWEATHER_API_HOST="api.qweather.com"  # or another appropriate host based on your subscription

The API host depends on your subscription tier. See QWeather API Configuration for details.

Usage

Running as an Claude MCP

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

# Clone and config the env
git clone https://github.com/HongpengM/unoff-qweather-mcp.git

# Set up your environment variables by copying the example file
copy env.example .env

# Run the MCP server
uv --directory /path/to/your_dir run src/unoff_qweather/qweather.py

Using the published version:

{
  "mcpServers": {
    "qweather": {
      "command": "uvx",
      "args": [
        "unoff-qweather-mcp"
      ],
      "env": {
        "QWEATHER_API_KEY": "your_api_key_here",
        "QWEATHER_API_HOST": "api.qweather.com" 
      }
    }
  }
}

For local pulled repository:

{
  "mcpServers": {
    "qweather": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/your_dir",
        "run",
        "src/unoff_qweather/qweather.py"
      ],
      "env": {
        "QWEATHER_API_KEY": "your_api_key_here",
        "QWEATHER_API_HOST": "api.qweather.com" 
      }
    }
  }
}

Available Tools

This package provides the following MCP tools:

  • lookup_city - Search for cities by name or coordinates
  • lookup_poi - Find points of interest
  • weather_now - Get current weather conditions
  • weather_forecast_days - Get daily weather forecasts (3-30 days)
  • weather_forecast_hours - Get hourly weather forecasts (24-168 hours)
  • warning_city_list - Get cities with active weather warnings
  • weather_warning - Get detailed weather warnings for a location
  • weather_indices - Get lifestyle indices (UV, sports, etc.)
  • air_quality_now - Get current air quality data
  • air_quality_forecast - Get air quality forecasts

For detailed parameter information, see each function's docstring in the code.

License

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

Disclaimer

This is an unofficial wrapper and not affiliated with or endorsed by QWeather. Users must comply with QWeather's terms of service when using this package.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unoff_qweather_mcp-0.1.3.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unoff_qweather_mcp-0.1.3-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file unoff_qweather_mcp-0.1.3.tar.gz.

File metadata

  • Download URL: unoff_qweather_mcp-0.1.3.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for unoff_qweather_mcp-0.1.3.tar.gz
Algorithm Hash digest
SHA256 259b5dd4762141153507aa3b730376d39fdf2934b22ff037831c873187ab7e29
MD5 c52ff28239dd7f6cd297db42353f4024
BLAKE2b-256 f2a0fcd99b1966514b45dfa9c7af7104cf3a14f63b7897a0085181766383e1b0

See more details on using hashes here.

File details

Details for the file unoff_qweather_mcp-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for unoff_qweather_mcp-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c7465f38374b65fb858d033290b08ff8c729190252a4f58e54856a4de3b19cba
MD5 21b4bb98392bd71c9e1674a11a2b6567
BLAKE2b-256 e92fac50a7cad2b5cbf38c3956e221812cc557dbf3a2d1a76234190688e33e81

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page