MCP service that wraps HarmonyOS hdc commands
Project description
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、shellhvigor_clean、hvigor_assemble、hvigor_find_outputhdc_screenshot、hdc_install_app
常见问题(精简)
- 找不到
hdc/hvigorw:检查并设置HDC_PATH、HVIGORW_PATH。 - 无响应或超时:适当提高超时或减少输出量。
- 权限问题:设备开启开发者模式并授予访问权限。
开发者文档
详细技术说明(环境变量、运行模式、工具参数与返回结构、长示例、完整排障)见 docs/DEVELOPER.md。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file harmony_tools_mcp-0.1.2.tar.gz.
File metadata
- Download URL: harmony_tools_mcp-0.1.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51b794490352870a8b6d35b920bd3151135c5430604777af65b80a4e0bd5fbb2
|
|
| MD5 |
a493c9afbe9eeb854f2a2d1db10621a6
|
|
| BLAKE2b-256 |
b73ac92946ff890502860bac0e79a53ca75ffc15e7177c63e5a7157333e96657
|
Provenance
The following attestation bundles were made for harmony_tools_mcp-0.1.2.tar.gz:
Publisher:
python-publish.yml on 99byte/harmony-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
harmony_tools_mcp-0.1.2.tar.gz -
Subject digest:
51b794490352870a8b6d35b920bd3151135c5430604777af65b80a4e0bd5fbb2 - Sigstore transparency entry: 705312130
- Sigstore integration time:
-
Permalink:
99byte/harmony-tools@8a92907c51255598313266fdfed0c5635f0b49ba -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/99byte
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@8a92907c51255598313266fdfed0c5635f0b49ba -
Trigger Event:
push
-
Statement type:
File details
Details for the file harmony_tools_mcp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: harmony_tools_mcp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fade4617195bcdf5016e9249a42c6a766b30620b9158e135bbd908e84e7a9200
|
|
| MD5 |
d28398dadb0ffb5e739acba2cf2088df
|
|
| BLAKE2b-256 |
07ffb9aaa3e531174181c23c9354a233e92bc626126cd2734d040063130ac5cd
|
Provenance
The following attestation bundles were made for harmony_tools_mcp-0.1.2-py3-none-any.whl:
Publisher:
python-publish.yml on 99byte/harmony-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
harmony_tools_mcp-0.1.2-py3-none-any.whl -
Subject digest:
fade4617195bcdf5016e9249a42c6a766b30620b9158e135bbd908e84e7a9200 - Sigstore transparency entry: 705312135
- Sigstore integration time:
-
Permalink:
99byte/harmony-tools@8a92907c51255598313266fdfed0c5635f0b49ba -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/99byte
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@8a92907c51255598313266fdfed0c5635f0b49ba -
Trigger Event:
push
-
Statement type: