mcp-China-weather
An MCP server for China weather queries based on the 高德 API.
claude mcp add --transport stdio le-dawn-mcp-china-weather-server node /path/to/your/build/index.js \ --env AMAP_API_KEY="your_gaode_api_key_here"
How to use
This MCP server provides real-time and forecast weather information by leveraging the Amap (Gaode) weather APIs. It includes intelligent city-name recognition to convert standard Chinese city names into city codes and supports optional timezone handling. To use it, configure your environment with an Amap API key (AMAP_API_KEY) and start the server. The server exposes endpoints via the MCP protocol and accepts requests containing cityName, optional date, and forecast type to fetch either current conditions or future forecasts. Example requests show how to query a current weather for a city or retrieve a multi-day forecast for a given city and date. The build artifacts are produced from the TypeScript sources, and the runtime relies on Node.js 16+ with a valid API key.
Key capabilities:
- Real-time weather queries for Chinese cities
- Weather forecasts for upcoming days
- Smart city recognition to map city names to codes
- Timezone-aware formatting and output
- Clear error messages and handling for API or network issues
How to install
Prerequisites:
- Node.js 16.0 or higher
- npm (comes with Node.js)
- Amap (Gaode) API key for weather services
Installation steps:
-
Ensure you have Node.js installed. You can download it from https://nodejs.org/. Verify with: node -v
-
Clone or download this MCP server repository to your environment.
-
Install dependencies: npm install
-
Build the project (TypeScript to JavaScript): npm run build
-
Set up your environment variable for the Amap API key (example for Unix-like shells): export AMAP_API_KEY=your_gaode_api_key_here
-
Start the server (production): npm start
-
(Optional) Run in development mode while iterating: npm run dev
Notes:
- Ensure the AMAP_API_KEY is set in the environment before starting the server.
- The build/index.js path in the mcp_config should point to your actual built entry script after npm run build.
Additional notes
Tips and common considerations:
- API quota: The Gaode API has request limits depending on your account type; monitor usage accordingly.
- City name standardization: Use standard Chinese city names (e.g., 北京市, 上海市) for accurate city code mapping.
- Environment security: Keep your API key secure and avoid embedding it in public code.
- Network access: The server must have network access to Gaode API endpoints. Check firewall/proxy settings if requests fail.
- Error handling: If an error occurs (e.g., invalid city, invalid API key, network failure), the server should return clear error messages and status codes to help diagnose issues.
Related MCP Servers
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.