Provides tools for calculating driving routes with real-time traffic data, comparing route alternatives, getting live traffic conditions, and estimating trip costs including fuel and tolls through the Google Maps API.
Google Maps MCP Server for Cloud Run
A Google Maps Model Context Protocol (MCP) server designed for deployment on Google Cloud Run with public access. This server provides Google Maps functionality to Claude Desktop clients through a secure, rate-limited API.
Features
Route Calculation: Optimal driving routes with real-time traffic data
Route Comparison: Compare multiple routing alternatives with different options
Live Traffic: Current traffic conditions and travel time analysis
Cost Estimation: Trip cost calculations including fuel and toll estimates
Public Access: No authentication required for easy sharing
Rate Limiting: 50 requests per hour per IP address
Cloud Run Optimized: Designed for serverless deployment on GCP
Prerequisites
Google Cloud Platform account with billing enabled
Google Cloud CLI (
gcloud) installed and configuredNode.js 18+ for local development
Google Maps API key with required APIs enabled
Required Google Maps APIs
Before deployment, enable these APIs in your GCP project:
Directions API - For route calculations
Geocoding API - For address resolution
Maps JavaScript API - For polyline encoding (optional)
Enable APIs via Google Cloud Console or CLI:
Quick Start
1. Get Google Maps API Key
Create a new API key or use an existing one
Restrict the key to the required APIs listed above
Note your API key for deployment
2. Deploy to Cloud Run
3. Extract Service URL
After deployment, extract your service URL:
Manual Deployment
If you prefer manual deployment:
Claude Desktop Configuration
Add this configuration to your Claude Desktop settings:
Replace YOUR-SERVICE-URL.run.app with your actual Cloud Run service URL.
Finding Your Claude Desktop Config
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
Available Tools
The MCP server provides these tools to Claude:
calculate_route - Calculate optimal driving routes with traffic
compare_routes - Compare multiple route alternatives
get_live_traffic - Get current traffic conditions
estimate_costs - Calculate trip costs (fuel + tolls)
Service Endpoints
MCP Endpoint:
https://your-service.run.app/sseHealth Check:
https://your-service.run.app/healthUsage Stats:
https://your-service.run.app/stats
Local Development
Troubleshooting
Common Deployment Issues
1. Permission Denied
2. API Not Enabled
3. Billing Not Enabled
Visit GCP Billing Console
Enable billing for your project
4. Invalid API Key
5. Service Won't Start
Common Runtime Issues
Rate Limiting
Each IP is limited to 50 requests per hour
Check
/statsendpoint for current usageConsider implementing user authentication for higher limits
API Quota Exceeded
Monitor your Google Maps API usage in GCP Console
Increase quotas if needed
Consider implementing caching for repeated requests
Testing Your Deployment
Security Considerations
API key is stored as environment variable (secure)
Service allows public access (no authentication required)
Rate limiting prevents abuse (50 requests/hour per IP)
No sensitive data is logged or stored
Cost Management
Cloud Run: Pay-per-request pricing
Google Maps API: Pay-per-API-call pricing
Monitoring: Use GCP billing alerts to track costs
Set up billing alerts:
Documentation Links
Support and Troubleshooting Resources
License
MIT License - see LICENSE file for details.
Contributing
Fork the repository
Create a feature branch
Make your changes
Test thoroughly
Submit a pull request
Note: This server is designed for development and testing purposes. For production use with high traffic, consider implementing additional security measures and monitoring.