home / mcp / mcp google map server

MCP Google Map Server

Provides Google Maps API integration via MCP with streamable HTTP transport and geospatial tooling.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "cablate-mcp-google-map": {
      "url": "http://localhost:3000/mcp",
      "headers": {
        "MCP_SERVER_PORT": "3000",
        "GOOGLE_MAPS_API_KEY": "your_api_key_here or YOUR_API_KEY as needed"
      }
    }
  }
}

You are using a dedicated MCP server that integrates Google Maps API functionality via a streamable HTTP transport. It provides tools for location search, geocoding, distance and directions, and elevation data, all accessible through the MCP protocol for seamless use with large language models and client applications.

How to use

To use this MCP server, run it locally or on your preferred host and connect your MCP client over HTTP. The server exposes Google Maps tools, enabling you to search for places, geocode addresses, compute distances, obtain directions, and retrieve elevation data. Your MCP client can then query these tools and receive structured responses designed for integration with language models and other services.

How to install

Prerequisites: you need Node.js installed on your system. You will also need a Google Maps API key with the appropriate services enabled for your use case (Places API, Geocoding API, Directions API, Elevation API, etc.). If you plan to use the Places features, enable Places API in your Google Cloud Console before starting.

# Install the server globally (recommended)
npm install -g @cablate/mcp-google-map

# Run the server (HTTP transport)
mcp-google-map --port 3000 --apikey "your_api_key_here"

# Using short options
mcp-google-map -p 3000 -k "your_api_key_here"

Notes on configuration and usage

The server uses HTTP transport (not stdio). Direct usage with npx inside MCP Server Settings is not supported for this server.

Common localhost setup example shows the MCP endpoint as http://localhost:3000/mcp. Use this URL in your MCP client configuration to connect.

Extra setup via npx (optional quick start)

If you prefer to start quickly using npx, you can run the server in a separate terminal and then configure your MCP client to connect over HTTP.

# Run in a separate terminal
npx @cablate/mcp-google-map --port 3000 --apikey "YOUR_API_KEY"

# Or set the API key via environment variables
GOOGLE_MAPS_API_KEY=YOUR_API_KEY npx @cablate/mcp-google-map --port 3000 --apikey "YOUR_API_KEY"

Security and best practices

Keep your API key secure and avoid exposing it in client configurations or logs. Prefer server-side handling of keys and use HTTP headers to pass keys when your MCP client supports it.

If you are deploying in production, consider enabling DNS rebinding protection and applying standard input validation and error handling on the MCP client side.

API key configuration options

You can provide the Google Maps API key in multiple ways. The recommended order of precedence is through HTTP headers, followed by command line, then environment variables.

// MCP Client config (HTTP headers)
{
  "mcp-google-map": {
    "transport": "streamableHttp",
    "url": "http://localhost:3000/mcp",
    "headers": {
      "X-Google-Maps-API-Key": "YOUR_API_KEY"
    }
  }
}

Supported tools and capabilities

The server offers a suite of Google Maps tools: search_nearby, get_place_details, maps_geocode, maps_reverse_geocode, maps_distance_matrix, maps_directions, and maps_elevation. Each tool provides access to corresponding maps services for location search, place details, geocoding, distance calculations, directions, and elevation data.

Available tools

search_nearby

Search for nearby places based on location with optional filters such as keywords, distance, and ratings.

get_place_details

Fetch detailed information about a specific place including contact info, reviews, and hours.

maps_geocode

Convert addresses or place names into geographic coordinates (latitude and longitude).

maps_reverse_geocode

Convert geographic coordinates into a human-readable address.

maps_distance_matrix

Calculate travel distances and durations between multiple origins and destinations.

maps_directions

Provide detailed turn-by-turn directions between two locations for various travel modes.

maps_elevation

Retrieve elevation data for specified geographic locations.