weather-china-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@weather-china-mcpwhat's the weather in Chengdu?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π€ Weather China MCP Server
A Model Context Protocol (MCP) server that provides real-time weather and 3-day forecast for Chinese cities, powered by QWeather (ει£ε€©ζ°) API.
Inspiration: This project is a learning exercise by the author, inspired by the MCP server weather tutorial on modelcontextprotocol.io β which demonstrated building a US weather MCP server. This is the Chinese weather counterpart, adapted for the QWeather API.
β¨ Features
Real-time weather β temperature, feels-like, humidity, wind, visibility, and more
3-day forecast β daily high/low, day/night weather, humidity, wind
MCP-native β works with any MCP-compatible client (Claude Code, Codex, OpenClaw, etc.)
Secure β API credentials stored in
.env, never committed to Git
Related MCP server: AMap Weather MCP
π Prerequisites
Requirement | Description |
Python | β₯ 3.11 |
uv | Python package manager (install) |
QWeather Account | Free tier: 1,000 calls/day. Register at console.qweather.com |
After registering on QWeather Console:
Create a project β get your API Key
Go to Settings β copy your dedicated API Host (format:
xxx.xxx.qweatherapi.com)
π Quick Start
# 1. Clone the repo
git clone <your-repo-url>
cd weather-china
# 2. Set up environment variables
cp .env.example .env
# Edit .env and fill in your QWeather API Key & API Host
# 3. Install dependencies
uv sync
# 4. Run the server (for testing)
uv run weather.pyπ§ MCP Client Configuration
Claude Code
Add to .mcp.json in your project root (or ~/.claude/mcp.json for global):
{
"mcpServers": {
"weather-china": {
"command": "uv",
"args": [
"--directory",
"/path/to/weather-china",
"run",
"weather.py"
]
}
}
}Restart Claude Code or run /mcp reload to pick up the change.
Codex (OpenAI)
In Codex, open Settings β MCP Servers β Add:
{
"mcpServers": {
"weather-china": {
"command": "uv",
"args": [
"--directory",
"/path/to/weather-china",
"run",
"weather.py"
]
}
}
}OpenClaw
Add to your OpenClaw MCP configuration file:
mcp_servers:
weather-china:
command: uv
args:
- --directory
- /path/to/weather-china
- run
- weather.pyOther MCP Clients (Generic stdio)
Any MCP client that supports stdio transport:
{
"mcpServers": {
"weather-china": {
"command": "uv",
"args": ["--directory", "/path/to/weather-china", "run", "weather.py"],
"env": {
"QWEATHER_API_KEY": "<your-api-key>",
"QWEATHER_API_HOST": "<your-api-host>"
}
}
}
}Note: If your client doesn't inherit shell environment variables, pass
QWEATHER_API_KEYandQWEATHER_API_HOSTvia theenvfield as shown above. When using.envfile, the server loads them automatically.
π Available Tools
get_weather
Get real-time weather for a Chinese city.
Parameters:
city: string β City name (e.g., "εδΊ¬", "δΈζ΅·", "εΉΏε·")get_forecast
Get 3-day weather forecast for a Chinese city.
Parameters:
city: string β City name (e.g., "εδΊ¬", "δΈζ΅·", "εΉΏε·")π Project Structure
weather-china/
βββ weather.py # MCP server β main entry point
βββ main.py # Placeholder entry
βββ .env.example # Environment variable template
βββ .env # Your credentials (gitignored)
βββ .gitignore
βββ .mcp.json # Claude Code MCP config (example)
βββ pyproject.toml # Python project metadata & dependencies
βββ uv.lock # Dependency lock file
βββ README.md # English readme
βββ README.zh.md # Chinese readmeπ Security
.envis listed in.gitignoreβ never commit your API credentials.env.exampleprovides a template for others to set up their own credentialsBoth
QWEATHER_API_KEYandQWEATHER_API_HOSTare read from environment variables, not hardcoded
π License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides weather forecast data for locations in China through HeFeng Weather API, supporting real-time, hourly, and daily forecasts with full Chinese weather descriptions.Last updated316ISC
- Alicense-qualityDmaintenanceAn MCP server that provides real-time weather information, 4-day forecasts, and city search functionality for Chinese cities via the AMap API. It enables users to query weather data using city names or administrative codes through natural language interactions.Last updated1MIT
- Flicense-qualityDmaintenanceAn MCP server integrated with the QWeather API that provides real-time weather forecasts and meteorological warnings for AI assistants. It enables users to query current conditions and disaster alerts for specific cities or coordinates.Last updated21
- FlicenseAqualityCmaintenanceEnables querying real-time weather, forecasts, and warnings for Chinese cities via the QWeather API.Last updated31
Related MCP Connectors
MCP server for GLM chat completions using Zhipu AI models via AceDataCloud
WeatherAPI.com MCP β wraps WeatherAPI.com (api.weatherapi.com)
OpenWeather MCP β wraps the OpenWeatherMap API (openweathermap.org)
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/killerfirst/weather-china-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server