Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

HarmonyOS-mcp-server

MCP.Pizza Chef: XixianLiang

HarmonyOS MCP Server is a dedicated MCP server designed to interface with and manipulate HarmonyOS next-generation devices. It enables real-time structured interaction with HarmonyOS devices through the Model Context Protocol, facilitating device control, data retrieval, and integration into AI-enhanced workflows. This server supports Python 3.13 and can be integrated with popular MCP clients like Claude Desktop and openai-agents SDK for seamless device management.

Use This MCP server To

Control HarmonyOS devices via MCP protocol Retrieve device status and sensor data from HarmonyOS devices Integrate HarmonyOS device control into AI workflows Automate device configuration and management tasks Enable real-time interaction with HarmonyOS next devices Test and debug HarmonyOS device features remotely Bridge HarmonyOS devices with other MCP-enabled systems

README

HarmonyOS MCP Server

   

image

Intro

This is a MCP server for manipulating harmonyOS Device.

demo.mp4

Quick Start

Installation

  1. Clone this repo
git clone https://github.com/XixianLiang/HarmonyOS-mcp-server.git
cd HarmonyOS-mcp-server
  1. Setup the envirnment.
uv python install 3.13
uv sync

Usage

You 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",
                "server.py"
            ]
        }
    ) as server:
        trace_id = gen_trace_id()
        with trace(workflow_name="MCP HarmonyOS", trace_id=trace_id):
            print(f"View trace: https://platform.openai.com/traces/trace?trace_id={trace_id}\n")
            await run(server)


if __name__ == "__main__":
    asyncio.run(main())

HarmonyOS-mcp-server FAQ

How do I install the HarmonyOS MCP Server?
Clone the GitHub repo, then set up the environment with Python 3.13 and run uv sync as per the quick start guide.
Can I use this MCP server with different MCP clients?
Yes, it supports clients like Claude Desktop and openai-agents SDK for flexible integration.
What programming language is required to run the HarmonyOS MCP Server?
The server requires Python 3.13 for installation and operation.
Is the HarmonyOS MCP Server open source?
Yes, it is licensed under the MIT License and available on GitHub.
What kind of devices does this MCP server support?
It supports next-generation devices running HarmonyOS, enabling advanced device manipulation.
How does this server enhance device management?
It provides structured, real-time control and data access via the MCP protocol, simplifying automation and integration.
Can I test HarmonyOS device features remotely using this server?
Yes, it enables remote testing and debugging of HarmonyOS device functionalities.
Does the server support integration with AI models like OpenAI, Claude, or Gemini?
Yes, it is designed to work seamlessly with MCP clients that interface with models such as OpenAI, Claude, and Gemini.