# Google Maps — how to use (mcp.ai)

Integrate Google Maps to access location data, geocoding, directions, and mapping services in your application.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_google_maps?ms=1781541780000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `google_maps_distance_matrix_api`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/google_maps`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/google_maps/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/google_maps/distance/matrix/api` — Calculates travel distance and time for a matrix of origins and destinations. supports different modes of transportation and options like departure/arrival times. use when needing to determine travel 
  - body: { key?: string, mode?: string, avoid?: string, units?: string, region?: string, origins: string, language?: string, arrival_time?: integer, destinations: string, transit_mode?: string, traffic_model?: string, departure_time?: integer, transit_routing_preference?: string }
- `POST https://api.mcp.ai/api/google_maps/geocoding/api` — Deprecated: tool to convert addresses into geographic coordinates (latitude and longitude) and vice versa (reverse geocoding), or get an address for a place id. use for finding coordinates for an addr
  - body: { key: string, bounds?: string, latlng?: string, region?: string, address?: string, language?: string, place_id?: string, components?: string, result_type?: string, location_type?: string, extra_computations?: string[] }
- `POST https://api.mcp.ai/api/google_maps/get/direction` — Fetches detailed directions between an origin and a destination, supporting intermediate waypoints and various travel modes.
  - body: { mode?: string, avoid?: string, units?: string, origin: string, language?: string, waypoints?: string, destination: string }
- `POST https://api.mcp.ai/api/google_maps/get/route` — Calculates one or more routes between two specified locations using various travel modes and preferences; addresses must be resolvable by google maps.
  - body: { units?: string, fieldMask?: string, travelMode?: string, languageCode?: string, origin_address: string, routingPreference?: string, destination_address: string, computeAlternativeRoutes?: boolean, routeModifiers_avoidTolls?: boolean, routeModifiers_avoidFerries?: boolean, routeModifiers_avoidHighways?: boolean }
- `POST https://api.mcp.ai/api/google_maps/maps/embed/api` — Tool to generate an embeddable google map url and html iframe code. use when you need to display a map (place, view, directions, street view, search) on a webpage without javascript.
  - body: { mode: string, view_params?: object, place_params?: object, search_params?: object, directions_params?: object, streetview_params?: object }
- `POST https://api.mcp.ai/api/google_maps/nearby/search` — Searches for places (e.g., restaurants, parks) within a specified circular area, with options to filter by place types and customize the returned fields and number of results.
  - body: { radius: number, latitude: number, fieldMask?: string, longitude: number, excludedTypes?: string[], includedTypes?: string[], maxResultCount?: integer }
- `POST https://api.mcp.ai/api/google_maps/text/search` — Searches for places on google maps using a textual query (e.g., "restaurants in london", "eiffel tower").
  - body: { fieldMask?: string, textQuery: string, maxResultCount?: integer }

## More
- Page: https://mcp.ai/google_maps
- Agent spec (llms.txt): https://mcp.ai/google_maps/llms.txt
- Postman collection: https://mcp.ai/google_maps/postman.json
