google-maps-mcp-server

by david-pivonka

Not rated
GitHub

About

STDIO-based MCP server for Google Maps Platform APIs

Details

Author
david-pivonka
Categories
Search, Other, API

Setup

Install google-maps-mcp-server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/david-pivonka/google-maps-mcp-server

Follow the installation instructions in the repository README, then restart your MCP client.

STDIO-based MCP server for Google Maps Platform APIs

A Model Context Protocol (MCP) server that provides comprehensive access to Google Maps Platform APIs. This server enables LLMs to perform geocoding, places search, routing, and other geospatial operations through a standardized interface.

- πŸ—ΊοΈComprehensive Google Maps Integration- Access to Places, Routes, Geocoding, and utility APIs
- πŸ”Advanced Places Search- Text search, nearby search, autocomplete, and detailed place information
- πŸ›£οΈSmart Routing- Route computation with real-time traffic, tolls, and alternative routes
- πŸ“Precise Geocoding- Forward and reverse geocoding with international support
- 🌐Geolocation Services- IP-based and WiFi/cellular location estimation
- πŸ“ŠRich Resources- Built-in documentation and examples accessible via MCP resources
- πŸ”’Security First- Input validation, rate limiting, and secure API key handling
- Visit theGoogle Cloud Console
- Create a new project or select an existing one
- Enable the required APIs (see API requirements by tool below)
- Create an API key and restrict it to the enabled APIs
- Important: This server uses thenewGoogle Maps Platform APIs (Places API (New) and Routes API), not the legacy versions

Add the server to your MCP client configuration:

Add to your Cursor MCP settings (~/.cursor/mcp.jsonor through Command Palette > Open MCP Settings > New MCP Server):

{ "mcpServers": { "google-maps": { "command": "npx", "args": ["-y", "google-maps-mcp-server"], "env": { "GOOGLE_MAPS_API_KEY": "your-api-key-here" } } } }
{ "mcpServers": { "google-maps": { "command": "npx", "args": ["-y", "google-maps-mcp-server"], "env": { "GOOGLE_MAPS_API_KEY": "your-api-key-here", "GOOGLE_MAPS_RATE_LIMIT_ENABLED": "true", "GOOGLE_MAPS_RATE_LIMIT_WINDOW_MS": "120000", "GOOGLE_MAPS_RATE_LIMIT_MAX_REQUESTS": "200" } } } }
{ "mcpServers": { "google-maps": { "command": "npx", "args": ["google-maps-mcp-server"], "env": { "GOOGLE_MAPS_API_KEY": "your-api-key-here" } } } }
{ "mcpServers": { "google-maps": { "command": "npx", "args": ["google-maps-mcp-server"], "env": { "GOOGLE_MAPS_API_KEY": "your-api-key-here", "GOOGLE_MAPS_RATE_LIMIT_ENABLED": "false" } } } }
# Set environment variable export GOOGLE_MAPS_API_KEY="your-api-key-here" # Run the server npx google-maps-mcp-server

- geocode_search- Convert addresses to coordinates
- geocode_reverse- Convert coordinates to addresses

- places_search_text- Search places with natural language
- places_nearby- Find places within a radius
- places_autocomplete- Get place suggestions
- places_details- Get detailed place information
- places_photos- Get place photo URLs

- routes_compute- Calculate optimal routes
- routes_matrix- Compute distance matrices

- elevation_get- Get elevation data
- timezone_get- Get timezone information
- geolocation_estimate- Estimate location from WiFi/cell data
- roads_nearest- Find nearest roads

- nearby_find- Find nearby cities, towns, or POIs
- ip_geolocate- Geolocate using IP address

{ "tool": "places_nearby", "arguments": { "location": {"lat": 37.7749, "lng": -122.4194}, "radius_meters": 1000, "included_types": ["restaurant"], "max_results": 10 } }
{ "tool": "routes_compute", "arguments": { "origin": {"address": "San Francisco, CA"}, "destination": {"address": "Los Angeles, CA"}, "travel_mode": "DRIVE", "routing_preference": "TRAFFIC_AWARE" } }
{ "tool": "geocode_search", "arguments": { "query": "1600 Amphitheatre Parkway, Mountain View, CA", "language": "en" } }
{ "tool": "ip_geolocate", "arguments": { "reverse_geocode": true } }

