google-maps-comprehensive-mcp

google-maps-comprehensive-mcp

Comprehensive MCP server for Google Maps APIs, enabling geocoding, place search and details, distance matrix, elevation, and directions through natural language.

Category
访问服务器

README

Google Maps MCP Server

MCP Server per le API moderne di Google Maps (Places API, Routes API, Geocoding API, Elevation API).
Supporta geocoding, ricerca luoghi, dettagli di posti, calcolo di distanze, elevazioni e percorsi.

Tools Disponibili

🗺️ 8 Tools Implementati

  1. maps_ping (Health Check)

    • Verifica se il server MCP è attivo
    • Input: nessuno
    • Output: "Google Maps MCP server is alive ✅"
  2. maps_geocode

    • Converte un indirizzo in coordinate geografiche
    • Input: address (string)
    • Output: location, formatted_address, place_id, address_components
  3. maps_reverse_geocode

    • Converte coordinate in un indirizzo leggibile
    • Input:
      • latitude (number)
      • longitude (number)
    • Output: formatted_address, place_id, address_components
  4. maps_search_places

    • Ricerca luoghi tramite query testuale usando Places API (New)
    • Input: query (string)
    • Output: array di luoghi con displayName, formattedAddress, location, types
  5. maps_place_details

    • Ottieni informazioni dettagliate su un luogo
    • Input: place_id (string)
    • Output: name, address, contact info, ratings, reviews, opening hours, photos
  6. maps_distance_matrix

    • Calcola distanze e tempi tra multiple origini e destinazioni
    • Input:
      • origins (string[])
      • destinations (string[])
      • mode (optional): "driving" | "walking" | "bicycling" | "transit"
    • Output: matrice di distances e durations
  7. maps_elevation

    • Recupera dati di elevazione per punti geografici
    • Input: locations (array di { latitude, longitude })
    • Output: elevation e resolution per ogni punto
  8. maps_directions

    • Ottieni indicazioni stradali tra due punti usando Routes API (New)
    • Input:
      • origin (string)
      • destination (string)
      • travelMode (optional): "DRIVE" | "WALK" | "BICYCLE" | "TRANSIT"
    • Output: route steps, distance, duration, polyline

🚀 Setup e Installazione

1. Ottenere una API Key

Crea una API key Google Maps abilitando:

  • Places API (New)
  • Routes API (New)
  • Geocoding API
  • Elevation API

Segui la guida ufficiale: Get an API Key

2. Installazione Dipendenze

npm install

3. Build del Progetto

npm run build

4. Variabile d'Ambiente

export GOOGLE_MAPS_API_KEY="your_api_key_here"

🔧 Uso

Esecuzione Locale

# Con variabile d'ambiente
GOOGLE_MAPS_API_KEY="your_key" node dist/index.js

# O con export
export GOOGLE_MAPS_API_KEY="your_key"
node dist/index.js

Docker

# Build dell'immagine
docker build -t google-maps-mcp .

# Esecuzione con docker-compose
GOOGLE_MAPS_API_KEY="your_key" docker-compose up

# Esecuzione diretta
docker run --rm -it -e GOOGLE_MAPS_API_KEY="your_key" google-maps-mcp

🎯 Configurazione MCP Client

Claude Desktop

{
  "mcpServers": {
    "google-maps": {
      "command": "node",
      "args": ["dist/index.js"],
      "cwd": "/path/to/google-maps-mcp",
      "env": {
        "GOOGLE_MAPS_API_KEY": "your_api_key"
      }
    }
  }
}

LM Studio

{
  "mcpServers": {
    "google-maps": {
      "command": "node",
      "args": ["dist/index.js"],
      "cwd": "/Users/pallotta/mcp-servers/google-maps",
      "env": {
        "GOOGLE_MAPS_API_KEY": "your_api_key"
      }
    }
  }
}

Docker (Claude Desktop)

{
  "mcpServers": {
    "google-maps": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e", "GOOGLE_MAPS_API_KEY=your_api_key",
        "google-maps-mcp"
      ]
    }
  }
}

🧪 Test

Il server è stato testato con successo e tutti i tool funzionano correttamente:

  • maps_ping - Health check
  • maps_geocode - Address → Coordinates
  • maps_reverse_geocode - Coordinates → Address
  • maps_search_places - Place search
  • maps_place_details - Detailed place info
  • maps_distance_matrix - Distance/time matrix
  • maps_elevation - Elevation data
  • maps_directions - Route directions

📋 API Utilizzate

  • Google Places API (New) - Per ricerca luoghi e dettagli
  • Google Routes API (New) - Per indicazioni stradali
  • Google Geocoding API - Per conversione indirizzi ↔ coordinate
  • Google Elevation API - Per dati di elevazione

🔒 Sicurezza

⚠️ Importante: Non committare mai la tua API key nel repository. Usa sempre variabili d'ambiente.


📝 Note

  • Il server utilizza stdio transport per la comunicazione MCP
  • Supporta CommonJS per compatibilità
  • Tutti i tool restituiscono dati in formato JSON
  • Gestione errori completa per tutte le API calls

🆘 Troubleshooting

Errore: "GOOGLE_MAPS_API_KEY environment variable is required"

  • Assicurati di aver impostato la variabile d'ambiente
  • Verifica che l'API key sia valida e abilitata

Errore: "Tool not found"

  • Verifica che il server sia stato buildato correttamente: npm run build
  • Controlla che tutti i tool siano implementati nel codice

Problemi Docker

  • Se il container non ha i tool aggiornati, esegui: docker build --no-cache -t google-maps-mcp .
  • Verifica che la variabile d'ambiente sia passata correttamente al container

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选