The China Weather MCP Server is a Model Context Protocol (MCP) server designed to provide real-time weather information for Chinese cities. It integrates with the AMap (AutoNavi) Weather API, enabling AI assistants to access current weather conditions across China. This server is particularly useful for developers building AI tools that require accurate and up-to-date weather data for Chinese locations.
uv
: Use the following command to install uv
, a Python package manager:shell
curl -LsSf https://astral.sh/uv/install.sh | sh
shell
git clone https://github.com/DLYZZT/china-weather-mcp-server.git
cd china-weather-mcp-server
uv
to install the required Python packages:shell
uv pip install .
shell
export AMAP_API_KEY="your_api_key_here"
To integrate the China Weather MCP Server with Claude Desktop, follow these steps:
%APPDATA%/Claude/claude_desktop_config.json
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Add the server configuration:
json
{
"mcpServers": {
"weather": {
"command": "uv",
"args": [
"--directory",
"path/china-weather-mcp-server",
"run",
"weather.py"
],
"env": {
"AMAP_API_KEY": "your_api_key_here"
}
}
}
}
get_weather
tool: The server provides a get_weather(city: str)
function to retrieve weather data for a specified Chinese city.This project is licensed under the MIT License. For more details, see the LICENSE file.
中国天气 MCP 服务器 是一个基于模型上下文协议(Model Context Protocol,MCP)的服务器,通过集成高德地图天气 API,提供中国城市的实时天气信息。该服务器使 AI 助手能够访问中国各地的当前天气状况,适用于需要中国城市天气数据的开发者。
uv
:使用以下命令安装 uv
:shell
curl -LsSf https://astral.sh/uv/install.sh | sh
shell
git clone https://github.com/DLYZZT/china-weather-mcp-server.git
cd china-weather-mcp-server
uv
安装所需的 Python 包:shell
uv pip install .
shell
export AMAP_API_KEY="你的API密钥"
要在 Claude Desktop 中使用中国天气 MCP 服务器,请按以下步骤操作:
%APPDATA%/Claude/claude_desktop_config.json
MacOS系统:~/Library/Application Support/Claude/claude_desktop_config.json
添加服务器配置:
json
{
"mcpServers": {
"weather": {
"command": "uv",
"args": [
"--directory",
"path/china-weather-mcp-server",
"run",
"weather.py"
],
"env": {
"AMAP_API_KEY": "你的API密钥"
}
}
}
}
get_weather
工具:服务器提供 get_weather(city: str)
函数,用于获取指定中国城市的天气信息。本项目采用 MIT 许可证。详情请参见 LICENSE 文件。