Skip to main content
Glama
Ocean-Ch

google-maps-transit

by Ocean-Ch

maps-mcp

A Model Context Protocol server for Google Maps — routing, place discovery, and commute comparison over stdio.

Tools

get_transit_commute

Route between two addresses (or neighborhoods). Supports transit (default), driving, walking, bicycling, two_wheeler. Multi-leg trips via intermediates (A→B→C). Returns up to 3 alternative routes, each with:

  • mode, duration_minutes, distance_km, summary, steps_count

  • transit: segments (line + vehicle type), transfers, walking_minutes, first_departure, last_arrival

  • driving / two_wheeler: duration_in_traffic_minutes (traffic-aware), toll_roads

search_places

Find restaurants, hotels, attractions, parks, gas stations, etc. using free-text queries. Optionally bias by location (near), filter by place type (type), and filter to currently-open places (open_now). Returns up to 20 results with name, address, rating, price level, open/closed status, and a id for follow-up.

get_place_details

Full details for a place from search_places: phone, website, per-day opening hours, editorial summary, and up to 5 user reviews. Takes a place_id.

compare_commutes

Rank 2–5 candidate origins against a shared destination by travel time. Fans out in parallel and returns results sorted fastest → slowest. Per-origin failures surface inline rather than aborting the whole comparison.

Related MCP server: MCP Google Map Server

Google Cloud setup

In Google Cloud Console, pick or create a project and enable these APIs (APIs & Services → Library):

  • Routes API — for get_transit_commute and compare_commutes

  • Places API (New) — for search_places and get_place_details

Then Credentials → Create credentials → API key. Restrict the key to those two APIs. Put the value in .env:

echo 'GOOGLE_MAPS_API_KEY=your-key-here' > .env

Setup & running

npm install
npm run build
npm start          # or: npx tsx src/index.ts  (dev, no build needed)

Make target

What it does

make install

npm ci

make build

Compile TypeScript → dist/

make dev / make start

Run server (dev / compiled)

make test

Unit + in-memory e2e tests

make test-live

Live API test (needs key)

make smoke

One real API request

make docker-build / make docker-run

Build/run Docker image

Connecting a client (e.g. Cursor / Claude Desktop)

{
  "mcpServers": {
    "maps-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/maps-mcp/dist/index.js"],
      "env": { "GOOGLE_MAPS_API_KEY": "your-key-here" }
    }
  }
}

For dev without building: "command": "npx", "args": ["tsx", "/absolute/path/to/maps-mcp/src/index.ts"].

Notes

  • MCP server name: google-maps-transit

  • driving and two_wheeler use TRAFFIC_AWARE routing (Routes API v2)

  • Up to MAX_ROUTES = 3 alternatives returned; Google may return fewer

  • Missing GOOGLE_MAPS_API_KEY surfaces as a clear tool error

Available Tools

4 tools
compare_commutescompare_commutesA
Read-only

Compares commute times from multiple candidate origins to a single shared destination using real-time Google Maps data.

        Perfect for questions like:
        • "Which of these 3 apartments has the best commute to my office?"
        • "I'm considering moving to Brooklyn, Queens, or Jersey City — which is fastest to Midtown?"
        • "Compare driving vs. transit isn't needed — just rank these addresses by commute time."

        Accepts 2–5 origin addresses. Returns them ranked fastest → slowest, each with the best
        available route (duration, distance, transit lines, traffic-aware driving time, etc.).
        Failed lookups for individual origins are surfaced as errors in-line rather than aborting the whole comparison.
ParametersJSON Schema
NameRequiredDescriptionDefault
modeNoTransport mode for all comparisons. Default: transit.
originsYesList of 2–5 candidate origin addresses to compare, e.g. ['123 Main St, Brooklyn, NY', '456 Elm Ave, Queens, NY'].
avoid_tollsNoWhen true, instructs Google Maps to avoid toll roads where possible. Applies to driving and two_wheeler modes.
destinationYesThe shared destination address all origins will be compared against.
departure_timeNoISO 8601 departure datetime shared across all comparisons. Defaults to 1 minute from now.

Output Schema

