Google Maps MCP Server
Requires a Google Cloud project with enabled Places API (New) and Routes API for authenticating and accessing Google Maps Platform services.
Provides location-aware AI capabilities including searching for nearby places, retrieving place details (hours, ratings, reviews, contact info), calculating routes with turn-by-turn navigation, and comparing distances to multiple destinations using the Google Maps Platform API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Google Maps MCP Serverfind nearby coffee shops open now"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Google Maps MCP Server
This server is a remote Model Context Protocol (MCP) server for Google Maps. It finds places, gives place details, and plans routes. It uses the Google Maps Platform Places API (New) and Routes API.
The server runs on Cloudflare Workers and on Bun. It is built on the MCP server template, version 2.1, and the official MCP TypeScript SDK 2.3.0. It uses protocol version 2026-07-28. It also accepts clients that use the 2025 protocol versions.
The server is for agents that know the location of the user, for example on a watch or a phone. The client gives the current position, and the model can:
Find places near the user, by type or by name.
Read the opening hours, ratings, reviews, contact data, and photos of a place.
Get walking, driving, cycling, or transit directions.
Compare the distance to several destinations.
Tools
Tool | Function |
| Finds places near a location. With |
| Gives the details of a place from a |
| With one destination, gives a route, and turn-by-turn steps if you ask for them. With two or more destinations (25 maximum), compares the time and distance to each, and names the closest. |
Each tool gives text for the model and structured data. The tool descriptions give all inputs and outputs. All tools only read data.
Examples of requests:
"Coffee near me":
search_placeswithtypes: ["cafe"]andopen_now: true."Is the pharmacy on Main Street open?":
search_places, thenget_placewithfields: ["hours"]."Which is closer, A or B?":
get_routewith both places as destinations.
Photo results contain public image URLs that Google makes for each request. They never contain the API key.
Related MCP server: Google Maps MCP Server
Connect a client
The server URL is the deployed Worker's MCP_PUBLIC_URL, for example https://google-maps.<subdomain>.workers.dev/mcp. Use the Streamable HTTP transport, and send the shared token in the Authorization header.
Client | Procedure |
Alice | Add an MCP server. Set the URL, the type |
Claude Code | Run |
MCP Inspector | Run |
The client must give the model the current location of the user and the current time. The tools use both.
Authentication
Production uses AUTH_MODE=bearer. All clients send the same secret token, BEARER_TOKEN, as Authorization: Bearer <token>. The server compares the token in constant time. A request without the correct token gets 401. The server publishes no OAuth documents, so clients do not try to sign in.
The Google API key (API_KEY) is a different secret. The server sends it to Google only, in the X-Goog-Api-Key header. The server never accepts a key from a client, and it never sends the client's token to Google.
For the authentication modes of the template, refer to the template's docs/auth.md.
Configuration
The server identity (name, version, and instructions) is in src/server.ts. The deployment settings are environment variables. On Workers, the production values are in wrangler.production.jsonc, which is gitignored; wrangler.production.example.jsonc shows its shape.
Variable | Production value | Function |
|
| The public URL of the endpoint. |
|
| The |
| The worker host, | The browser |
|
| Serves 2025-era clients without sessions. |
|
| The largest request body. |
|
| The authentication mode. |
|
|
|
| Secret | The shared token for clients. It must not contain whitespace. The server ignores whitespace at the start and at the end. |
| Secret | The Google Maps Platform API key. The server does not start without it. |
| Not set | For tests only. It sends Google requests to a loopback mock. |
.env.example describes all variables for Bun. If the configuration is not valid, Bun does not start, and a Worker answers 500 {"error":"server_misconfigured"} to all requests. The log gives each problem.
Set up Google Maps Platform
In the Google Cloud console, select or create a project.
Enable Places API (New) and Routes API.
Create an API key. Restrict it to these two APIs.
Store the key as the
API_KEYsecret.
For the requests that the server sends to Google, refer to docs/google-maps.md.
Deployment
bun run deploy deploys the google-maps Worker with wrangler deploy --config wrangler.production.jsonc. Before you deploy, read docs/deploy.md. It gives the secret names and the checks to do after a deployment.
Development
Install the dependencies:
bun installCopy
.env.exampleto.env. SetAPI_KEY.Start the server:
bun run dev
The server URL is http://127.0.0.1:3000/mcp. To use the Cloudflare local runtime, put API_KEY in .dev.vars and run bun run dev:worker. The URL is then http://127.0.0.1:8787/mcp.
Script | Function |
| Does the type check, the lint check, and the tests. It also checks the generated Worker types. |
| Starts the real server on Bun and on workerd, and calls each tool through a loopback Google mock. It requires Node.js 22.18 or later. |
| Deploys to Cloudflare with the |
| Makes the Worker types again. Run it after you change |
The tests do not send requests to Google. tests/contract.test.ts makes sure that the tool names and input schemas do not change. tests/routes.test.ts makes sure that each public route gives the same status as before the template migration.
Project structure
src/
server.ts Server identity, dependencies, McpServer factory
settings.ts API_KEY and the test-only Google origin
tools/ search_places, get_place, get_route. index.ts gives the order.
services/ google-maps.ts: the Places API and Routes API client
platform/ Template code. Do not change it.
bun.ts Entry point for Bun
worker.ts Entry point for Cloudflare Workers
tests/ Tool, service, contract, and route tests, and the template's platform tests
scripts/ Smoke tests and the loopback Google mockFor the template's design, refer to its docs/architecture.md and docs/tools.md.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Live Google Maps business search, review, and photo data for AI agents over MCP.
Mobility, geocoding and nearby urban services for AI agents.
- geoOAuthco.thinair
Geocoding, routing, isochrones, traffic, weather, and place search for AI agents. 19 MCP tools.
Ground your AI applications with trusted geospatial data from Google Maps.
Related MCP Servers
- AlicenseAqualityFmaintenanceEnables LLMs to perform travel-related tasks by interacting with Google Maps and travel planning services including location search, place details, and travel time calculations.524 npm98MIT
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Google Maps services through the Model Context Protocol. Provides location-based functionality and mapping capabilities for AI agents.2-
- AlicenseAqualityBmaintenanceEnables AI assistants to access Google Maps services including places search, details, directions, geocoding, and nearby search through natural language.620 PyPI2MIT
- AlicenseNot gradedqualityBmaintenanceProvides geocoding, place search, directions, distance matrix, and elevation data from Google Maps. Enables natural language queries to locate places, get directions, and retrieve map-related information.29 npmMIT