Back to MCP directory
publicPublicdnsLocal runtime

mcp-hello-world

Google Maps API的MCP服务,提供地理编码、地点搜索、路线规划等地图相关功能

article

README

🚀 Google Maps MCP Server

本项目是一个用于 Google Maps API 的 MCP 服务器,可实现地址与坐标转换、地点搜索、距离计算等多种与地图相关的功能。

🚀 快速开始

API 密钥

按照此处的说明获取 Google Maps API 密钥。

在 Claude Desktop 中使用

将以下内容添加到 claude_desktop_config.json 文件中:

Docker

{
  "mcpServers": {
    "google-maps": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GOOGLE_MAPS_API_KEY",
        "mcp/google-maps"
      ],
      "env": {
        "GOOGLE_MAPS_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}

NPX

{
  "mcpServers": {
    "google-maps": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-google-maps"
      ],
      "env": {
        "GOOGLE_MAPS_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}

✨ 主要特性

工具列表

  1. maps_geocode

    • 功能:将地址转换为坐标。
    • 输入:address(字符串类型)
    • 返回:位置、格式化后的地址、地点 ID
  2. maps_reverse_geocode

    • 功能:将坐标转换为地址。
    • 输入:
      • latitude(数字类型)
      • longitude(数字类型)
    • 返回:格式化后的地址、地点 ID、地址组件
  3. maps_search_places

    • 功能:使用文本查询搜索地点。
    • 输入:
      • query(字符串类型)
      • location(可选):{ latitude: 数字类型, longitude: 数字类型 }
      • radius(可选):数字类型(单位为米,最大值为 50000)
    • 返回:包含地点名称、地址、位置的数组
  4. maps_place_details

    • 功能:获取地点的详细信息。
    • 输入:place_id(字符串类型)
    • 返回:名称、地址、联系信息、评分、评论、营业时间
  5. maps_distance_matrix

    • 功能:计算点与点之间的距离和时间。
    • 输入:
      • origins(字符串数组)
      • destinations(字符串数组)
      • mode(可选):"driving" | "walking" | "bicycling" | "transit"
    • 返回:距离和时长矩阵
  6. maps_elevation

    • 功能:获取地点的海拔数据。
    • 输入:locations(包含 {latitude, longitude} 的数组)
    • 返回:每个点的海拔数据
  7. maps_directions

    • 功能:获取两点之间的路线。
    • 输入:
      • origin(字符串类型)
      • destination(字符串类型)
      • mode(可选):"driving" | "walking" | "bicycling" | "transit"
    • 返回:包含步骤、距离、时长的路线详细信息

📦 安装指南

Docker 构建

docker build -t mcp/google-maps -f src/google-maps/Dockerfile .

📄 许可证

本 MCP 服务器采用 MIT 许可证。这意味着您可以自由使用、修改和分发该软件,但需遵守 MIT 许可证的条款和条件。更多详细信息,请参阅项目仓库中的 LICENSE 文件。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client