home / mcp / google maps mcp server
Provides Google Maps route calculations, live traffic, and cost estimates via an MCP API for Claude Desktop clients.
Configuration
View docs{
"mcpServers": {
"arunrajece-google-maps-mcp-cloudrun": {
"url": "https://your-service.run.app/sse",
"headers": {
"GOOGLE_MAPS_API_KEY": "YOUR_API_KEY"
}
}
}
}You run a Google Maps MCP Server on Cloud Run that exposes route calculation, route comparison, live traffic, and cost estimates to Claude Desktop clients through a lightweight, rate-limited API. The server is public by default and is designed for easy sharing and rapid iteration, while enforcing a 50 requests/hour per IP cap to prevent abuse.
You connect Claude Desktop to the MCP Server to perform mapping tasks. Use the HTTP MCP endpoint to receive data from remote clients, or run the server locally and access it via the standard MCP URL. The server provides four tools for Claude: calculate_route, compare_routes, get_live_traffic, and estimate_costs. When you deploy to Cloud Run, you obtain a public URL such as https://your-service.run.app/sse which becomes your MCP service endpoint.
Follow these concrete steps to get started with a Cloud Run deployment and local development environment.
- Google Cloud Platform account with billing enabled - Google Cloud CLI (gcloud) installed and configured - Node.js 18+ for local development - Google Maps API key with required APIs enabled
# Clone the repository
git clone <your-repo-url>
cd google-maps-mcp-cloudrun
# Set your Google Maps API key
export GOOGLE_MAPS_API_KEY="your-api-key-here"
# Deploy using the provided script
./simple-deploy.sh your-gcp-project-id us-central1# Get the service URL
SERVICE_URL=$(gcloud run services describe google-maps-mcp \
--region us-central1 \
--format="value(status.url)")
echo "Your MCP Server URL: $SERVICE_URL/sse"# Set your project
gcloud config set project YOUR_PROJECT_ID
# Enable required services
gcloud services enable run.googleapis.com cloudbuild.googleapis.com
# Deploy
gcloud run deploy google-maps-mcp \
--source . \
--region us-central1 \
--platform managed \
--allow-unauthenticated \
--set-env-vars GOOGLE_MAPS_API_KEY="your-api-key-here" \
--memory 1Gi \
--cpu 1 \
--max-instances 10 \
--timeout 300 \
--port 8080{
"mcpServers": {
"google-maps": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://YOUR-SERVICE-URL.run.app/sse"
]
}
}
}macOS users can find it at ~/Library/Application Support/Claude/claude_desktop_config.json. Windows users can find it at %APPDATA%/Claude/claude_desktop_config.json.
MCP Endpoint: https://your-service.run.app/sse Health Check: https://your-service.run.app/health Usage Stats: https://your-service.run.app/stats
# Install dependencies
npm install
# Copy environment template
cp .env.example .env
# Edit .env with your API key
# GOOGLE_MAPS_API_KEY=your-api-key-here
# Start development server
npm run dev
# Test locally
npm testRefer to these common scenarios and their resolutions. If you encounter a problem, start by confirming your cloud project, region, and API key settings.
- API key is stored as an environment variable and the service allows public access with rate limiting to prevent abuse (50 requests per hour per IP). - Monitor usage via the /stats endpoint and configure billing alerts in Google Cloud Console to manage costs. - Do not log sensitive data; ensure API keys are restricted to the required APIs.
For production use with higher traffic, plan to add stronger authentication, caching, and monitoring. Keep your API key restricted to the necessary APIs and consider rotating keys periodically.
Calculate optimal driving routes with traffic data and real-time considerations.
Compare multiple route options with different options and constraints.
Retrieve current traffic conditions and travel time analysis.
Estimate trip costs including fuel and toll estimates.