Token导航 LogoToken导航TokenDH.com
Maps Streamable MCP Server logo
地图位置未说明官方级别未说明来源级核验

Maps Streamable MCP Server

MCP Server

一个基于Google Maps的流式HTTP MCP服务器,提供地点搜索、详情获取和路线规划功能,适用于位置感知的AI代理。

工具数

0

提示词数

0

GitHub Stars

21

资源数

0
位置天气TypeScript搜索

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

iceener

提供方

iceener

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

谷歌地图MCP服务器

用于谷歌地图的流式HTTP MCP服务器——搜索地点、获取详细信息和规划路线。

存储库:

作者 过度

用例

此MCP服务器专为 位置感知AI代理 在Apple Watch或iPhone等移动设备上运行。您的客户提供当前位置,AI可以:

  • 查找附近的地方(餐馆、商店、加油站)
  • 通过逐向导航获取路线
  • 比较到多个目的地的距离
  • 抵达前检查开放时间和评级

它还可以与其他MCP工具很好地配合使用,例如,与 特斯拉MCP 直接在车内设置导航目的地。

通知

此repo以两种方式工作:

  • 作为一个 节点/HONO服务器 用于本地工作流
  • 作为一个 Cloudflare工作人员 用于远程交互

特性

  • 地点 --按文本或类型搜索附近的地方、餐馆、地标
  • 详情 --获取小时数、评分、评论、照片、联系信息
  • 路线 --计算步行、驾驶、交通方向
  • 距离矩阵 --比较到多个目的地的距离
  • 感知 --所有工具都适用于您当前的职位
  • 双运行时 --Node.js/Bun或Cloudflare Workers

设计原则

  • LLM友好:统一的工具,而不是1:1 API镜像
  • 准备观看:专为具有位置上下文的AI代理而设计
  • 智能默认值:1公里半径,10个结果,步行模式
  • 清晰的反馈:将ID放置在后续查询可见的位置

______________________________________________________________________

安装

先决条件: 包子, 谷歌云 项目。

0.客户端设置

您的客户需要知道当前时间和您当前的位置,因为这两个值都将用于搜索和规划。

1.获取谷歌地图API密钥

  1. 首选 谷歌云控制台
  2. 创建新项目(或选择现有项目)
  3. 导航至 API和服务>库
  4. 启用 地点API(新增)路线API
  5. 首选 API和服务>凭据
  6. 点击 创建凭据>API密钥
  7. (推荐)限制关键地点API和路线API

2.地方发展

cd google-maps-mcp
bun install
cp .env.example .env

编辑 .env:

PORT=3000
AUTH_ENABLED=true
AUTH_STRATEGY=bearer

# Generate with: openssl rand -hex 32
BEARER_TOKEN=your-random-auth-token

# Your Google Maps API key
API_KEY=your-google-maps-api-key

运行:

bun dev
# MCP: http://127.0.0.1:3000/mcp

3.Cloudflare Worker(部署)

  1. 创建KV命名空间:
wrangler kv:namespace create TOKENS
  1. 更新 wrangler.toml 使用您的KV命名空间ID
  1. 设置秘密:
# Auth token for clients (generate it using: openssl rand -hex 32). This makes the connection to your MCP not open to everyone, but only to those who have this API key.
wrangler secret put BEARER_TOKEN

# Your Google Maps API key
wrangler secret put API_KEY
  1. 部署:
wrangler deploy

端点: https://..workers.dev/mcp

______________________________________________________________________

客户端配置

克劳德桌面/光标(本地)

{
  "mcpServers": {
    "google-maps": {
      "command": "npx",
      "args": ["mcp-remote", "http://localhost:3000/mcp", "--transport", "http-only"],
      "env": { "NO_PROXY": "127.0.0.1,localhost" }
    }
  }
}

克劳德桌面/光标(Cloudflare Worker)

{
  "mcpServers": {
    "google-maps": {
      "command": "npx",
      "args": ["mcp-remote", "https://your-worker.workers.dev/mcp", "--transport", "http-only"]
    }
  }
}

爱丽丝应用程序

添加为MCP服务器:

  • 网址: https://your-worker.workers.dev/mcp
  • 类型: streamable-http
  • 头球 Authorization: Bearer

______________________________________________________________________

工具

search_places

通过文本查询或键入位置附近的位置来查找位置。

// Input
{
  query?: string;              // "sushi near Central Park"
  location: {                  // Required: your current position
    latitude: number;
    longitude: number;
  };
  types?: string[];            // ["restaurant", "cafe"]
  radius?: number;             // Meters (default: 1000, max: 50000)
  filters?: {
    open_now?: boolean;
    min_rating?: number;       // 0-5
    price_levels?: string[];   // PRICE_LEVEL_INEXPENSIVE, etc.
  };
  max_results?: number;        // Default: 10, max: 20
  sort_by?: "distance" | "rating" | "relevance";
}

// Output
- Restaurant Name (500m) ★4.5(234) $$ 🟢 Open
  123 Main St, New York
  ID: ChIJN1t_tDeuEmsRUsoyG83frY4
使用 query 用于文本搜索,或 types 用于基于类别的附近搜索。

get_place

获取特定地点的详细信息。

