- Home
- MCP servers
- China Weather
China Weather
- python
2
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"dlyzzt-china-weather-mcp-server": {
"command": "uv",
"args": [
"--directory",
"path/china-weather-mcp-server",
"run",
"weather.py"
],
"env": {
"AMAP_API_KEY": "your_api_key_here"
}
}
}
}You can access real-time weather information for Chinese cities through this MCP server, which uses the AMap Weather API to answer weather questions in your AI assistants. It provides an asynchronous, easy-to-use MCP interface so your clients can retrieve current conditions quickly and reliably.
How to use
You will run the server locally and connect to it from your MCP client. The server exposes a single tool you can invoke: get_weather(city: str). Use this to fetch current weather data for a specified Chinese city. Your MCP client can request weather data by city name and receive structured, up-to-date results returned by the server.
How to install
Prerequisites: Python 3.12 or higher and the uv tool for running Python MCP servers.
curl -LsSf https://astral.sh/uv/install.sh | sh
git clone https://github.com/DLYZZT/china-weather-mcp-server.git
cd china-weather-mcp-server
uv pip install .
Configuration
Obtain an API key from the AMap Developer Platform and set it as an environment variable to authorize requests.
export AMAP_API_KEY="your_api_key_here"
Usage with Claude Desktop
To integrate with Claude Desktop, add your MCP server configuration to Claude’s config file. This ensures Claude can forward weather queries to the MCP server and return results in your conversations.
{
"mcpServers": {
"weather": {
"command": "uv",
"args": [
"--directory",
"path/china-weather-mcp-server",
"run",
"weather.py"
],
"env": {
"AMAP_API_KEY": "your_api_key_here"
}
}
}
}
Additional notes
The server runs as a local stdio MCP endpoint. Ensure your environment variable AMAP_API_KEY is set before starting. The tool provided is get_weather(city: str), which returns the current weather for the requested Chinese city.
Available tools
get_weather(city: str)
Fetches current weather information for a specified Chinese city from the AMap Weather API via the MCP server.