Sponsored by Deepsite.site

Qweather Mcp Server Unofficial

Created By
HongpengM8 months ago
Content

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
{
  "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" 
      }
    }
  }
}

Example: Get current weather for a location

# First lookup a city to get its LocationID
cities = await client.lookup_city(location="London")
location_id = cities["location"][0]["id"]

# Get current weather conditions
weather = await client.weather_now(location=location_id)
print(f"Temperature: {weather['now']['temp']}°C")
print(f"Weather: {weather['now']['text']}")

Example: Get a 7-day forecast

forecast = await client.weather_forecast_days(location=location_id, days=7)
for day in forecast["daily"]:
    print(f"Date: {day['fxDate']}, Max: {day['tempMax']}°C, Min: {day['tempMin']}°C, Weather: {day['textDay']}")

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.

Running with MCP.so

This package can be deployed on MCP.so to create a publicly accessible API. To deploy:

  1. Make sure you have an MCP.so account
  2. Install the MCP CLI: pip install mcp[cli]
  3. Log in to MCP.so: mcp login
  4. Deploy your MCP: mcp deploy

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.

Server Config

{
  "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"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
WindsurfThe new purpose-built IDE to harness magic
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
ChatWiseThe second fastest AI chatbot™
Playwright McpPlaywright MCP server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
CursorThe AI Code Editor
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
DeepChatYour AI Partner on Desktop
Tavily Mcp
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Amap Maps高德地图官方 MCP Server
Serper MCP ServerA Serper MCP Server