/ Каталог / Песочница / Google Maps
● Официальный modelcontextprotocol 🔑 Нужен свой ключ

Google Maps

автор modelcontextprotocol · modelcontextprotocol/servers-archived

Geocoding, place search, directions, distance matrix — Google Maps power for itineraries, store-locator features, and regional analyses.

The reference Google Maps MCP (now in modelcontextprotocol/servers-archived). Wraps key Maps APIs: geocoding, place search and details, directions, distance matrix, elevation. Useful for any agent task that needs real-world geography. Note: archived means no active maintenance — plan for community forks long-term.

Зачем использовать

Ключевые функции

Живое демо

Как выглядит на практике

google-maps.replay ▶ готово
0/0

Установка

Выберите клиент

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "google-maps": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-google-maps"
      ]
    }
  }
}

Откройте Claude Desktop → Settings → Developer → Edit Config. Перезапустите после сохранения.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "google-maps": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-google-maps"
      ]
    }
  }
}

Cursor использует ту же схему mcpServers, что и Claude Desktop. Конфиг проекта приоритетнее глобального.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "google-maps": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-google-maps"
      ]
    }
  }
}

Щёлкните значок MCP Servers на боковой панели Cline, затем "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "google-maps": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-google-maps"
      ]
    }
  }
}

Тот же формат, что и Claude Desktop. Перезапустите Windsurf для применения.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "google-maps",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-google-maps"
      ]
    }
  ]
}

Continue использует массив объектов серверов, а не map.

~/.config/zed/settings.json
{
  "context_servers": {
    "google-maps": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "@modelcontextprotocol/server-google-maps"
        ]
      }
    }
  }
}

Добавьте в context_servers. Zed перезагружается автоматически.

claude mcp add google-maps -- npx -y @modelcontextprotocol/server-google-maps

Однострочная команда. Проверить: claude mcp list. Удалить: claude mcp remove.

Сценарии использования

Реальные сценарии: Google Maps

Plan a day-trip itinerary with realistic travel times

👤 Travelers, anyone planning a multi-stop day ⏱ ~10 min beginner

Когда использовать: You have 5 places you want to hit in one day and need a realistic order, with travel times.

Предварительные требования
  • Google Maps API key with relevant APIs enabled — console.cloud.google.com → enable Geocoding, Places, Directions APIs, then create key
Поток
  1. Geocode all stops
    Geocode these 5 places into lat/lng: <list>. Verify each address looks right.✓ Скопировано
    → 5 coordinates with confidence
  2. Compute distance matrix
    Get drive times between every pair of stops at 10am on a weekday. Show as a matrix.✓ Скопировано
    → 5×5 time matrix
  3. Order and add directions
    Suggest the order that minimizes total drive time. Then give me turn-by-turn directions stop-to-stop.✓ Скопировано
    → Optimized route with directions

Итог: An itinerary you can actually execute, not 'sounds nice' planning.

Подводные камни
  • Distance matrix doesn't account for parking time / walk to door — Pad each leg by 10-15 min for parking; longer for downtown destinations
  • Real-time traffic only available for certain modes/regions — Use departure_time to get traffic-aware estimates; 'now' may be excluded depending on plan
Сочетать с: brave-search

Build store-locator data for a regional product

👤 Devs implementing a 'find a location' feature ⏱ ~30 min intermediate

Когда использовать: You're building a 'nearest store' feature and need to seed it with real coordinates and details.

Поток
  1. Geocode each store address
    I have a CSV of 50 store addresses at /data/stores.csv. Geocode each, return a new CSV with added lat, lng, place_id, and Google's normalized address.✓ Скопировано
    → Enriched CSV; flag any addresses that didn't geocode cleanly
  2. Pull rich details for each
    For each place_id, fetch hours, phone, website. Add to the CSV.✓ Скопировано
    → Per-store details, with missing-data flags where applicable
  3. Validate sample
    Pick 5 random rows and verify the geocoded coords visually look right (e.g. 'Stockholm address geocoded to Sweden, not Wisconsin').✓ Скопировано
    → Sanity check pass; outliers flagged

Итог: A clean store dataset ready to power a UI.

Подводные камни
  • Geocoding API has per-call cost — 50 addresses is a few cents but 50k is real money — Cache results aggressively; only re-geocode when address strings change
Сочетать с: filesystem

Find which of your customers live within X minutes of a candidate location

👤 Ops, real-estate, growth analysts ⏱ ~25 min advanced

Когда использовать: You're evaluating a new store/office location and want to know how many existing customers it would serve.

