Google Maps Platform Code Assist MCP Server Documentation
Explore MCP server documentation for Google Maps Platform Code Assist with official guides and code samples to ground agents for accurate geo-related guidance.
Overview
The Google Maps Platform Code Assist MCP Server provides a lightweight, MCP-compliant HTTP service that surfaces Google Maps Platform capabilities as tools and resources for LLM-based agents. It acts as a grounding layer: agents query the MCP server to discover available geo-aware operations (geocoding, places, directions, etc.), then call those operations through well-typed, auditable endpoints. This reduces hallucination and ensures responses reference live Maps Platform data.
Designed for developers building agent-enabled assistants, the server packages Maps APIs into a standardized toolset and enforces request patterns, parameter validation, and quota-safe access. It is particularly useful when you need reliable, verifiable geographic reasoning inside code assistants, chatbots, or automated workflows that rely on accurate location data.
Features
- MCP-compliant HTTP server exposing Maps Platform functionality as tools/resources
- Predefined toolset: Geocoding, Reverse Geocoding, Place Search, Place Details, Directions, Distance Matrix, Elevation, Time Zone, Static Maps
- Parameter validation and typed request/response shapes for safer agent calls
- Configurable API key, CORS, and logging
- Example clients and code samples for quick integration
- Local dev mode for testing without production credentials
Installation / Configuration
Clone and install from the Code Assist package in the official repo:
Create a .env file (or export environment variables) with your Maps API key and preferred port:
PORT=3000
GOOGLE_MAPS_API_KEY=YOUR_GOOGLE_MAPS_API_KEY
ALLOWED_ORIGINS=http://localhost:5173
LOG_LEVEL=info
Start the server (development):
# or
By default the server exposes MCP-style endpoints. You can configure additional options in the package’s configuration file or via environment variables listed above.
Available Tools / Resources
The server maps common Google Maps Platform capabilities to named tools. Example tool names and parameter shapes:
| Tool name | Purpose | Typical parameters |
|---|---|---|
| geocode | Convert address to coordinates | address (string) |
| reverseGeocode | Convert coordinates to address | lat (number), lng (number) |
| placeSearch | Find places matching query | query (string), location, radius |
| placeDetails | Fetch details of a place | place_id (string), fields (array) |
| directions | Route planning between points | origin, destination, mode |
| distanceMatrix | Compute travel times/distances | origins, destinations, mode |
| elevation | Get elevation for coords | locations (array) |
| timeZone | Get time zone for coords | location, timestamp |
| staticMap | Generate static map URLs | center, zoom, markers, size |
The MCP server serves a discovery endpoint that returns metadata for each tool (name, description, input schema), enabling agents to introspect and call tools safely.
Example: Discover and Call a Tool
Fetch the tool list (example):
Call the geocode tool:
The server will return a typed JSON response containing coordinates and structured address components, using live Maps Platform results.
Use Cases
- Code assistants that generate or validate location-based code (e.g., autocomplete for map pins, addresses, or routing snippets) can call the MCP server to obtain authoritative data rather than relying on LLM memory.
- Customer support chatbots can verify user-entered addresses, suggest nearby branches, or provide directions with accurate travel-time estimates.
- Automated testing or CI pipelines can use the MCP server in staging to validate geo-related logic against current Maps responses.
- Content generation tools that include maps or location facts can embed static map URLs or place metadata that are guaranteed to match Maps Platform outputs.
Links and Resources
- GitHub: https://github.com/googlemaps/platform-ai/tree/main/packages/code-assist
- Configure Google Maps Platform credentials in the Cloud Console and enable the APIs your agents will use (Geocoding, Places, Directions, etc.).
If you need to extend the toolset, the server is designed to be modular: add new tool handlers that validate input, call the relevant Maps API, and return standardized responses for agents to consume.