Theip_geolocatetool also supports an optionalip_overrideparameter for testing with different IP addresses:

{ "tool": "ip_geolocate", "arguments": { "ip_override": "8.8.8.8", "reverse_geocode": true } }

Note:Theip_overrideparameter accepts public IPv4 or IPv6 addresses. Private and reserved IP ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.0/8) are rejected. The IP override is best-effort and Google's Geolocation API may not always honor the request.

- GOOGLE_MAPS_API_KEY(required) - Your Google Maps Platform API key

- GOOGLE_MAPS_RATE_LIMIT_ENABLED(optional, default:true) - Enable/disable rate limiting

- Set tofalseto disable rate limiting entirely

- Controls the time window for rate limiting (e.g., 60000 = 1 minute)

- Maximum number of requests allowed per endpoint within the time window

# Default rate limiting (100 requests per minute per endpoint) GOOGLE_MAPS_API_KEY="your-api-key-here" # Disable rate limiting entirely GOOGLE_MAPS_API_KEY="your-api-key-here" GOOGLE_MAPS_RATE_LIMIT_ENABLED=false # Custom rate limiting (200 requests per 2 minutes per endpoint) GOOGLE_MAPS_API_KEY="your-api-key-here" GOOGLE_MAPS_RATE_LIMIT_WINDOW_MS=120000 GOOGLE_MAPS_RATE_LIMIT_MAX_REQUESTS=200 # Stricter rate limiting (50 requests per 30 seconds per endpoint) GOOGLE_MAPS_API_KEY="your-api-key-here" GOOGLE_MAPS_RATE_LIMIT_WINDOW_MS=30000 GOOGLE_MAPS_RATE_LIMIT_MAX_REQUESTS=50

This server uses Google Maps Platform APIs which require billing to be enabled. Monitor your usage in the Google Cloud Console to avoid unexpected charges. Consider implementing usage limits in your application.

The server provides built-in MCP resources with documentation and examples:

- google-maps://docs/api-overview- API overview and capabilities
- google-maps://docs/place-types- Complete place types reference
- google-maps://docs/travel-modes- Available travel modes
- google-maps://docs/field-masks- Places API field optimization
- google-maps://examples/common-queries- Example queries and patterns

Access these through your MCP client's resource interface.

git clone <repository-url> cd google-maps-mcp-server npm install npm run build
npm run build GOOGLE_MAPS_API_KEY="your-api-key-here" npx @modelcontextprotocol/inspector ./dist/index.js

The server returns structured errors with helpful context:

{ "error": { "code": "QUOTA_EXCEEDED", "message": "API quota exceeded", "context": { "endpoint": "/places/textsearch", "status": 429 } } }

- INVALID_REQUEST- Invalid input parameters
- API_KEY_INVALID- Invalid or missing API key
- QUOTA_EXCEEDED- API quota exceeded
- REQUEST_FAILED- Network or API request failed

- API keys are never logged or exposed
- Input validation prevents injection attacks
- Rate limiting protects against abuse
- IP addresses are hashed in logs for privacy

Contributions are welcome! Please submit pull requests to our GitHub repository.

MIT License - seeLICENSEfile for details.

Search global news using natural language. Webz.io News Search API returns the most relevant articles and content, with filters for source, country, language, date, sentiment, and category.

Unlock geospatial intelligence through Mapbox APIs like geocoding, POI search, directions, isochrones and more.

Free business data API and MCP server. Find restaurants, cafes, hotels, shops and 37+ business categories in any city worldwide. Uses OpenStreetMap data. No API key required. REST API + MCP Streamable HTTP endpoint.

Provides access to the Israeli transport API for geocoding and transit directions.

Provides geolocation and nearby POI (Point of Interest) information using the Gaode Map API.

Provides geocoding services by integrating with the Nominatim API.

An MCP server for interacting with the Google Maps API, designed for Google Cloud Run.

Provides directions, place search, and geocoding features using the Naver Maps API.

IP2Location.io API integration to retrieve the geolocation information for an IP address.

Search the web using Kagi's search API

Interact & query with Meilisearch (Full-text & semantic search API)

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.