Поток
  1. Geocode the candidate
    Geocode the candidate address: '1234 Market St, San Francisco'.✓ Скопировано
    → Coordinate confirmed
  2. Distance matrix to customer ZIPs
    From the candidate, compute drive time to each of these 100 customer ZIP centroids: <list>. Use 9am weekday.✓ Скопировано
    → Per-ZIP drive time
  3. Aggregate
    How many customers are within 15 min, 30 min, 60 min? Plot a histogram (ascii bars OK).✓ Скопировано
    → Bucketed counts that inform the decision

Итог: A data-grounded answer to 'should we open here?'

Подводные камни
  • ZIP centroid is a poor proxy for actual customer addresses — If you have actual addresses, use them; centroids skew suburban analyses
  • Distance matrix limits batch size — Google caps origins×destinations per call; chunk into multiple requests, but you'll pay per element either way
Сочетать с: postgres · filesystem

Комбинации

Сочетайте с другими MCP — эффект x10

google-maps + filesystem

Bulk-geocode a CSV and write the enriched file back

Read /data/customers.csv, geocode each address, write /data/customers_geo.csv with added lat/lng/place_id columns.✓ Скопировано
google-maps + postgres

Geocode customer rows during onboarding

For every row in customers where lat IS NULL, geocode the address and update the row. Stop after 500 to manage cost.✓ Скопировано
google-maps + brave-search

Brave finds candidate places → Google Maps gets the geocode + directions

Brave-search 'best ramen Mission SF'. For the top 3, get place_ids and walking directions from 16th St BART.✓ Скопировано

Инструменты

Что предоставляет этот MCP

ИнструментВходные данныеКогда вызыватьСтоимость
maps_geocode address: str Address → coordinates $5 / 1000 calls
maps_reverse_geocode lat: number, lng: number Coordinates → address $5 / 1000 calls
maps_search_places query: str, location?, radius? Find places by name/category near a point $17-32 / 1000 (text search) or less for nearby
maps_place_details place_id: str Hydrate one place with full details $17 / 1000 base + add-ons per field
maps_distance_matrix origins[], destinations[], mode?, departure_time? Bulk distance/time between many points $5 / 1000 elements (origin×destination)
maps_directions origin, destination, mode?, waypoints? Turn-by-turn for one route $5 / 1000 calls
maps_elevation locations: [{lat, lng}] Elevation profile for a path or points $5 / 1000 calls

Стоимость и лимиты

Во что обходится

Квота API
Per-API. Default project caps but raisable.
Токенов на вызов
Small; cost is monetary not tokens
Деньги
Pay-per-call. Geocoding $5/1k. Place Details $17/1k. Distance Matrix $5/1k elements. $200/mo free credit historically — verify current Google policy.
Совет
Cache geocoded addresses indefinitely (they don't change). Distance matrix is the easy way to blow $50 in one prompt — always compute origins × destinations before calling.

Безопасность

Права, секреты, радиус поражения

Хранение учётных данных: API key in env var GOOGLE_MAPS_API_KEY. Restrict the key by API and (if possible) by IP/referrer in Google Cloud console.
Исходящий трафик: All calls to maps.googleapis.com
Никогда не давайте: unrestricted-everywhere keys — can be scraped from build artifacts and abused

Устранение неполадок

Частые ошибки и исправления

REQUEST_DENIED

API not enabled for your key, or billing not configured. Enable each API (Geocoding, Places, Directions) in Cloud console and set up billing.

OVER_QUERY_LIMIT

You hit the per-second or per-day cap. Add throttling; raise quota in Cloud console if needed.

ZERO_RESULTS on geocode

Address ambiguous or doesn't exist as written. Try adding country/state, or use Place Autocomplete instead.

Distance matrix INVALID_REQUEST

Check origins×destinations doesn't exceed the per-call element limit (varies by plan). Chunk the request.

Альтернативы

Google Maps в сравнении

АльтернативаКогда использоватьКомпромисс
OpenStreetMap (Nominatim) via fetchFree, no API key, willing to self-rate-limit and accept lower data qualitySparser POI data; usage policy for Nominatim restricts heavy use
Mapbox via custom MCPYou want a managed alternative with often better pricing for high volumeNo first-party MCP yet
HERE / TomTom APIs via custom MCPRouting/POI in regions where Google is weakNo first-party MCP

Ещё

Ресурсы

📖 Читать официальный README на GitHub

🐙 Открытые задачи

🔍 Все 400+ MCP-серверов и Skills