Skip to main content
Glama
devsanthoshmk

Google Maps MCP Server

🗺️ Google Maps MCP 服务器 (gmaps-mcp)

MCP 版本 Python 许可证: MIT

一个自包含、轻量级的 Google Maps 模型上下文协议 (MCP) 服务器,基于官方 MCP Python SDK 构建。它为 AI 代理(如 Claude Desktop、Cursor、Cline 和 Antigravity)提供结构化的搜索结果、地点详情、评分、联系信息、坐标和 Google Maps 链接。


⚡ 主要特性

  • 一键安装:通过 uvx 在任何地方即时运行,无需手动配置环境。

  • 100% 自包含:爬虫引擎通过 asyncioaiohttp 原生集成在进程中——无需外部子进程、无头浏览器或 API 密钥。

  • 丰富的结构化地点数据:返回地点 ID、商家名称、类别、地址、本地和国际电话号码、网站 URL、坐标(lat/long)、星级评分、评论数量以及直接的 Google Maps 链接。

  • Stdio 和可流式 HTTP:为桌面 AI 客户端提供原生 stdio 支持,为远程/容器化部署提供 streamable-http 支持。

  • 干净的 JSON-RPC:所有内部日志严格输出到 stderr,确保 stdio 协议流 100% 合规。


Related MCP server: Google Maps MCP Server

🚀 快速开始

直接使用 uvx 运行:

# Run directly from GitHub repository
uvx --from git+https://github.com/<your-username>/gmaps-mcp.git gmaps-mcp

或者从本地克隆运行:

uv run gmaps-mcp

🛠️ MCP 客户端配置

1. Claude Desktop

将此内容添加到您的 claude_desktop_config.json 文件中(macOS 上位于 ~/Library/Application Support/Claude/claude_desktop_config.json,Windows 上位于 %APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "google-maps": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/<your-username>/gmaps-mcp.git",
        "gmaps-mcp"
      ]
    }
  }
}

如果从本地文件夹运行:

{
  "mcpServers": {
    "google-maps": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/absolute/path/to/gmap-mcp",
        "gmaps-mcp"
      ]
    }
  }
}

2. Cursor IDE

在 Cursor 中,打开 设置 → 功能 → MCP(或编辑项目中的 .cursor/mcp.json):

{
  "mcpServers": {
    "google-maps": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/<your-username>/gmaps-mcp.git",
        "gmaps-mcp"
      ]
    }
  }
}

3. Cline(VS Code 扩展)

在 Cline 设置(cline_mcp_settings.json)中:

{
  "mcpServers": {
    "google-maps": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/<your-username>/gmaps-mcp.git",
        "gmaps-mcp"
      ]
    }
  }
}

🧰 可用工具

1. search_google_maps

在 Google Maps 上搜索商家、景点、服务和地标。

参数

类型

默认值

描述

query

string

(必填)

搜索词(例如 "coffee in Koramangala Bangalore""dentists near Connaught Place Delhi""Italian restaurants in New York")。

limit

integer

10

返回的最大结果数(150)。

country

string

"in"

用于区域本地化的两位 ISO 国家代码(例如 "in""us""gb""de""fr""ae")。

language

string

"en"

结果的语言代码(例如 "en""hi""es""fr")。

输出结构

{
  "query": "coffee in Koramangala Bangalore",
  "country": "in",
  "language": "en",
  "total_results": 2,
  "places": [
    {
      "place_id": "ChIJ80IECk8UrjsRqCffDjE09lw",
      "name": "Dyu Art Cafe",
      "category": "Art cafe",
      "address": "KHB MIG Colony, 1st Cross Rd, Koramangala 8th Block, Bengaluru, Karnataka 560095",
      "phone": "096113 19774",
      "international_phone": "+91 96113 19774",
      "website": "http://www.dyuartcafe.com/",
      "domain": "dyuartcafe.com",
      "latitude": 12.9373076,
      "longitude": 77.6176544,
      "rating": 4.4,
      "review_count": 21440,
      "google_maps_url": "https://www.google.com/maps/place/?q=place_id:ChIJ80IECk8UrjsRqCffDjE09lw"
    }
  ]
}

2. get_place_details

通过地点 ID 或名称检索单个特定地点或商家的详细信息。

参数

类型

默认值

描述

place

string

(必填)

Google 地点 ID(例如 "ChIJ12k5kG_iDDkRwuzibQwYZ4M")或确切的商家/地标名称(例如 "AIIMS New Delhi")。

country

string

"in"

两位 ISO 国家代码(默认:"in")。

language

string

"en"

响应的语言代码(默认:"en")。


🌐 远程部署(可流式 HTTP)

服务器支持现代 可流式 HTTP 传输,用于部署在反向代理或云托管之后:

# Start Streamable HTTP server on port 8000
uv run gmaps-mcp --transport streamable-http --host 0.0.0.0 --port 8000

MCP 端点将在以下地址可用: http://<host>:8000/mcp


🧪 开发与测试

使用 uv 运行单元测试和集成测试:

# Run pytest test suite
uv run --with pytest --with pytest-asyncio pytest tests/ -v

# Run the server locally with debug logs
uv run gmaps-mcp --log-level DEBUG

📦 项目结构

gmap-mcp/
├── pyproject.toml              # Packaging & dependencies (PEP 517/621)
├── README.md                   # Setup guide and MCP client docs
├── src/
│   └── gmaps_mcp/
│       ├── __init__.py         # Package entry
│       ├── schemas.py          # Pydantic data models (Place, Search, Details)
│       ├── server.py           # MCPServer instance & CLI runner
│       ├── tools.py            # MCP Tool definitions & detailed descriptions
│       └── scraper/
│           ├── __init__.py     # Scraper API
│           └── crawler.py      # Async Google Maps parser & extraction engine
└── tests/
    ├── test_schemas.py         # Schema tests
    ├── test_crawler.py         # Parser unit tests
    └── test_server.py          # MCP Server registration & tool calling tests

📜 归属与许可证

  • 爬虫核心改编并模块化自 christivn/mapScraper(提交 1b38cf3e153294e3dad2f6cb5862be0201a54065)。

  • 基于 MIT 许可证 授权。

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Live Google Maps business search, review, and photo data for AI agents over MCP.

  • Local business intel for AI agents: audits, lead scoring, tech stack, prospecting.

  • The best web search for your AI Agent

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/devsanthoshmk/gmaps-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server