Labsco
arunrajece logo

Google Maps

from arunrajece

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

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

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

Required Google Maps APIs

Before deployment, enable these APIs in your GCP project:

  1. Directions API - For route calculations
  2. Geocoding API - For address resolution
  3. Maps JavaScript API - For polyline encoding (optional)

Enable APIs via Google Cloud Console or CLI:

gcloud services enable directions-backend.googleapis.com
gcloud services enable geocoding-backend.googleapis.com
gcloud services enable maps-backend.googleapis.com

Available Tools

The MCP server provides these tools to Claude:

  1. calculate_route - Calculate optimal driving routes with traffic
  2. compare_routes - Compare multiple route alternatives
  3. get_live_traffic - Get current traffic conditions
  4. estimate_costs - Calculate trip costs (fuel + tolls)

Service Endpoints

  • MCP Endpoint: https://your-service.run.app/sse
  • Health Check: https://your-service.run.app/health
  • Usage Stats: https://your-service.run.app/stats

Local Development

# 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 test

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:

# Set up billing budget alerts in GCP Console
# Billing > Budgets & Alerts

Documentation Links

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. 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.