基于高德地图 API 的中国城市天气查询 MCP Server
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"amap-weather-mcp-server": {
"command": "<see-readme>",
"args": []
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
基于高德地图 API 的中国城市天气查询 Model Context Protocol (MCP) 服务。该服务允许用户通过简单的请求获取中国各城市的实时天气状况和未来几天的天气预报。
No automated test available for this server. Check the GitHub README for setup instructions.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in maps
A Model Context Protocol (MCP) server providing TomTom's location services, search, routing, and traffic data to AI agents.
Real-time BART departures, trip planning, fares, stations, and advisories.
MCP server for the VesselAPI — maritime vessel tracking, port events, emissions, and navigation data
Fair meeting point discovery for AI agents with isochrone-based travel time fairness
MCP Security Weekly
Get CVE alerts and security updates for Amap Weather Mcp Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
基于高德地图 API 的中国城市天气查询 Model Context Protocol (MCP) 服务。该服务允许用户通过简单的请求获取中国各城市的实时天气状况和未来几天的天气预报。
uv venv
source .venv/bin/activate
uv add "mcp[cli]" httpx
如果你需要自行创建客户端测试该 MCP 服务,请手动启动。 在终端中执行以下命令启动 MCP 服务:
uv run weather.py
如果想在 Claude Desktop 中使用,请添加服务器配置:
请在文本编辑器中打开 Claude for Desktop App 配置,路径参考如下 ~/Library/Application Support/Claude/claude_desktop_config.json
如果文件不存在,请确保创建该文件。
{
"mcpServers": {
"amap-weather-mcp-server": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/weather",
"run",
"weather.py"
],
"env": {
"AMAP_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
如下图所示配置即可:

MCP 服务提供了三个主要工具函数用于天气查询:
get_current_weather: 获取城市当前天气状况get_weather_forecast: 获取未来几天的天气预报search_city: 搜索城市名称使用 MCP 客户端调用示例:
from mcp.client import Client
# 连接到服务
client = Client("amap-weather-mcp-server")
# 查询实时天气
current_weather = await client.get_current_weather("北京市")
print(current_weather)
# 查询天气预报
forecast = await client.get_weather_forecast("上海市")
print(forecast)
# 搜索城市名称
cities = await client.search_city("广州")
print(cities)
获取指定城市的实时天气数据。
参数:
city: 中国城市名称,需要包含省/市/县等行政区划标识,如"北京市"、"上海市"、"海珠区"等返回: 格式化的城市实时天气信息字符串,包括:
获取指定城市的天气预报(未来3-4天)。
参数:
city: 中国城市名称,需要包含省/市/县等行政区划标识,如"北京市"、"上海市"、"浙江省杭州市"等返回: 格式化的城市天气预报信息字符串,包括:
根据关键词搜索匹配的城市名称。
参数:
keyword: 城市名称关键词,建议包含省/市/县等行政区划标识,如"广州市"、"海珠区"等返回: 包含匹配城市名称列表的字符串。
本服务使用高德地图开放平台提供的天气数据 API: