Skip to main content

MCP service that wraps HarmonyOS hdc commands

Project description

Harmony Tools MCP 服务

将 HarmonyOS 命令行工具(hdchvigor 等)封装为 MCP 服务,接入任意支持 MCP 的客户端,常用开发任务以结构化 JSON 返回。

快速上手

  • 前置条件:Python ≥3.11;已安装 HarmonyOS Command Line Tools。
  • 下载地址:HarmonyOS Command Line Tools
  • 配置必需环境变量:
# 解压后在 command-line-tools/sdk/default/openharmony/toolchains 目录下
export HDC_PATH=/path/to/hdc
# 解压后在 command-line-tools/bin 目录下
export HVIGORW_PATH=/path/to/hvigorw

安装

# 全局安装(推荐)
uv tool install git+<repository-url>

# 开发模式(本地源码)
uv pip install -e .

启动

  • stdio(默认):
    • uv run harmony-tools-mcp
  • http(调试/多客户端):
    • uv run harmony-tools --transport http
    • ./start_http_server.sh

客户端最小配置示例

  • stdio
{
  "mcpServers": {
    "harmony-tools": {
      "command": "harmony-tools-mcp",
      "env": {
        "HDC_PATH": "/path/to/hdc", 
        "HVIGORW_PATH": "/path/to/hvigorw"
      }
    }
  }
}
  • http
{
  "mcpServers": {
    "harmony-tools": {
      "transport": "http", 
      "url": "http://127.0.0.1:10005/mcp"}
  }
}

可用工具一览

  • list_targetsshell
  • hvigor_cleanhvigor_assemblehvigor_find_output
  • hdc_screenshothdc_install_app

常见问题(精简)

  • 找不到 hdc/hvigorw:检查并设置 HDC_PATHHVIGORW_PATH
  • 无响应或超时:适当提高超时或减少输出量。
  • 权限问题:设备开启开发者模式并授予访问权限。

开发者文档

详细技术说明(环境变量、运行模式、工具参数与返回结构、长示例、完整排障)见 docs/DEVELOPER.md

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

harmony_tools_mcp-0.1.3.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

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

harmony_tools_mcp-0.1.3-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file harmony_tools_mcp-0.1.3.tar.gz.

File metadata

  • Download URL: harmony_tools_mcp-0.1.3.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for harmony_tools_mcp-0.1.3.tar.gz
Algorithm Hash digest
SHA256 3624d0dc852519262a29d674f130634b7aa39663db3cd4d4249a254006af99d0
MD5 963fb6944e3e7b9702c9621739085ab3
BLAKE2b-256 bfee60b24197f13b3e952f8f86fab88ac36931c989eddf56517716d6bfd19f8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for harmony_tools_mcp-0.1.3.tar.gz:

Publisher: python-publish.yml on 99byte/harmony-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file harmony_tools_mcp-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for harmony_tools_mcp-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 311eb72e6086be93c89fd8d70a0f565d8153228d241da41dc916f571976a2045
MD5 22511e56a53e7fb9ff0debde2e6b1bdf
BLAKE2b-256 71affe8e09dbf36f9d125765db41a32241f880384574b93936b8d68519499882

See more details on using hashes here.

Provenance

The following attestation bundles were made for harmony_tools_mcp-0.1.3-py3-none-any.whl:

Publisher: python-publish.yml on 99byte/harmony-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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