ParametersJSON Schema
NameRequiredDescription
modeYes
resultsYesOrigins ranked by fastest commute time (failed lookups appear last with rank: null)
destinationYesThe shared destination address

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and openWorldHint=true, so the agent knows this is a safe read operation that may interact with external systems. The description adds useful behavioral context: it accepts 2–5 origins, returns them ranked fastest to slowest with best available route details (duration, distance, transit lines, traffic-aware driving time), and handles individual lookup failures gracefully by surfacing errors in-line rather than aborting the whole comparison. This goes beyond the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the main purpose, followed by example questions and behavioral notes. While the example section is useful, it could be slightly more concise. However, it remains focused and avoids unnecessary repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is complete for an agent to call the tool correctly: it explains the input range (2–5 origins), output format (ranked list with route details), error handling, and use cases. An output schema exists, so return values need not be detailed, but the description still provides enough behavioral context to be self-sufficient. Minor gap: no explicit mention of rate limits or authentication needs, which are unlikely for a read-only comparison tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all parameters (mode, origins, avoid_tolls, destination, departure_time) are already documented in the schema. The description adds no additional parameter syntax or format details beyond what the schema provides, such as address formatting or departure time format. When schema coverage is high, a 3 is the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb (compares) and resource (commute times), and precisely scopes the operation: multiple candidate origins to a single shared destination using real-time Google Maps data. It distinguishes itself from the sibling get_transit_commute by handling multiple origins and ranking them, rather than a point-to-point lookup.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context through example questions, showing exactly when to use it (ranking apartments by commute, comparing neighborhoods). It also clarifies what the tool does NOT do: 'Compare driving vs. transit isn't needed — just rank these addresses by commute time.' However, it doesn't explicitly name the sibling get_transit_commute or state when to use that alternative.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_place_detailsget_place_detailsA
Read-only

Returns detailed information about a specific place: phone number, website URL, full opening hours for each day of the week, a short editorial summary, and up to 5 user reviews.

        Always requires a place ID obtained from a prior search_places call.
        Use this as a follow-up when the user wants full details about one of the search results, e.g.
        • "What are the opening hours for that first restaurant?"
        • "Does it have a website I can check?"
        • "Show me the reviews for the top result."
ParametersJSON Schema
NameRequiredDescriptionDefault
place_idYesThe place ID returned by search_places (typically starts with 'ChIJ…')

Output Schema

ParametersJSON Schema
NameRequiredDescription
idYesUnique place ID
nameYesPlace display name
hoursYesWeekday opening-hours descriptions, e.g. ['Monday: 9:00 AM – 5:00 PM', 'Tuesday: 9:00 AM – 5:00 PM', …]
phoneYesNational phone number; null if unavailable
typesYesGoogle Place type tags
ratingYesAverage star rating (1.0–5.0); null if no ratings
addressYesFormatted address
reviewsYesUp to 5 most relevant user reviews
summaryYesShort editorial summary of the place; null if unavailable
websiteYesWebsite URL; null if unavailable
open_nowYesWhether the place is currently open; null if unknown
price_levelYesRelative price: FREE | INEXPENSIVE | MODERATE | EXPENSIVE | VERY_EXPENSIVE
user_rating_countYesTotal number of user reviews

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint and openWorldHint, so the safety profile is covered, but the description adds real value by scoping the returned data (notably the hard cap of 'up to 5 user reviews' and full weekly hours rather than a summary). It does not mention rate limits, quota costs, or whether fields like hours can be missing for some places, leaving a small gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the payload, then the hard prerequisite, then illustrative intents. Every sentence earns its place and the bulleted examples aid selection without bloat.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-required-param read tool with full schema coverage and an existing output schema, the description supplies everything needed: the prerequisite chain, the returned content, and when to reach for it. No missing decision-relevant information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the single parameter is already documented with its source and format ('ChIJ…') in the schema itself. The description's instruction to source the ID from a prior search_places call largely restates the schema, adding only mild emphasis; baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (returns) and resource (details about a specific place), then enumerates the concrete payload: phone, website, full weekly opening hours, editorial summary, and up to 5 reviews. This clearly separates it from search_places, which returns result lists rather than one place's detail.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states the prerequisite ('Always requires a place ID obtained from a prior search_places call') and frames the tool as a follow-up to search_places, with three concrete user-intent examples that select this tool over its siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_transit_commuteget_transit_commuteA

Returns commute routes between two addresses using real-time Google Maps data. Use this when the user asks about commute, travel time, or exact travel times between two addresses. Supports transit, driving, walking, bicycling, and two_wheeler modes. Supports multi-leg trips via the intermediates parameter (e.g. A→B→C). Returns up to 3 alternative routes, each with duration in minutes, transit lines used, number of transfers, and walking time.

ParametersJSON Schema
NameRequiredDescriptionDefault
modeNoThe mode of transportation to use. If not provided, the default mode will be transit.
originYesThe origin address or neighbourhood (e.g. '123 Main St, Anytown, USA')
avoid_tollsNoWhen true, instructs Google Maps to avoid toll roads where possible. Applies to driving and two_wheeler modes.
destinationYesThe destination address or neighbourhood (e.g. '456 Main St, Anytown, USA')
intermediatesNoOptional ordered list of intermediate stops between origin and destination, e.g. ['Stop B', 'Stop C']. Use this for multi-leg trips like A→B→C.
departure_timeNoISO 8601 datetime for departure (e.g. '2026-04-02T17:00:00-05:00'). If provided, uses Google Maps predicted/historical traffic for that future time. If omitted, uses the current time with live real-time traffic data. Omit for current conditions, provide for future trip planning.

Output Schema

