Back to MCP directory
publicPublicdnsLocal runtime

safie-api-mcp-server

一个基于Safie API的MCP服务器,用于获取和管理设备信息、图像、位置等数据

article

README

🚀 Safie API MCP 服务器

Safie API MCP(模型上下文协议)服务器,用于借助 Safie API 获取设备信息并对设备进行操作。

⚠️ 重要提示

本实现为预览版,仅试验性地提供部分功能,不提供支持,请知悉后再使用。

🚀 快速开始

要求事项

  • Python 3.10+、uv 或者 Docker

✨ 主要特性

工具

  • list_devices
    • 获取设备列表。
  • get_device_image
    • 从指定设备获取图像。
  • list_device_media
    • 获取指定设备录制的视频(媒体)列表。
  • get_device_location
    • 获取指定设备的当前 GPS 位置信息。
  • get_device_thumbnail
    • 获取指定设备的最新缩略图。
  • list_device_standard_events
    • 获取指定设备的标准事件信息列表。

📦 安装指南

配置环境变量

以下环境变量中必须至少设置其中一个:

  • ACCESS_TOKEN:在 Safie Developers OAuth2 认证应用程序中颁发的 OAuth2 访问令牌。
  • API_KEY:在 Safie Developers API 密钥认证应用程序中颁发的 API 密钥。

若同时指定了两者,将使用 ACCESS_TOKEN

不同方式使用配置

使用 Python/uv

若你已安装 Python 3.10+ 和 uv,可通过添加以下配置来使用:

{
  "mcpServers": {
    "Safie API": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "git+https://git@github.com/SafiePublic/safie-api-mcp-server.git",
        "safie-api-mcp-server"
      ],
      "env": {
        "ACCESS_TOKEN": "******"
      }
    }
  }
}

使用 Docker

若使用 Docker,首先按以下方式构建镜像:

$ docker build -t safie-api-mcp-server .

之后,添加以下配置即可使用:

{
  "mcpServers": {
    "Safie API": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "ACCESS_TOKEN",
        "-e",
        "API_KEY",
        "safie-api-mcp-server"
      ],
      "env": {
        "ACCESS_TOKEN": "******"
      }
    }
  }
}
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