Skip to main content

UBox MCP服务器 - 通过Model Context Protocol暴露UBox设备自动化能力

Project description

UBox MCP服务器

快速上手

# 安装提供的 wheel 文件
uv tool install --python 3.10.12 ubox_mcp_server-0.1.0-py3-none-any.whl --index-url https://pypi.tuna.tsinghua.edu.cn/simple
ubox-mcp-server \
  --ubox-secret-id your_id \
  --ubox-secret-key your_key \
  --ubox-mode normal

在cline中添加如下配置:

{
  "mcpServers": {
    "ubox-mcp-server": {
      "transport": "http",
      "url": "http://localhost:8000/mcp",
      "description": "UBox MCP Server"
    }
  }
}

安装(来自打包文件)

# 安装提供的 wheel 文件
uv tool install --python 3.10.12 ubox_mcp_server-0.1.0-py3-none-any.whl --index-url https://pypi.tuna.tsinghua.edu.cn/simple

配置与启动

方式1:使用 .env 文件

# 创建配置文件
cat > .env << EOF
UBOX_SECRET_ID=your_secret_id
UBOX_SECRET_KEY=your_secret_key
UBOX_MODE=local
MCP_MODE=streamable-http
MCP_HOST=localhost
MCP_PORT=8000
EOF

# 启动(会自动读取当前目录的 .env 文件)
ubox-mcp-server

方式2:纯命令行(跨平台)

  • macOS/Linux:
ubox-mcp-server \
  --ubox-secret-id your_id \
  --ubox-secret-key your_key \
  --ubox-mode normal \
  --mcp-mode streamable-http \
  --mcp-port 8000 \
  --log-level DEBUG
  • Windows PowerShell:
ubox-mcp-server `
  --ubox-secret-id your_id `
  --ubox-secret-key your_key `
  --ubox-mode normal `
  --mcp-mode streamable-http `
  --mcp-port 8000 `
  --log-level DEBUG

方式3:全部环境变量

export UBOX_SECRET_ID=your_secret_id
export UBOX_SECRET_KEY=your_secret_key
export UBOX_MODE=local
export MCP_MODE=streamable-http
export MCP_HOST=localhost
export MCP_PORT=8000

ubox-mcp-server

简单校验

# 列出工具
curl -X POST http://localhost:8000/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

获取帮助

ubox-mcp-server --help

在 Cline 中使用(VS Code)

  1. 启动服务器
  • macOS/Linux:
ubox-mcp-server \
  --ubox-secret-id your_id \
  --ubox-secret-key your_key \
  --ubox-mode local \
  --mcp-mode streamable-http \
  --mcp-port 8000 \
  --log-level DEBUG
  • Windows PowerShell:
ubox-mcp-server `
  --ubox-mode local `
  --mcp-mode streamable-http `
  --mcp-port 8000 `
  --log-level DEBUG
  1. 配置 Cline
  • VS Code 命令面板 → “Cline: Configure MCP Servers” → 添加:
{
  "mcpServers": {
    "ubox-mcp-server": {
      "transport": "http",
      "url": "http://localhost:8000/mcp",
      "description": "UBox MCP Server"
    }
  }
}

(如你的 Cline 支持 SSE,也可改为:)

{
  "mcpServers": {
    "ubox-mcp-server": {
      "transport": "sse",
      "url": "http://localhost:8000/sse"
    }
  }
}
  1. 使用与验证
  • Cline 面板应显示 “ubox-mcp-server” 已连接
  • 在对话中输入任务(如“获取设备列表”“连接设备并截图”),Cline 会调用对应工具

可配置项一览

以下所有配置可通过三种方式设置(优先级从高到低):

  1. 命令行参数(仅标注了有对应 --flag 的项);2) 环境变量;3) .env 文件。

UBox SDK

  • UBox 运行模式
    • 环境变量/.env: UBOX_MODElocal|normal)默认 local
    • CLI: --ubox-mode
    • 必填: 否
  • 本地模式 Base URL(当 UBOX_MODE=local 时生效)
    • 环境变量/.env: UBOX_BASE_URL(默认 127.0.0.1:26000
    • CLI: --ubox-base-url
    • 必填: 否
  • UBox 环境
    • 环境变量/.env: UBOX_ENVformal|test,默认 formal
    • CLI: --ubox-env
    • 必填: 否
  • 默认设备可选参数(若你的流程需要默认值)
    • 环境变量/.env: UBOX_DEFAULT_UDIDUBOX_DEFAULT_OS_TYPE(默认 android)、UBOX_AUTH_CODE
    • CLI: 无

MCP 服务器

  • 运行模式
    • 环境变量/.env: MCP_MODEsse|streamable-http,默认 streamable-http
    • CLI: --mcp-mode
    • 必填: 否
  • 主机地址
    • 环境变量/.env: MCP_HOST(默认 localhost
    • CLI: --mcp-host
    • 必填: 否
  • 端口
    • 环境变量/.env: MCP_PORT(默认 8000
    • CLI: --mcp-port
    • 必填: 否
  • 日志级别
    • 环境变量/.env: LOG_LEVELDEBUG|INFO|WARNING|ERROR,默认 INFO
    • CLI: --log-level
    • 必填: 否
  • 写入日志文件
    • 环境变量/.env: LOG_TO_FILEtrue|false,默认 false
    • CLI: 无
    • 必填: 否

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ubox_mcp_server-0.1.5.tar.gz (77.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ubox_mcp_server-0.1.5-py3-none-any.whl (44.9 kB view details)

Uploaded Python 3

File details

Details for the file ubox_mcp_server-0.1.5.tar.gz.

File metadata

  • Download URL: ubox_mcp_server-0.1.5.tar.gz
  • Upload date:
  • Size: 77.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ubox_mcp_server-0.1.5.tar.gz
Algorithm Hash digest
SHA256 21e7d096a50e472817f18ec4cb864464f77be57bacdbe4f61de0eb5268a2b8ac
MD5 90fb85feb014218ba85e9e3e45846807
BLAKE2b-256 16f38a8d07f738755f1e780662dd0e15f53eeded15ed795c949fd6735784b1f3

See more details on using hashes here.

File details

Details for the file ubox_mcp_server-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: ubox_mcp_server-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 44.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ubox_mcp_server-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8d23f5e45ec0c1a9ad5fa0b8168a8c578edf0eaf4fd820e492647f3c7635d6c8
MD5 f2a63f88c1d09844ebb075e17b16e523
BLAKE2b-256 98c0297a2c497081d5bc2ddc91f590f7c5a39a0a14be021865282db1559d87bf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page