地图服务协议

MapKitMCP是一个基于Model Context Protocol(MCP)的服务器,为LLMs提供Apple MapKit功能,包括地理编码、地点搜索、路线规划等。

  • by jsflax
  • Swift
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 jsflax/MapKitMCP

使用说明

MapKitMCP

A. 模型上下文协议 (MCP)服务器,向LLM公开Apple MapKit功能。使用Swift构建 MCP Swift官方SDK.

工具

工具 说明
geocode 将地址转换为坐标(纬度/经度)
reverseGeocode 将坐标转换为地址
searchPlaces 搜索某个地点附近的景点或兴趣点
searchByCategory 按类别搜索POI(例如,咖啡馆、医院、公园)
getDirections 获取两个坐标对之间的分步说明
calculateDistance 计算两点之间的直线距离
estimateTravelTime 估计两个坐标对之间的行程时间
getDirectionsByAddress 获取两个地址之间的分步说明
mapSnapshot 渲染以某个位置为中心的静态地图图像

需求

  • macOS 13+
  • Swift 6.0+

通过 Homebrew 安装

brew install jsflax/tap/mapkit-mcp

从源代码构建

git clone https://github.com/jsflax/MapKitMCP.git
cd MapKitMCP
swift build -c release

二进制文件将位于 .build/release/MapKitMCP.

用法

克劳德桌面版

添加到您的Claude Desktop配置(~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "mapkit": {
      "command": "/path/to/MapKitMCP"
    }
  }
}

克劳德代码

claude mcp add mapkit /path/to/MapKitMCP

或者构建并添加一个步骤:

swift build -c release
claude mcp add mapkit "$(swift build -c release --show-bin-path)/MapKitMCP"

运行测试

swift test

许可证

麻省理工学院-见 许可证 了解详情。