Skip to main content

Harmony Tools MCP 服务

将 HarmonyOS 命令行工具(hdc、hvigor 等)封装为 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_targets、shell
  • hvigor_clean、hvigor_assemble、hvigor_find_output
  • hdc_screenshot、hdc_install_app

常见问题(精简)

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

开发者文档

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

Metadata

Release files for harmony-tools-mcp 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for harmony-tools-mcp 0.1.3
File Size Uploaded Provenance
harmony_tools_mcp-0.1.3.tar.gz 18.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for harmony-tools-mcp 0.1.3
File Interpreter ABI Platform
harmony_tools_mcp-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 38.5 kB

Release files / harmony_tools_mcp-0.1.3.tar.gz

Download URL harmony_tools_mcp-0.1.3.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3624d0dc852519262a29d674f130634b7aa39663db3cd4d4249a254006af99d0
BLAKE2b-256 checksum
How to use checksums
bfee60b24197f13b3e952f8f86fab88ac36931c989eddf56517716d6bfd19f8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2025.

Transparency log

Release files / harmony_tools_mcp-0.1.3-py3-none-any.whl

Download URL harmony_tools_mcp-0.1.3-py3-none-any.whl
Size 19.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
311eb72e6086be93c89fd8d70a0f565d8153228d241da41dc916f571976a2045
BLAKE2b-256 checksum
How to use checksums
71affe8e09dbf36f9d125765db41a32241f880384574b93936b8d68519499882
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2025.

Transparency log

Security for harmony-tools-mcp 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for harmony_tools_mcp-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page