// Input
{
  place_id: string;            // From search_places results
  fields?: string[];           // ["basic", "contact", "hours", "reviews", "photos"]
}

// Output
Name: Central Park
Address: New York, NY, USA
Rating: 4.8 (50000 reviews)
Open Now: Yes
Hours: Monday: 6:00 AM – 1:00 AM, ...
Phone: +1 212-310-6600
Website: https://centralparknyc.org
Google Maps: https://maps.google.com/?cid=...

get_route

计算路线或距离矩阵。

// Single destination → detailed route
{
  origin: { latitude: 40.7128, longitude: -74.0060 };
  destinations: [{ latitude: 40.7580, longitude: -73.9855 }];
  mode?: "walk" | "drive" | "transit";  // Default: "walk"
  options?: {
    departure_time?: string;   // ISO 8601 or "now"
    include_steps?: boolean;   // Turn-by-turn instructions
    include_polyline?: boolean;
  };
}

// Multiple destinations → distance matrix
{
  origin: { latitude: 40.7128, longitude: -74.0060 };
  destinations: [
    { latitude: 40.7580, longitude: -73.9855 },
    { latitude: 40.7484, longitude: -73.9857 },
    "Empire State Building"    // Address or place ID also works
  ];
  mode?: "walk";
}

// Output (single)
Route Summary: via 5th Ave
Total Distance: 5.2 km
Total Duration: 62 minutes

Steps:
  1.1. Head north on Broadway
  1.2. Turn right onto E 42nd St
  ...

// Output (matrix)
Distances from origin to 3 destinations:
- To Times Square: 4.8 km, 58 min
- To Empire State: 3.2 km, 38 min
- To Central Park: 6.1 km, 73 min

______________________________________________________________________

例子

1.查找附近的咖啡店

{
  "name": "search_places",
  "arguments": {
    "types": ["cafe"],
    "location": { "latitude": 40.7128, "longitude": -74.0060 },
    "filters": { "open_now": true },
    "sort_by": "distance"
  }
}

2.按文本搜索

{
  "name": "search_places",
  "arguments": {
    "query": "best pizza in Manhattan",
    "location": { "latitude": 40.7128, "longitude": -74.0060 },
    "max_results": 5
  }
}

3.获取地点详细信息

{
  "name": "get_place",
  "arguments": {
    "place_id": "ChIJN1t_tDeuEmsRUsoyG83frY4",
    "fields": ["basic", "hours", "reviews"]
  }
}

4.步行方向

{
  "name": "get_route",
  "arguments": {
    "origin": { "latitude": 40.7128, "longitude": -74.0060 },
    "destinations": [{ "latitude": 40.7580, "longitude": -73.9855 }],
    "mode": "walk",
    "departure_time": "now",
    "include_steps": true
  }
}

5.比较多个地点的距离

{
  "name": "get_route",
  "arguments": {
    "origin": { "latitude": 40.7128, "longitude": -74.0060 },
    "destinations": [
      "Times Square, NYC",
      "Central Park, NYC",
      "Brooklyn Bridge, NYC"
    ],
    "mode": "walk"
  }
}

______________________________________________________________________

HTTP端点

端点方法目的
/mcp发布MCP JSON-RPC 2.0
/healthGET健康检查

______________________________________________________________________

环境变量

Node.js(.env)

变量必填描述
API_KEY谷歌地图平台API密钥
BEARER_TOKENMCP客户端的认证令牌
PORT服务器端口(默认值:3000)
AUTH_ENABLED启用身份验证(默认值:true)
AUTH_STRATEGYbearer (默认)

Cloudflare员工

牧马人。汤姆:

AUTH_ENABLED = "true"
AUTH_STRATEGY = "bearer"

秘密(通过设置 wrangler secret put):

  • BEARER_TOKEN --客户端的随机身份验证令牌
  • API_KEY -谷歌地图平台API密钥

KV命名空间:

[[kv_namespaces]]
binding = "TOKENS"
id = "your-kv-namespace-id"

______________________________________________________________________

故障排除

问题解决方案
401未经授权检查 BEARER_TOKEN 已设置,客户端发送 Authorization: Bearer
“未配置API密钥”设置 API_KEY 秘密: wrangler secret put API_KEY
“Places API error 403”在Google云控制台中启用Places API(新增)
“路由API错误404”在Google云控制台中启用路由API
地点ID无效地点ID过期。再次搜索以获取新的ID
KV命名空间错误运行 wrangler kv:namespace create TOKENS 并更新wrangler.toml

______________________________________________________________________

发展

bun dev           # Start with hot reload
bun run typecheck # TypeScript check
bun run lint      # Lint code
bun run build     # Production build
bun start         # Run production

______________________________________________________________________

建筑

src/
├── shared/
│   └── tools/
│       ├── search-places.ts   # Unified place search
│       ├── get-place.ts       # Place details
│       └── get-route.ts       # Routes & distance matrix
├── services/
│   └── google-maps.ts         # Google Maps API client
├── config/
│   └── metadata.ts            # Server & tool descriptions
├── index.ts                   # Node.js entry
└── worker.ts                  # Workers entry

______________________________________________________________________

许可证

麻省理工学院

目录标签

目录标签

位置天气TypeScript搜索地图服务本地部署位置感知AI代理路线规划地点搜索

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

api-key

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明api-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP