home / mcp / amap map mcp server
https://github.com/zxypro1/amap-maps-mcp-server
Configuration
View docs{
"mcpServers": {
"masx200-amap-maps-mcp-server": {
"url": "http://localhost:3000/mcp",
"headers": {
"HTTP_API_PORT": "3000",
"HTTP_API_TOKEN": "YOUR_HTTP_API_TOKEN",
"AMAP_MAPS_API_KEY": "YOUR_AMAP_MAPS_API_KEY"
}
}
}
}You can run an MCP server for the AMap Map API that lets MCP protocol clients access AMap services such as geocoding, weather, and routing. This guide shows how to configure the server, start a streamable HTTP endpoint, and connect MCP clients to use the API key securely.
Connect an MCP client to the AMap Map MCP Server using the HTTP endpoint or the streamable HTTP service. Provide your AMap Maps API key in the server configuration to enable authentication with AMap services. If you enable the HTTP API, you can enforce an optional access token for extra security.
Prerequisites you need on your machine: a recent version of Node.js and npm or npx available in your shell.
Create a configuration file for the MCP server. Use the following JSON as a starting point and replace YOUR_AMAP_MAPS_API_KEY with the key you obtain from the AMap developer portal.
{
"mcpServers": {
"amap-maps": {
"command": "npx",
"args": ["-y", "@masx200/amap-maps-mcp-server"],
"env": {
"AMAP_MAPS_API_KEY": "YOUR_AMAP_MAPS_API_KEY"
}
}
}
}You can also run a standalone streamable HTTP protocol server in addition to the MCP server. Set environment variables as needed, then start the server.
# Direct start
node ./build/streamable-http.js
# With environment variables (examples)
export HTTP_API_PORT=3000
export HTTP_API_TOKEN=your-secret-token
export AMAP_MAPS_API_KEY=your-amap-api-key
node ./build/streamable-http.jsWhen started, the HTTP streamable server runs at http://localhost:3000. It supports the MCP endpoint at POST /mcp and can provide real-time data streams via the streamable-http protocol. If you set an access token, include it in requests as an Authorization header.
Keep your AMap Maps API key secure. If you enable the HTTP API token, only clients that present the correct token can access the MCP endpoints.