home / mcp / google maps mcp server
MCP Server for interacting with Google Maps (Places API and Routes API). Written in TypeScript, Node and Hono.dev
Configuration
View docs{
"mcpServers": {
"iceener-maps-streamable-mcp-server": {
"url": "http://127.0.0.1:3000/mcp",
"headers": {
"PORT": "3000",
"API_KEY": "your-google-maps-api-key",
"BEARER_TOKEN": "your-random-auth-token"
}
}
}
}You can run a streamable HTTP MCP server that integrates Google Maps capabilities into your AI agents. It lets your app search nearby places, fetch place details, plan routes, and compare distances using the current location context, all through a standardized MCP interface suitable for location-aware assistants and agents.
You will connect your MCP client to one or more MCP endpoints to perform common location tasks. Use the HTTP endpoint for remote or local testing and the local stdio endpoint when you run the server directly in your environment. Typical workflows include searching for places near the current position, retrieving place details, planning walking or driving routes, and comparing distances to multiple destinations. Your client must supply your current latitude and longitude, and the server will return results tuned to a 1 km default radius with sensible defaults for quick responses.
With a client that supports MCP servers, you can: search for nearby cafes or landmarks by text or category; fetch hours, ratings, and contact details for a given place; compute routes with turn-by-turn guidance; and measure distances to several destinations to choose the best option. For secure operation, ensure your client sends an Authorization header when using a protected endpoint and that you provide your Google Maps API key for the server to query Google Maps services.
Prerequisites: you need Bun installed and a Google Cloud project with API access configured.
Step 1: Get Google Maps API key and set up credentials.
Step 2: Set up the local development environment.
Step 3: Run the local server and verify the endpoint is available.
Two primary ways to run the gateway are provided: a local Node/Hono server using Bun for development, and a Cloudflare Worker for remote access. The local server exposes the MCP endpoint at http://127.0.0.1:3000/mcp, and the Cloudflare deployment exposes an endpoint at https://<worker-name>.<account>.workers.dev/mcp.
Local development steps include installing dependencies, copying the example environment, updating configuration values, and starting the dev server.
Two essential environment variables secure access and API usage. BEARER_TOKEN authorizes clients to the MCP, and API_KEY provides access to Google Maps services. Keep these secrets confidential and do not expose them in public code.
If you receive a 401 Unauthorized, verify that BEARER_TOKEN is set correctly and that your client sends Authorization: Bearer <token>. If the API key is missing or invalid, ensure API_KEY is configured in your environment. If Google Maps API errors occur, confirm that the necessary Maps APIs (Places, Routes) are enabled in your Google Cloud project.
This setup supports both local development and remote deployment. Use the local Bun-based server for rapid iteration and the Cloudflare Worker for production-like remote access. The server is designed to work with location context, making it suitable for AI agents that need to search places, get details, and plan routes from the current position.
Find places by text query or type near a location, with radius, filters, and sorting options.
Get detailed information about a specific place, including hours, ratings, reviews, and photos.
Calculate routes or distance matrices between an origin and one or more destinations, with mode and options.