XixianLiang/HarmonyOS-mcp-server
MCP server for manipulating HarmonyOS next devices.
Platform-specific configuration:
{
"mcpServers": {
"HarmonyOS-mcp-server": {
"command": "npx",
"args": [
"-y",
"HarmonyOS-mcp-server"
]
}
}
}Add the config above to .claude/settings.json under the mcpServers key.
<div align="center"> <h1>HarmonyOS MCP Server</h1>
<a href='LICENSE'></a> <a></a> </div>
<div align="center"> </div>
This is a MCP server for manipulating harmonyOS Device.
https://github.com/user-attachments/assets/7af7f5af-e8c6-4845-8d92-cd0ab30bfe17
git clone https://github.com/XixianLiang/HarmonyOS-mcp-server.git
cd HarmonyOS-mcp-serveruv python install 3.13
uv syncYou can use Claude Desktop to try our tool.
You can also use openai-agents SDK to try the mcp server. Here's an example
"""
Example: Use Openai-agents SDK to call HarmonyOS-mcp-server
"""
import asyncio
import os
from agents import Agent, Runner, gen_trace_id, trace
from agents.mcp import MCPServerStdio, MCPServer
async def run(mcp_server: MCPServer):
agent = Agent(
name="Assistant",
instructions="Use the tools to manipulate the HarmonyOS device and finish the task.",
mcp_servers=[mcp_server],
)
message = "Launch the app `settings` on the phone"
print(f"Running: {message}")
result = await Runner.run(starting_agent=agent, input=message)
print(result.final_output)
async def main():
# Use async context manager to initialize the server
async with MCPServerStdio(
params={
"command": "<...>/bin/uv",
"args": [
"--directory",
"<...>/harmonyos-mcp-server",
"run",
"serverLoading reviews...