Google Maps MCP Server

Google Maps MCP servers enable AI models to interact with Google Maps APIs, providing capabilities for location search, geocoding, directions, and elevation data.

GitHub starsnpm versionnpm downloads

Overview

The Google Maps MCP Server provides comprehensive integration with modern Google Maps APIs (Places API, Routes API, Geocoding API, Elevation API). It enables AI models to interact with Google Maps for location services, directions, place details, distance calculations, and elevation data.

Developed by:

Developed by Vic Peacock

Key Features

📍

Geocoding Services

Convert addresses to geographic coordinates and vice-versa

🔍

Place Search & Details

Search for places by text query and retrieve detailed information

🗺️

Distance & Directions

Calculate travel distances, durations, and get turn-by-turn directions

⛰️

Elevation Data

Retrieve elevation data for specific geographic locations

Available Tools

Quick Reference

ToolPurposeCategory
maps_pingHealth CheckUtility
maps_geocodeConvert address to geographic coordinatesGeocoding
maps_reverse_geocodeConvert coordinates to a human-readable addressGeocoding
maps_search_placesSearch places via text queryPlaces
maps_place_detailsGet detailed information about a placePlaces
maps_distance_matrixCalculate distances and times between locationsRouting
maps_elevationRetrieve elevation dataElevation
maps_directionsGet turn-by-turn directionsRouting

Detailed Usage

maps_ping

Verifies if the MCP server is active.

use_mcp_tool({
  server_name: "google-maps",
  tool_name: "maps_ping",
  arguments: {}
});

Returns "Google Maps MCP server is alive ✅" on success.

maps_geocode

Converts an address into geographic coordinates.

use_mcp_tool({
  server_name: "google-maps",
  tool_name: "maps_geocode",
  arguments: {
    address: "1600 Amphitheatre Parkway, Mountain View, CA"
  }
});

Returns location, formatted_address, place_id, address_components.

maps_reverse_geocode

Converts geographic coordinates into a human-readable address.

use_mcp_tool({
  server_name: "google-maps",
  tool_name: "maps_reverse_geocode",
  arguments: {
    latitude: 37.4221,
    longitude: -122.0841
  }
});

Returns formatted_address, place_id, address_components.

maps_search_places

Searches for places via text query using Places API (New).

use_mcp_tool({
  server_name: "google-maps",
  tool_name: "maps_search_places",
  arguments: {
    query: "restaurants in Mountain View"
  }
});

Returns an array of places with displayName, formattedAddress, location, types.

maps_place_details

Gets detailed information about a place.

use_mcp_tool({
  server_name: "google-maps",
  tool_name: "maps_place_details",
  arguments: {
    place_id: "ChIJN1t_tDeuEmsRUsoyG83frY4"
  }
});

Returns name, address, contact info, ratings, reviews, opening hours, photos.

maps_distance_matrix

Calculates distances and travel times between multiple origins and destinations.

use_mcp_tool({
  server_name: "google-maps",
  tool_name: "maps_distance_matrix",
  arguments: {
    origins: ["New York, NY"],
    destinations: ["Boston, MA"],
    mode: "driving"
  }
});

Returns a matrix of distances and durations.

maps_elevation

Retrieves elevation data for specific geographic locations.

use_mcp_tool({
  server_name: "google-maps",
  tool_name: "maps_elevation",
  arguments: {
    locations: [{ latitude: 37.4221, longitude: -122.0841 }]
  }
});

Returns elevation and resolution for each point.

maps_directions

Gets detailed turn-by-turn navigation directions between two locations.

use_mcp_tool({
  server_name: "google-maps",
  tool_name: "maps_directions",
  arguments: {
    origin: "New York, NY",
    destination: "Boston, MA",
    travelMode: "DRIVE"
  }
});

Returns route steps, distance, duration, polyline.

Installation

{
  "mcpServers": {
    "google-maps": {
      "command": "node",
      "args": ["dist/index.js"],
      "cwd": "/path/to/google-maps-mcp",
      "env": {
        "GOOGLE_MAPS_API_KEY": "your_api_key"
      }
    }
  }
}

API Key:

Replace your_api_key with your actual Google Maps API key. Ensure the necessary APIs (Places API (New), Routes API (New), Geocoding API, Elevation API) are enabled in your Google Cloud project.

Common Use Cases

1. Location-based Services

Integrate location search and details into AI applications:

// Search for nearby cafes
use_mcp_tool({
  server_name: "google-maps",
  tool_name: "maps_search_places",
  arguments: {
    query: "cafes near me"
  }
});

2. Navigation & Logistics

Provide AI models with routing and distance calculation capabilities:

// Get directions between two points
use_mcp_tool({
  server_name: "google-maps",
  tool_name: "maps_directions",
  arguments: {
    origin: "Eiffel Tower, Paris",
    destination: "Louvre Museum, Paris",
    travelMode: "WALK"
  }
});

3. Geographic Data Analysis

Utilize elevation data for environmental or topographical analysis:

// Get elevation of a specific point
use_mcp_tool({
  server_name: "google-maps",
  tool_name: "maps_elevation",
  arguments: {
    locations: [{ latitude: 48.8584, longitude: 2.2945 }] // Eiffel Tower
  }
});

Connection String Format

The Google Maps MCP server primarily uses environment variables for API key configuration. There isn't a direct "connection string" in the same way as Redis or PostgreSQL. The API key is passed via the GOOGLE_MAPS_API_KEY environment variable.

Sources