Navigation
China Weather MCP Server: Real-Time Data & Reliable Forecasts - MCP Implementation

China Weather MCP Server: Real-Time Data & Reliable Forecasts

China Weather MCP Server: Effortlessly access real-time weather data across China’s major cities with precision and speed. Your go-to solution for reliable forecasts!

Research And Data
4.8(95 reviews)
142 saves
66 comments

Users create an average of 36 projects per month with this tool

About China Weather MCP Server

What is China Weather MCP Server: Real-Time Data & Reliable Forecasts?

China Weather MCP Server is a specialized service built on the Model Context Protocol (MCP), designed to deliver real-time weather data for cities across China through integration with AMap's weather API. This server acts as a bridge, enabling AI systems and applications to seamlessly access up-to-date meteorological information to enhance decision-making processes or user interactions.

How to use China Weather MCP Server: Real-Time Data & Reliable Forecasts?

Implementing the server involves three core steps:

  1. Setup Environment: Install Python 3.8+ and the uv tool by executing pip install uv.
  2. Configuration: Clone the repository, install dependencies via uv install, and set the AMAP_API_KEY environment variable with your AMap credentials.
  3. Integration: Configure your AI platform (e.g., Claude Desktop) to reference the server's endpoint for weather data queries using the provided API structure.

China Weather MCP Server Features

Key Features of China Weather MCP Server: Real-Time Data & Reliable Forecasts?

  • Real-Time Updates: Immediate access to the latest weather conditions through AMap's high-frequency data refresh.
  • Protocol Compatibility: Full MCP compliance ensures smooth integration with existing AI infrastructure.
  • Scalable Performance: Asynchronous processing architecture handles concurrent queries without latency.
  • Security: Environment-variable-based API key management prevents credentials exposure.

Use cases of China Weather MCP Server: Real-Time Data & Reliable Forecasts?

Typical applications include:

  • AI chatbots providing instant weather updates to users.
  • Automated logistics systems adjusting routes based on real-time precipitation data.
  • Smart home devices preemptively adjusting heating/cooling settings using temperature forecasts.
  • Emergency management platforms monitoring severe weather patterns in real time.

China Weather MCP Server FAQ

FAQ from China Weather MCP Server: Real-Time Data & Reliable Forecasts?

Q: What API limits apply?
A: Rate limits are enforced by AMap's commercial tiers. Contact support for enterprise-grade quotas.
Q: Can it run on non-Linux systems?
A: Yes, the server is platform-agnostic as long as Python and uv dependencies are met.
Q: How to troubleshoot 403 errors?
A: Verify API key validity, check region-specific access permissions, and ensure proper header formatting.

Content

China Weather MCP Server

English | 中文

English

Introduction

China Weather MCP Server is a Model Context Protocol (MCP) server that provides real-time weather information for Chinese cities using the AMap (AutoNavi) Weather API. This server enables AI assistants to access current weather conditions across China.

Features

  • Real-time weather data retrieval for Chinese cities
  • Integration with AMap Weather API
  • Asynchronous request handling
  • Easy-to-use MCP interface

Installation

  1. Ensure Python 3.12 or higher is installed
  2. Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Clone this repository:
git clone https://github.com/DLYZZT/china-weather-mcp-server.git
cd china-weather-mcp-server
  1. Install dependencies with uv:
uv pip install .

Configuration

  1. Get an API key from AMap Developer Platform
  2. Set your API key as an environment variable:
export AMAP_API_KEY="your_api_key_here"

Usage

To use with Claude Desktop, add the following configuration to your Claude Desktop config file:

On Windows: %APPDATA%/Claude/claude_desktop_config.json On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "weather": {
      "command": "uv",
      "args": [
        "--directory",
        "path/china-weather-mcp-server",
        "run",
        "weather.py"
      ],
      "env": {
        "AMAP_API_KEY": "your_api_key_here"
      }
    }
  }
}

The server provides the following tool:

  • get_weather(city: str): Get current weather information for a specified Chinese city

License

This project is licensed under the MIT License - see the LICENSE file for details.


中文

简介

中国天气 MCP 服务器是一个基于模型上下文协议(Model Context Protocol,MCP)的服务器,使用高德地图天气 API 提供中国城市的实时天气信息。该服务器使 AI 助手能够访问中国各地的当前天气状况。

特性

  • 获取中国城市的实时天气数据
  • 集成高德地图天气 API
  • 异步请求处理
  • 简单易用的 MCP 接口

安装方法

  1. 确保已安装 Python 3.12 或更高版本
  2. 安装 uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. 克隆此仓库:
git clone https://github.com/DLYZZT/china-weather-mcp-server.git
cd china-weather-mcp-server
  1. 使用 uv 安装依赖:
uv pip install .

配置

  1. 高德开放平台获取 API 密钥
  2. 设置 API 密钥环境变量:
export AMAP_API_KEY="你的API密钥"

使用方法

要在 Claude Desktop 中使用,请在 Claude Desktop 配置文件中添加以下配置:

Windows系统:%APPDATA%/Claude/claude_desktop_config.json MacOS系统:~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "weather": {
      "command": "uv",
      "args": [
        "--directory",
        "path/china-weather-mcp-server",
        "run",
        "weather.py"
      ],
      "env": {
        "AMAP_API_KEY": "你的API密钥"
      }
    }
  }
}

服务器提供以下工具:

  • get_weather(city: str):获取指定中国城市的当前天气信息

许可证

本项目采用 MIT 许可证 - 详情请参见 LICENSE 文件。

Related MCP Servers & Clients