Back to MCP directory
publicPublicdnsLocal runtime

location-mcp-server

一个提供macOS本地应用位置数据的MCP服务器,通过与Claude Desktop集成实现位置获取功能。

article

README

🚀 位置 MCP 服务器

位置 MCP 服务器是一个 MCP(模型上下文协议)服务器,它能够提供来自本地 macOS 应用程序的位置数据,为相关应用场景提供精准的位置信息支持。

🚀 快速开始

先决条件

  • macOS(此包会启动一个 macOS 应用)
  • Node.js 16 或更高版本

📦 安装指南

你可以选择以下两种方式进行安装:

npm install -g @sokyran/location-mcp-server

或者直接运行:

npx @sokyran/location-mcp-server

💻 使用示例

与 Claude Desktop 配合使用

  1. 下载 location-getter-agent.app 并将其放置在运行命令的同一目录中。
  2. 编辑您的 Claude Desktop 配置文件:
{
  "mcpServers": {
    "location": {
      "command": "npx",
      "args": ["@sokyran/location-mcp-server"]
    }
  }
}
  1. 重新启动 Claude Desktop。
  2. 您现在可以在与 Claude 的对话中使用 getCurrentLocation 工具。

手动构建与启动

  1. 使用 Xcode,构建 location-getter
  2. 在 Xcode 中,转到产品 -> 显示构建文件夹的 Finder。
  3. 在这里,找到 Products/Debug/location-getter-agent.app 并粘贴在 index.ts 所在的同一文件夹中。
  4. 依次执行以下命令:
npm i
npm run build
npm run start

🔧 技术细节

工作原理

服务器的工作流程如下:

  1. 启动 location-getter-agent.app(必须位于当前目录)。
  2. 等待应用程序在其 HTTP 服务器上运行在端口 8080。
  3. 对外公开一个 getCurrentLocation 工具给 Claude。
  4. 在被调用时,它从本地应用获取位置数据并返回。

🛠️ 故障排除

  • 确保 location-getter-agent.app 位于运行命令的同一目录中。
  • 如果出现权限错误,请在系统设置 > 安全与隐私中允许该应用程序。
  • 检查端口 8080 是否未被其他应用程序占用。
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