ParametersJSON Schema
NameRequiredDescription
routesYes

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and does well: it discloses real-time vs predicted traffic behavior, the default mode, multi-leg support, and a concrete return shape (up to 3 alternatives with duration, lines, transfers, walking time). It omits auth/permission requirements and rate limits, which is a minor gap rather than a critical one.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then usage, then capabilities and return values — a logical order. It is slightly padded ('commute, travel time, or exact travel times' is near-redundant), but every line still contributes information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return-value detail is not strictly required, yet the description adds useful shape information anyway. Together with the fully documented schema, an agent has enough to invoke the tool correctly; only sibling disambiguation and auth expectations are unaddressed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents mode defaults, avoid_tolls scope, intermediates, and departure_time semantics — the description mostly restates these. The A→B→C example adds a little clarity but no new semantics beyond what the schema supplies, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('returns commute routes between two addresses') and names the underlying data source and supported modes. It is clear what the tool does, but it never distinguishes itself from the sibling compare_commutes, which an agent could plausibly reach for on the same query.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit trigger conditions ('user asks about commute, travel time, or exact travel times between two addresses'), which is solid when-to-use guidance. It offers no when-not-to-use and does not name compare_commutes as the alternative for multi-address comparison, leaving that routing decision to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_placessearch_placesA
Read-only

Searches for places — restaurants, cafés, hotels, attractions, shops, parks, and more — using real-time Google Maps data.

        Use this when the user asks things like:
        • "Find coffee shops near the Eiffel Tower"
        • "Best sushi restaurants in downtown Seattle"
        • "Dog-friendly parks in Austin, TX"
        • "Museums open right now in London"
        • "Gas stations along Highway 1"

        Returns up to 20 results with name, address, star rating, price level, open/closed status, and type tags.
        To get phone number, website, opening hours, and user reviews for a specific result, pass its id to get_place_details.
ParametersJSON Schema
NameRequiredDescriptionDefault
nearNoOptional location context appended to the query, e.g. 'Golden Gate Bridge, San Francisco' or 'Paris, France'. Use this to bias results toward a specific area.
typeNoOptional Google Place type filter. Common values: restaurant, cafe, bar, bakery, hotel, lodging, tourist_attraction, museum, art_gallery, park, zoo, amusement_park, shopping_mall, grocery_or_supermarket, gas_station, hospital, pharmacy, gym, movie_theater, night_club, library. See Google Place Types for the full list.
queryYesWhat to search for, e.g. 'coffee shop', 'Italian restaurant', 'museum', 'dog-friendly park'.
open_nowNoIf true, only return places that are currently open.
max_resultsNoMaximum number of results to return (1–20). Default: 10.

Output Schema

ParametersJSON Schema
NameRequiredDescription
placesYes
query_usedYesThe final text query sent to the Places API

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already declare readOnlyHint=true and openWorldHint=true, so safety is covered. The description adds useful behavioral context beyond that: real-time Google Maps data, a maximum of 20 returned results, the result fields provided, and the handoff condition to get_place_details. It does not cover rate limits or auth requirements, so it is strong but not exhaustive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core action, then immediately gives concrete trigger examples, then summarizes output and the routing alternative. Every section is useful and there is no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so the description does not need to explain return values in full, yet it still summarizes the result shape and the detail-retrieval follow-up. For a read-only discovery tool with complete parameter documentation, nothing essential is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description provides example query strings and notes the return count, but it does not materially extend the meaning of near, type, open_now, or max_results beyond what the schema already documents.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource ('Searches for places') and enumerates the kinds of places covered. It clearly distinguishes this discovery tool from the sibling get_place_details by explaining that details require passing a result id to that sibling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit example user queries that should trigger this tool, says when to use it, and points to get_place_details for deeper information about a specific result. The when-to-use and alternative routing are both explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv1.0.0
    • First observedcompare_commutes
    • First observedget_place_details
    • First observedget_transit_commute
    • First observedsearch_places

TDQS

A4.2/5.0

Scored across 4 tools

Disambiguation4/5

search_places and get_place_details are cleanly separated as search vs. detail lookup, and the commute tools have distinct scopes (point-to-point vs. multi-origin ranking). The only mild overlap is between get_transit_commute and compare_commutes, both of which compute routes, though the descriptions make the boundary fairly clear.

Naming Consistency5/5

All four tools follow a consistent snake_case verb_noun pattern: get_transit_commute, search_places, get_place_details, compare_commutes. The convention is predictable and self-explanatory.

Tool Count4/5

Four tools is slightly lean for a maps server covering both routing and place discovery, but each tool earns its place and there is no redundancy. It is well-scoped, just on the minimal side.

Completeness4/5

The surface covers commute/routing (including multi-leg and comparison ranking) and a full place search-plus-detail lifecycle. Minor gaps exist—no standalone distance matrix, geocoding, or turn-by-turn directions—but core agent workflows are supported.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers