{
  "markdown": "# qweather-mcp\n[![Verified on MseeP](https://mseep.ai/badge.svg)](https://mseep.ai/app/ae24a36c-f029-49b3-9c42-fc111021add0)\n[![MseeP.ai Security Assessment Badge](https://mseep.net/pr/overstarry-qweather-mcp-badge.png)](https://mseep.ai/app/overstarry-qweather-mcp)\n[![smithery badge](https://smithery.ai/badge/@overstarry/qweather-mcp)](https://smithery.ai/server/@overstarry/qweather-mcp)\n\nEnglish | [简体中文](./README.zh-CN.md)\n\n> MCP server for [QWeather](https://www.qweather.com/) API, providing comprehensive weather information query capabilities through Model Context Protocol (MCP).\n\n## ✨ Features\n\n- 🌤️ Real-time weather queries\n- 📅 Multi-day weather forecasts (3/7/10/15/30 days)\n- 🔐 JWT (EdDSA/Ed25519) **and** legacy API Key authentication\n- 🔌 Custom API base URL support\n- 🛠️ Complete tool integration\n\n## 📦 Installation\n\n### Via Smithery\n\nRecommended: Install automatically for Claude Desktop using [Smithery](https://smithery.ai/server/@overstarry/qweather-mcp):\n\n```bash\nnpx -y @smithery/cli install @overstarry/qweather-mcp --client claude\n```\n\n### Manual Configuration\n\n1. First, get your credentials from the [QWeather Console](https://console.qweather.com/).\n2. Start the server:\n\n```bash\n# stdio server\nnpx -y qweather-mcp\n```\n\n3. Configure environment variables (pick **one** of the two auth modes below).\n\n### 🔐 JWT Authentication (recommended)\n\nQWeather has announced that **API Key authentication will be deprecated in 2027** and recommends migrating to JWT (EdDSA + Ed25519). Generate an Ed25519 key pair, upload the public key to the QWeather console, and configure:\n\n```bash\nQWEATHER_API_BASE=https://<your-host>.qweatherapi.com\nQWEATHER_PROJECT_ID=<project-id>\nQWEATHER_KEY_ID=<credential-id>\n# Either pass the PEM path…\nQWEATHER_PRIVATE_KEY_PATH=/path/to/ed25519-private.pem\n# …or the PEM content directly (newlines preserved)\n# QWEATHER_PRIVATE_KEY=\"-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\"\n```\n\nIf both `QWEATHER_PRIVATE_KEY_PATH` and `QWEATHER_PRIVATE_KEY` are provided, the path takes precedence. For `QWEATHER_PRIVATE_KEY`, the literal two-character sequence `\\n` is auto-converted to real newlines, so the single-line form above works in shells, `.env` files, and JSON configs.\n\nJSON config example:\n\n```json\n{\n  \"mcpServers\": {\n    \"qweather\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"qweather-mcp\"],\n      \"env\": {\n        \"QWEATHER_API_BASE\": \"https://<your-host>.qweatherapi.com\",\n        \"QWEATHER_PROJECT_ID\": \"<project-id>\",\n        \"QWEATHER_KEY_ID\": \"<credential-id>\",\n        \"QWEATHER_PRIVATE_KEY_PATH\": \"/path/to/ed25519-private.pem\"\n      }\n    }\n  }\n}\n```\n\nJWT details: tokens are signed with `alg=EdDSA`, `iat` is back-dated 30s to tolerate clock skew, `exp = iat + 900s` (15 min, well under QWeather's 24h cap), and tokens are cached and reused until ~30s before expiry. See the [official authentication docs](https://dev.qweather.com/docs/configuration/authentication/#json-web-token).\n\n### 🔑 API Key Authentication (legacy)\n\n```bash\nQWEATHER_API_BASE=https://api.qweather.com\nQWEATHER_API_KEY=<your-api-key>\n```\n\nJSON config example:\n\n```json\n{\n  \"mcpServers\": {\n    \"qweather\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"qweather-mcp\"],\n      \"env\": {\n        \"QWEATHER_API_BASE\": \"<your-api-url>\",\n        \"QWEATHER_API_KEY\": \"<your-api-key>\"\n      }\n    }\n  }\n}\n```\n\n### Mode detection\n\n| Env vars present | Mode |\n|---|---|\n| Full JWT vars (`QWEATHER_PROJECT_ID` + `QWEATHER_KEY_ID` + `QWEATHER_PRIVATE_KEY[_PATH]`) | **JWT** (wins even if `QWEATHER_API_KEY` is also set) |\n| Full JWT vars + `QWEATHER_API_KEY` | **JWT** (API Key is ignored) |\n| Partial JWT vars + `QWEATHER_API_KEY` | API Key, with a startup warning to stderr |\n| Partial JWT vars only | startup error |\n| `QWEATHER_API_KEY` only | API Key |\n| neither | startup error |\n\nThe active mode is logged to stderr at startup, e.g. `Weather MCP Server running on stdio (auth: JWT/EdDSA)`.\n\n## 🛠️ Available Tools\n\n### get-weather-now\n\nGet current weather information for a specified location.\n\n### get-weather-forecast\n\nGet weather forecast information for a specified location with customizable forecast days:\n- 3-day forecast\n- 7-day forecast\n- 10-day forecast\n- 15-day forecast\n- 30-day forecast\n\nForecast data includes:\n- Temperature range (min/max)\n- Day/night weather conditions\n- Sunrise/sunset times\n- Precipitation\n- Humidity\n- Wind conditions\n- UV index\n\n### get-minutely-precipitation\n\nProvides minute-by-minute precipitation forecast for the next 2 hours, including:\n- Precipitation type (rain/snow)\n- Precipitation amount per minute\n- Precise time predictions\n- Real-time forecast descriptions\n\n### get-hourly-forecast\n\nProvides hourly weather forecasts for 24, 72, or 168 hours, including:\n- Temperature changes\n- Weather conditions\n- Wind direction and force\n- Relative humidity\n- Atmospheric pressure\n- Precipitation probability\n- Cloud coverage\n\n### get-weather-warning\n\nProvides real-time weather warning information, including:\n- Warning issuing authority\n- Warning level and type\n- Detailed warning content\n- Warning validity period\n- Related recommendations\n\n### get-weather-indices\n\nProvides weather life indices information, supporting various index types:\n- Sports index\n- Car wash index\n- Dressing index\n- Fishing index\n- UV index\n- Tourism index\n- Allergy index\nand 16 other life indices\n\n### get-air-quality\n\nProvides real-time air quality data, including:\n- AQI index\n- Air quality level\n- Primary pollutants\n- Health advice\n- Pollutant concentrations\n\n### get-air-quality-hourly\n\nProvides hourly air quality forecast for the next 24 hours:\n- Hourly AQI predictions\n- Pollutant concentration changes\n- Health impact assessment\n- Protection recommendations\n\n### get-air-quality-daily\n\nProvides air quality forecast for the next 3 days:\n- Daily AQI predictions\n- Primary pollutant forecasts\n- Air quality level changes\n- Health protection advice\n\n## 🤝 Contributing\n\nIssues and improvements are welcome! Please check our contribution guidelines.\n\n## 📄 License\n\nMIT\n\n## 🔗 Related Links\n\n- [QWeather Official Website](https://www.qweather.com/)\n- [API Documentation](https://dev.qweather.com/)\n- [Console](https://console.qweather.com/)\n",
  "bytes": 6221,
  "sha": "899feaf7fc5ebfa344a865c18e6438299b6b89bf90aabc259902bb17b1c52038",
  "repo_slug": "overstarry/qweather-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_overstarry_qweather_mcp_0501254a/readme"
}