Amap Карты
Amap Maps — это сервер, который поддерживает любой клиент протокола MCP, позволяя пользователям легко использовать сервер Amap Maps для различных услуг на основе местоположения.
Обзор
Что такое Amap Maps?
Amap Maps — это сервер, который поддерживает любой клиент MCP протокола, позволяя пользователям легко использовать сервер Amap Maps для различных услуг на основе местоположения.
Как использовать Amap Maps?
Чтобы использовать Amap Maps, настройте его в совместимом клиенте, таком как Cursor, скопировав свой API-ключ и установив команду сервера в соответствии с документацией.
Ключевые особенности Amap Maps
- Поддерживает несколько услуг местоположения, включая геокодирование, погоду и измерение расстояния.
- Предоставляет API для различных видов транспорта, включая пешие прогулки, вождение и общественный транспорт.
- Позволяет проводить детальные поиски точек интереса (POI) на основе ключевых слов или местоположения.
Примеры использования Amap Maps
- Преобразование географических координат в административные адреса.
- Планирование маршрутов для велосипедных поездок, пеших прогулок или вождения.
- Поиск ближайших точек интереса на основе заданных пользователем критериев.
Часто задаваемые вопросы о Amap Maps
-
Какие типы услуг местоположения предоставляет Amap Maps?
Amap Maps предоставляет геокодирование, информацию о погоде, измерение расстояния и планирование маршрутов для различных видов транспорта.
-
Существует ли ограничение на количество запросов, которые я могу сделать?
Ограничения по использованию зависят от API-ключа и конкретной услуги, которая используется. Пожалуйста, обратитесь к документации Amap для получения подробной информации.
-
Как я могу получить API-ключ?
Вы можете получить API-ключ, создав проект на платформе разработчиков Amap.
Деталь
Clients supporting the MCP protocol (e.g., Cursor, Claude, Cline) can easily use the Amap Maps MCP server. Currently, it supports MCP (SSE) and Node.js I/O connection methods.
1. Accessing MCP Service via SSE on the Cursor Platform
1.1 Install Cursor
It is recommended to use the latest version of the Cursor client. Install Cursor.
Note: Please log in to your Cursor personal account to use large model features.
1.2 Configure SSE Connection in Cursor Settings
1.3 Add a New MCP Server Configuration
{
"mcpServers": {
"amap-amap-sse": {
"url": "https://mcp.amap.com/sse?key=<your_key>"
}
}
}
1.4 Check MCP Service Tool Status in Cursor Settings
Tip: If a "Client closed" error occurs, click the Enabled button to resolve it, as shown below:
1.5 Select a Large Model for Better Experience
It is recommended to choose claude-3.7-sonnet.
1.6 Model Interaction Mode: Select Agent Mode
Press CTRL/CMD + L to open the dialog box on the right side of the editor.
1.7 Start Using
Learn how to use Amap MCP for planning scheme design and map visualization scenarios. Refer to Application Cases.
2. Accessing MCP Service via SSE with Spring AI
2.1 Configuration
spring.ai.mcp.client.connection-timeout=60s
spring.ai.mcp.client.type=ASYNC
# Note: Do not include the Amap SSE connection in the configuration file
2.2 Add Configuration Class
@Configuration
public class McpConfig {
@Bean
public List<NamedClientMcpTransport> mcpClientTransport() {
McpClientTransport transport = HttpClientSseClientTransport
.builder("https://mcp.amap.com")
.sseEndpoint("/sse?key=<your_key>")
.objectMapper(new ObjectMapper())
.build();
return Collections.singletonList(new NamedClientMcpTransport("amap", transport));
}
}
2.3 Usage
@Autowired
List<McpAsyncClient> mcpAsyncClients;
@RequestMapping("/test")
public Mono<McpSchema.CallToolResult> test() {
var mcpClient = mcpAsyncClients.get(0);
return mcpClient.listTools()
.flatMap(tools -> {
logger.info("tools: {}", tools);
return mcpClient.callTool(
new McpSchema.CallToolRequest(
"maps_weather",
Map.of("city", "Beijing")
)
);
});
}
2.4 Start Using
Learn how to use Amap MCP for planning scheme design and map visualization scenarios. Refer to Application Cases.
3. Accessing MCP Service via Node.js I/O on the Cursor Platform
3.1 Install Node.js
Download the Node.js application suitable for your operating system.
Tip:
- Ensure Node.js is installed and check that the local Node.js version is v22.14.0 or higher. It is recommended to use v22.14.0 or above for optimal compatibility and performance.
- Verify that the npm registry is set to the default source (https://registry.npmjs.org/).
Check command:
npm config get registry
3.2 Install Cursor
It is recommended to use the latest version of the Cursor client. Install Cursor.
Note: Please log in to your Cursor personal account to use large model features.
3.3 Configure MCP Server in Cursor Settings
3.4 Add a New MCP Server Configuration
{
"mcpServers": {
"amap-maps": {
"command": "npx",
"args": ["-y", "@amap/amap-maps-mcp-server"],
"env": {
"AMAP_MAPS_API_KEY": "<your_key>"
}
}
}
}
3.5 Check MCP Service Tool Status in Cursor Settings
The MCP Server — amap-maps Tools status is normal and available, as shown above.
Tip: If a "Client closed" error occurs, click the Enabled button to resolve it, as shown below:
3.6 Select a Large Model for Better Experience
It is recommended to choose claude-3.7 unitàsonnet.
3.7 Model Interaction Mode: Select Agent Mode
Press CTRL/CMD + L to open the dialog box on the right side of the editor.
3.8 Start Using
Learn how to use Amap MCP for planning scheme design and map visualization scenarios. Refer to Application Cases.
Конфигурация сервера
{
"mcpServers": {
"amap-maps": {
"command": "npx",
"args": [
"-y",
"@amap/amap-maps-mcp-server"
],
"env": {
"AMAP_MAPS_API_KEY": "api_key"
}
}
}
}