Google Map
STDIOMCP server providing comprehensive Google Maps API integration with location search, geocoding, and navigation capabilities
MCP server providing comprehensive Google Maps API integration with location search, geocoding, and navigation capabilities
A powerful Model Context Protocol (MCP) server providing comprehensive Google Maps API integration with streamable HTTP transport support and LLM processing capabilities.
This project has received contributions from the community.
Special thanks to @junyinnnn for helping add support for streamablehttp.
This MCP server has been tested and verified to work correctly with:
All tools and features are confirmed functional through real-world testing.
Location Search
Geocoding Services
Distance & Directions
Elevation Data
⚠️ Important Notice: This server uses HTTP transport, not stdio. Direct npx usage in MCP Server Settings is NOT supported.
# Install globally npm install -g @cablate/mcp-google-map # Run the server mcp-google-map --port 3000 --apikey "your_api_key_here" # Using short options mcp-google-map -p 3000 -k "your_api_key_here"
⚠️ Warning: Cannot be used directly in MCP Server Settings with stdio mode
Step 1: Launch HTTP Server in Terminal
# Run in a separate terminal npx @cablate/mcp-google-map --port 3000 --apikey "YOUR_API_KEY" # Or with environment variable GOOGLE_MAPS_API_KEY=YOUR_API_KEY npx @cablate/mcp-google-map
Step 2: Configure MCP Client to Use HTTP
{ "mcp-google-map": { "transport": "http", "url": "http://localhost:3000/mcp" } }
// This WILL NOT WORK - stdio mode not supported with npx { "mcp-google-map": { "command": "npx", "args": ["@cablate/mcp-google-map"] } }
http://localhost:3000/mcpAPI keys can be provided in three ways (priority order):
HTTP Headers (Highest priority)
// MCP Client config { "mcp-google-map": { "transport": "streamableHttp", "url": "http://localhost:3000/mcp", // if your MCP Client support 'headers' "headers": { "X-Google-Maps-API-Key": "YOUR_API_KEY" } } }
Command Line
mcp-google-map --apikey YOUR_API_KEY
Environment Variable (.env file or command line)
GOOGLE_MAPS_API_KEY=your_api_key_here MCP_SERVER_PORT=3000
The server provides the following tools:
# Clone the repository git clone https://github.com/cablate/mcp-google-map.git cd mcp-google-map # Install dependencies npm install # Set up environment variables cp .env.example .env # Edit .env with your API key # Build the project npm run build # Start the server npm start # Or run in development mode npm run dev
src/
├── cli.ts                    # Main CLI entry point
├── config.ts                 # Server configuration
├── index.ts                  # Package exports
├── core/
│   └── BaseMcpServer.ts     # Base MCP server with streamable HTTP
└── tools/
    └── maps/                # Google Maps tools
        ├── toolclass.ts     # Google Maps API client
        ├── searchPlaces.ts  # Maps service layer
        ├── searchNearby.ts  # Search nearby places
        ├── placeDetails.ts  # Place details
        ├── geocode.ts       # Geocoding
        ├── reverseGeocode.ts # Reverse geocoding
        ├── distanceMatrix.ts # Distance matrix
        ├── directions.ts    # Directions
        └── elevation.ts     # Elevation data
MIT
Community participation and contributions are welcome! Here's how you can contribute:
If you have any questions or suggestions, feel free to reach out:
X-Google-Maps-API-Key header in MCP Client config