360 Secure SkillHub
360 安全技能中心

amap-maps

通过 Node 命令行调用高德地图 LBS 服务,支持地理编码与逆编码、POI 关键词和周边搜索、驾车/步行/骑行/公交路线规划、距离测量、天气查询、IP 定位及导航与打车 URI 生成。需要配置高德 API Key 并联网使用。

elric2011
elric2011
热度 85.38
最近更新 2026-05-11 17:29:08
分类:生活依赖:代码执行 / 第三方 API / MCP 服务应用场景:旅行 / 推荐 / 研究

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add amap-maps
Metadata
name
amap-maps
description
Amap LBS services. Call Amap services via Streamable HTTP MCP, supporting geocoding, route planning, POI search, weather query, distance measurement, and more.
license
MIT
compatibility
Requires Node.js 18+ and AMAP_KEY environment variable
metadata
{"clawdbot":{"emoji":"🧭","requires":{"bins":["node"],"env":["AMAP_KEY"]},"primaryEnv":"AMAP_KEY"}}

Amap Maps Skill

Call Amap services via Streamable HTTP MCP.

Quick Start

1. Install Dependencies

cd amap-maps
npm install

2. Set Environment Variables

export AMAP_KEY="Your Amap Key"

Get Key: https://lbs.amap.com/api/javascript-api-v2/guide/abc/register

3. Use Command Line Tool

# View all commands
node scripts/amap.js help

# Query weather
node scripts/amap.js weather 北京

# Address to coordinates
node scripts/amap.js geo encode "北京市朝阳区望京 SOHO" 北京

# Coordinates to address
node scripts/amap.js geo decode "116.482384,39.998383"

# Search POI
node scripts/amap.js search text 麦当劳 北京

# Nearby search
node scripts/amap.js search around "116.48,39.99" 餐厅 1000

# Route planning
node scripts/amap.js route driving "116.48,39.99" "116.40,39.91"
node scripts/amap.js route walking "116.48,39.99" "116.40,39.91"
node scripts/amap.js route bicycling "116.48,39.99" "116.40,39.91"
node scripts/amap.js route transit "116.48,39.99" "116.40,39.91" "北京" "北京"

# Distance measurement
node scripts/amap.js distance "116.48,39.99" "116.40,39.91" 1

# IP location
node scripts/amap.js ip-location "114.114.114.114"

# Navigation Schema (generate Amap URI)
node scripts/amap.js navi "116.397428" "39.90923"

# Taxi Schema
node scripts/amap.js taxi "116.397428" "39.90923" "天安门"

Tool List (15 tools)

Category Command Description
Weather weather <city> Query city weather
Geocoding geo encode <address> [city] Address → Coordinates
geo decode <coordinates> Coordinates → Address
Search search text <keyword> [city] Keyword search POI
search around <coordinates> <keyword> [radius] Nearby search
search detail <POI_ID> POI details
Routes route driving <origin> <destination> Driving route planning
route walking <origin> <destination> Walking route planning
route bicycling <origin> <destination> Cycling route planning
route transit <origin> <destination> <city> <cityd> Transit route planning
Distance distance <origin> <destination> [type] Distance measurement (0=linear, 1=driving, 3=walking)
Location ip-location <IP> IP location
Schema navi <lon> <lat> Generate navigation URI
taxi <lon> <lat> <name> Generate taxi URI

Common Workflows

Workflow 1: Search Place → Plan Route

# 1. Search destination
node scripts/amap.js search text 天安门 北京

# 2. Get location (coordinates) from results

# 3. Plan driving route
node scripts/amap.js route driving "116.48,39.99" "116.397428,39.90923"

Workflow 2: Current Location Weather

# 1. Get city via IP location
node scripts/amap.js ip-location "114.114.114.114"

# 2. Query weather for that city
node scripts/amap.js weather 南京

Workflow 3: Nearby Exploration

# 1. Address to coordinates
node scripts/amap.js geo encode "北京市朝阳区望京 SOHO"

# 2. Search nearby restaurants
node scripts/amap.js search around "116.47,39.99" 餐厅 1000

Error Handling

Common Errors

Error Cause Solution
AMAP_KEY not set Missing environment variable Run export AMAP_KEY="..."
Invalid API Key Key is invalid or expired Check if Key is correct
Missing parameters Missing required parameters Check command format
Rate limit exceeded Request rate limit exceeded Reduce request frequency

References