### Setup and Run Tests for Maestro MCP Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Configure a virtual environment, install development dependencies, and run tests using `pytest`. ```bash # Run tests: uv venv && source .venv/bin/activate uv pip install -e ".[dev]" MAESTRO_API_KEY="your-key" MAESTRO_BINARY_PATH="~/.maestro/bin/maestro" pytest tests/ ``` -------------------------------- ### Set Up and Install Project Dependencies with uv Source: https://github.com/mobile-dev-inc/maestro-mcp/blob/main/DEVELOPING.md Sets up a virtual environment, activates it, and installs the project and its development dependencies using uv. This is a standard workflow for Python projects managed with uv. ```bash uv venv source .venv/bin/activate uv pip install -e . uv pip install -e ".[dev]" ``` -------------------------------- ### Install MCP Locally with Environment Variables Source: https://github.com/mobile-dev-inc/maestro-mcp/blob/main/DEVELOPING.md Installs the MCP locally using uv, passing API key and binary path as environment variables. This is useful for development and testing. ```bash uv run --with "mcp[cli]" mcp install -v MAESTRO_API_KEY="" -v MAESTRO_BINARY_PATH="~/.maestro/bin/maestro" mcp.py ``` -------------------------------- ### Install uv Dependency Manager Source: https://github.com/mobile-dev-inc/maestro-mcp/blob/main/DEVELOPING.md Installs the uv dependency manager globally using Homebrew. Ensure Homebrew is installed before running this command. ```bash brew install uv ``` -------------------------------- ### Install MCP Locally with MCP CLI Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Install the MCP locally using the MCP CLI, specifying API key and binary path as environment variables. This command ensures the MCP Python script is set up correctly. ```bash uv run --with "mcp[cli]" mcp install \ -v MAESTRO_API_KEY="your-api-key" \ -v MAESTRO_BINARY_PATH="~/.maestro/bin/maestro" \ mcp.py ``` -------------------------------- ### Install Maestro MCP Package Source: https://github.com/mobile-dev-inc/maestro-mcp/blob/main/README.md Install the Maestro MCP Python package using pip. Refer to the official documentation for more details. ```bash pip install maestro-mcp ``` -------------------------------- ### MaestroCli Class Constructor and Methods Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Instantiate the MaestroCli class with optional parameters for API key, binary path, and API server. Demonstrates various methods for running code, tests, getting hierarchy, checking syntax, and querying docs. ```python from src.maestro_mcp.maestro_cli import MaestroCli # Full constructor — all parameters are optional cli = MaestroCli( api_key="your-maestro-api-key", # Falls back to ~/.mobiledev/authtoken maestro_binary_path="~/.maestro/bin/maestro", # Falls back to PATH lookup api_server="https://api.copilot.mobile.dev" # Default Maestro cloud API ) # Internal code formatter — normalizes inline snippets before execution formatted = cli._format("tapOn:\n text: Search Wikipedia") # Result: # appId: any # --- # - tapOn: # text: Search Wikipedia # Running formatted code result = cli.run_code("tapOn: Login") # Auto-formats + validates + runs result = cli.run_test("/path/to/flow.yml") # Runs file directly result = cli.get_hierarchy() # Gets current screen JSON result = cli.check_syntax("tapOn: Login") # Returns "OK" or error string result = cli.cheat_sheet() # Fetches YAML syntax reference result = cli.query_docs("how to swipe?") # Queries documentation AI ``` -------------------------------- ### Install Local MCP Build Source: https://github.com/mobile-dev-inc/maestro-mcp/blob/main/DEVELOPING.md Uninstalls the currently installed version of maestro-mcp and then installs the newly built local version from the distribution file. This ensures the latest local changes are active. ```bash pip uninstall -y maestro-mcp pip install dist/*.whl ``` -------------------------------- ### Run Application with uv Source: https://github.com/mobile-dev-inc/maestro-mcp/blob/main/DEVELOPING.md Executes the Maestro MCP application using uv, specifying additional dependencies to be included. This command is used to start the application's command-line interface. ```bash uv run --with "mcp[cli]" --with "requests" mcp run src/maestro_mcp/cli.py ``` -------------------------------- ### Build MCP Locally Source: https://github.com/mobile-dev-inc/maestro-mcp/blob/main/DEVELOPING.md Removes the existing distribution files and builds a new distribution package for the MCP. This is a prerequisite for installing a local build. ```bash rf -rf dist/ uv build ``` -------------------------------- ### Query Maestro Documentation with MaestroCli Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Search the official Maestro documentation using natural language queries. The tool returns answers sourced from the official docs, potentially including code examples. ```python from src.maestro_mcp.maestro_cli import MaestroCli cli = MaestroCli(api_key="your-api-key", maestro_binary_path="~/.maestro/bin/maestro") result = cli.query_docs("How do I scroll to an element?") print(result) result = cli.query_docs("How do I handle conditional flows?") print(result) ``` -------------------------------- ### Get UI Hierarchy with MaestroCli Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Retrieve the current screen's view hierarchy as JSON using MaestroCli. This is useful for debugging and inspecting UI elements. ```python from src.maestro_mcp.maestro_cli import MaestroCli cli = MaestroCli(api_key="your-api-key", maestro_binary_path="~/.maestro/bin/maestro") hierarchy = cli.get_hierarchy() print(hierarchy) ``` -------------------------------- ### Run Maestro MCP via Entry Point Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Execute the MCP server using the `mcp.py` entry point script, setting necessary environment variables. ```bash # Via entry point script: MAESTRO_API_KEY="your-key" MAESTRO_BINARY_PATH="~/.maestro/bin/maestro" uv run mcp.py ``` -------------------------------- ### Run Maestro MCP Server Directly Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Launch the Maestro MCP server from the repository root using `uv` for development. ```bash # Development (from repo root): uv run --with "mcp[cli]" --with "requests" mcp run src/maestro_mcp/cli.py ``` -------------------------------- ### MaestroCli.cheat_sheet Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Fetches the YAML syntax reference for Maestro. ```APIDOC ## MaestroCli.cheat_sheet ### Description Fetches and returns the Maestro YAML syntax reference, often referred to as a cheat sheet. This is useful for quick lookups of available commands and their syntax. ### Method ```python cli.cheat_sheet() ``` ### Parameters None ### Request Example ```python from src.maestro_mcp.maestro_cli import MaestroCli cli = MaestroCli(api_key="your-api-key", maestro_binary_path="~/.maestro/bin/maestro") syntax_reference = cli.cheat_sheet() print(syntax_reference) ``` ### Response #### Success Response - **syntax_reference** (str) - A string containing the Maestro YAML syntax reference. #### Response Example ``` # Example output (truncated): # Commands: # tapOn: Element to tap on # - text: "Button Text" # - id: "element_id" # swipe: Swipe gesture # - direction: UP | DOWN | LEFT | RIGHT # ... ``` ``` -------------------------------- ### Logging with get_logger Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Initialize a logger instance using get_logger to write structured log output to '~/.maestro/mcp.log'. Log messages are formatted with timestamp, module name, level, and message content. ```python from src.maestro_mcp.logger import get_logger logger = get_logger("my_module") logger.info("Starting execution for flow: %s", "login.yml") # Writes to ~/.maestro/mcp.log: # 2024-01-15 10:23:45,123 - my_module - INFO - Starting execution for flow: login.yml logger.error("CLI not found: %s", "/bad/path/maestro") ``` -------------------------------- ### Configure MCP Server on Claude/Windsurf Source: https://github.com/mobile-dev-inc/maestro-mcp/blob/main/DEVELOPING.md Configuration snippet for the MCP server, detailing the command, arguments, and environment variables required for its operation on platforms like Claude. Ensure correct paths and API keys are provided. ```json { "mcpServers": { "maestro": { "command": "uv", "args": [ "run", "--with", "mcp[cli]", "--with", "uv", "--with", "requests", "mcp", "run", "" ], "env": { "MAESTRO_BINARY_PATH": "", "MAESTRO_API_KEY": "" } } } } ``` -------------------------------- ### MaestroCli Constructor Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Initializes the MaestroCli class, which wraps the local Maestro binary and Maestro cloud API. ```APIDOC ## MaestroCli ### Description The core Python class that wraps the local Maestro binary and Maestro cloud API. It handles binary discovery, API key loading, code formatting, and subprocess execution. ### Constructor ```python MaestroCli( api_key: str = None, maestro_binary_path: str = None, api_server: str = "https://api.copilot.mobile.dev" ) ``` ### Parameters #### Optional Parameters - **api_key** (str) - Your Maestro API key. Falls back to `~/.mobiledev/authtoken` if not provided. - **maestro_binary_path** (str) - The path to the Maestro binary. Falls back to looking in the system's PATH if not provided. - **api_server** (str) - The base URL for the Maestro cloud API. Defaults to `https://api.copilot.mobile.dev`. ### Initialization Example ```python from src.maestro_mcp.maestro_cli import MaestroCli # Using default values for binary path and API server cli = MaestroCli(api_key="your-maestro-api-key") # Specifying all parameters cli = MaestroCli( api_key="your-maestro-api-key", maestro_binary_path="~/.maestro/bin/maestro", api_server="https://api.copilot.mobile.dev" ) ``` ``` -------------------------------- ### Run Maestro Flow Files from Disk with run_flow_files Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Execute one or more Maestro `.yml` flow files from disk using the 'run_flow_files' tool. The tool accepts a space-delimited list of file paths and appends the view hierarchy to the output. ```python # Tool name: run_flow_files # Parameter: flowFiles (str) — space-delimited list of absolute paths # Single file: flow_files = "/Users/yourname/tests/login.yml" # Multiple files: flow_files = "/Users/yourname/tests/login.yml /Users/yourname/tests/checkout.yml" # Path with spaces: flow_files = '"/Users/yourname/my tests/login flow.yml"' ``` -------------------------------- ### Run Maestro Test Flow with MaestroCli Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Use MaestroCli to execute a Maestro YAML test file directly. Ensure the Maestro binary and API key are configured. ```python from src.maestro_mcp.maestro_cli import MaestroCli cli = MaestroCli(api_key="your-api-key", maestro_binary_path="~/.maestro/bin/maestro") result = cli.run_test("/Users/yourname/tests/login.yml") print(result) ``` -------------------------------- ### MCP Tool: `run_flow_files` Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Runs one or more existing Maestro `.yml` test flow files from disk. Accepts a space-delimited list of absolute file paths. Paths containing spaces should be quoted. After execution, the current view hierarchy is automatically appended to the result. ```APIDOC ## MCP Tool: `run_flow_files` ### Description Runs one or more existing Maestro `.yml` test flow files from disk. Accepts a space-delimited list of absolute file paths. Paths containing spaces should be quoted. After execution, the current view hierarchy is automatically appended to the result. ### Tool Signature `run_flow_files(flowFiles: str)` ### Parameters #### Request Body - **flowFiles** (str) - Required - A space-delimited list of absolute paths to Maestro flow files. ### Request Example Single file: ```python flow_files = "/Users/yourname/tests/login.yml" ``` Multiple files: ```python flow_files = "/Users/yourname/tests/login.yml /Users/yourname/tests/checkout.yml" ``` Path with spaces: ```python flow_files = '"/Users/yourname/my tests/login flow.yml"' ``` ### Usage Example ```python from src.maestro_mcp.maestro_cli import MaestroCli cli = MaestroCli(api_key="your-api-key", maestro_binary_path="~/.maestro/bin/maestro") result = cli.run_flow_files(flow_files) print(result) ``` ``` -------------------------------- ### Configure MCP Server in Claude Desktop/Cursor/Windsurf Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Configure the MCP server settings within AI client applications. This JSON configuration specifies the command to run the MCP server and its environment variables. ```json { "mcpServers": { "maestro": { "command": "uv", "args": [ "run", "--with", "mcp[cli]", "--with", "uv", "--with", "requests", "mcp", "run", "/absolute/path/to/mcp.py" ], "env": { "MAESTRO_BINARY_PATH": "/Users/yourname/.maestro/bin/maestro", "MAESTRO_API_KEY": "your-maestro-api-key" } } } } ``` -------------------------------- ### Tail Maestro MCP Logs Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Use `tail -f` to monitor the `mcp.log` file in real-time during development. ```bash # Tail logs during development: tail -f ~/.maestro/mcp.log ``` -------------------------------- ### MCP Tool: `get_cheat_sheet` Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Retrieves the full Maestro YAML syntax cheat sheet as an MCP tool call. This should always be invoked first before using any other tools, to give the AI client a complete understanding of available Maestro commands and syntax. ```APIDOC ## MCP Tool: `get_cheat_sheet` ### Description Retrieves the full Maestro YAML syntax cheat sheet as an MCP tool call. This should always be invoked first before using any other tools, to give the AI client a complete understanding of available Maestro commands and syntax. ### Tool Signature `get_cheat_sheet()` ### Usage Example ```python from src.maestro_mcp.maestro_cli import MaestroCli cli = MaestroCli(api_key="your-api-key", maestro_binary_path="~/.maestro/bin/maestro") result = cli.cheat_sheet() # Returns a comprehensive YAML syntax reference for use by the AI when authoring flows ``` ``` -------------------------------- ### MCP Tool: `run_code` Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Executes an ad-hoc Maestro flow script provided as an inline string against the currently connected device. The tool auto-formats the input, validates syntax, runs the flow via the Maestro CLI, and appends the current view hierarchy to the response. ```APIDOC ## MCP Tool: `run_code` ### Description Executes an ad-hoc Maestro flow script provided as an inline string against the currently connected device. The tool auto-formats the input (adds `appId: any` header and `- ` prefixes if missing), validates syntax, runs the flow via the Maestro CLI, and then appends the current view hierarchy to the response. ### Tool Signature `run_code(flow_script: str)` ### Parameters #### Request Body - **flow_script** (str) - Required - A Maestro YAML snippet or full flow. ### Request Example Minimal single command (header is auto-added): ```python flow_script = "tapOn: Login" ``` Full flow with header: ```python flow_script = """ appId: com.example.myapp --- - tapOn: \"Username\" - inputText: \"testuser@example.com\" - tapOn: \"Password\" - inputText: \"secret123\" - tapOn: \"Login\" - assertVisible: \"Welcome\" """ ``` ### Usage Example ```python from src.maestro_mcp.maestro_cli import MaestroCli cli = MaestroCli(api_key="your-api-key", maestro_binary_path="~/.maestro/bin/maestro") result = cli.run_code(flow_script) print(result) ``` ### Response Example ``` Running on device: Pixel 6 (API 33) ✓ tapOn: 'Username' ... Current view hierarchy: {...} ``` ``` -------------------------------- ### MaestroCli.query_docs Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Queries the official Maestro documentation using a free-text search. ```APIDOC ## MaestroCli.query_docs ### Description Queries the official Maestro documentation using a free-text search. Sends the query to the Maestro cloud API and returns a natural-language answer sourced from the official docs, including code examples where relevant. ### Method ```python cli.query_docs(query: str) ``` ### Parameters #### Query Parameters - **query** (str) - Required - The free-text question to search the documentation. ### Request Example ```python from src.maestro_mcp.maestro_cli import MaestroCli cli = MaestroCli(api_key="your-api-key", maestro_binary_path="~/.maestro/bin/maestro") result = cli.query_docs("How do I scroll to an element?") print(result) result = cli.query_docs("How do I handle conditional flows?") print(result) ``` ### Response #### Success Response - **result** (str) - A natural-language answer to the query, potentially including code examples. #### Response Example (Scroll) ``` To scroll to an element in Maestro, you can use the `scrollUntilVisible` command: - scrollUntilVisible: element: text: 'Submit' direction: DOWN ``` #### Response Example (Conditional Flows) ``` Maestro supports conditional flows using the `runFlow` command with conditions: - runFlow: when: visible: 'Allow' file: 'allow_permissions.yml' ``` ``` -------------------------------- ### MCP Resource: cheat_sheet Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Exposes the full Maestro flow YAML syntax reference as a readable MCP resource. The resource fetches the cheat sheet from the Maestro cloud API and returns it as a string. ```APIDOC ## MCP Resource: `cheat_sheet` ### Description Exposes the full Maestro flow YAML syntax reference as a readable MCP resource at the URI `https://maestro.dev/cheat-sheet`. The resource fetches the cheat sheet from the Maestro cloud API and returns it as a string. It can be read by any MCP client that supports resource access. ### Usage Example ```python from src.maestro_mcp.maestro_cli import MaestroCli cli = MaestroCli( api_key="your-api-key", maestro_binary_path="/Users/yourname/.maestro/bin/maestro" ) # Fetch the cheat sheet directly cheat_sheet = cli.cheat_sheet() print(cheat_sheet) ``` ### Response Example ``` Maestro Flow Script Cheat Sheet appId: --- - tapOn: ... ``` ``` -------------------------------- ### MaestroCli.run_test Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Executes a Maestro test flow defined in a YAML file. ```APIDOC ## MaestroCli.run_test ### Description Executes a Maestro test flow defined in a YAML file. ### Method ```python cli.run_test(file_path: str) ``` ### Parameters #### Path Parameters - **file_path** (str) - Required - The path to the Maestro YAML test file. ### Request Example ```python from src.maestro_mcp.maestro_cli import MaestroCli cli = MaestroCli(api_key="your-api-key", maestro_binary_path="~/.maestro/bin/maestro") result = cli.run_test("/Users/yourname/tests/login.yml") print(result) ``` ### Response #### Success Response - **result** (str) - The output from running the test, indicating success or failure. #### Response Example ``` Running on device: iPhone 15 (iOS 17) ✓ Flow: login.yml PASSED Current view hierarchy: {...} ``` #### Failure Response Example ``` Execution failed with: Current view hierarchy: {...} ``` ``` -------------------------------- ### Invoke get_cheat_sheet MCP Tool Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt This describes how an MCP client would invoke the 'get_cheat_sheet' tool. The equivalent direct call using MaestroCli is also shown. ```python # When invoked by an MCP client, the tool resolves via the lifespan context: # Tool name: get_cheat_sheet # Parameters: none # Equivalent direct call: from src.maestro_mcp.maestro_cli import MaestroCli cli = MaestroCli(api_key="your-api-key", maestro_binary_path="~/.maestro/bin/maestro") result = cli.cheat_sheet() # Returns a comprehensive YAML syntax reference for use by the AI when authoring flows ``` -------------------------------- ### MaestroCli.run_code Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Formats, validates, and runs a given Maestro code snippet. ```APIDOC ## MaestroCli.run_code ### Description Automatically formats, validates, and then executes a given Maestro code snippet. This is a convenient method for running inline Maestro commands. ### Method ```python cli.run_code(code: str) ``` ### Parameters #### Request Body - **code** (str) - Required - The Maestro YAML code snippet to run. ### Request Example ```python from src.maestro_mcp.maestro_cli import MaestroCli cli = MaestroCli(api_key="your-api-key", maestro_binary_path="~/.maestro/bin/maestro") result = cli.run_code("tapOn: \"Login\"") print(result) ``` ### Response #### Success Response - **result** (str) - The output from executing the Maestro code. #### Response Example ``` # Example output depends on the command executed, e.g., for tapOn: # ✓ tapOn: "Login" ``` ``` -------------------------------- ### Fetch Maestro Cheat Sheet using MaestroCli Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Access the Maestro flow YAML syntax reference directly using the MaestroCli class. This method fetches the cheat sheet from the Maestro cloud API. ```python # Accessed internally via MaestroCli; exposed as an MCP resource from src.maestro_mcp.maestro_cli import MaestroCli cli = MaestroCli( api_key="your-api-key", maestro_binary_path="/Users/yourname/.maestro/bin/maestro" ) # Fetch the cheat sheet directly cheat_sheet = cli.cheat_sheet() print(cheat_sheet) # Output: "Maestro Flow Script Cheat Sheet\n appId: \n---\n- tapOn: ..." ``` -------------------------------- ### Execute Ad-hoc Maestro Flow Script with run_code Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Use the 'run_code' tool to execute an inline Maestro flow script. The tool automatically formats, validates, and runs the script, appending the view hierarchy to the result. ```python # Tool name: run_code # Parameter: flow_script (str) — a Maestro YAML snippet or full flow # Minimal single command (header is auto-added): flow_script = "tapOn: Login" # Full flow with header: flow_script = """ appId: com.example.myapp --- - tapOn: "Username" - inputText: "testuser@example.com" - tapOn: "Password" - inputText: "secret123" - tapOn: "Login" - assertVisible: "Welcome" """ # Direct equivalent using MaestroCli: from src.maestro_mcp.maestro_cli import MaestroCli cli = MaestroCli(api_key="your-api-key", maestro_binary_path="~/.maestro/bin/maestro") result = cli.run_code(flow_script) print(result) # Output: "Running on device: Pixel 6 (API 33)\n✓ tapOn: 'Username' ...\n\nCurrent view hierarchy:\n{...}" ``` -------------------------------- ### Check Maestro YAML Syntax with MaestroCli Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Validate Maestro YAML code syntax without execution. Returns 'OK' for valid code or an error message for invalid code. Use a try-except block to catch syntax errors. ```python from src.maestro_mcp.maestro_cli import MaestroCli cli = MaestroCli(api_key="your-api-key", maestro_binary_path="~/.maestro/bin/maestro") # Valid code: result = cli.check_syntax('tapOn: "Login"') print(result) # "OK" # Invalid code: try: result = cli.check_syntax('tapO n: "Login"') except Exception as e: print(e) # "Did you mean `tapOn`? ..." ``` -------------------------------- ### MaestroCli.get_hierarchy Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Retrieves the full JSON view hierarchy of the currently visible screen on the connected device. ```APIDOC ## MaestroCli.get_hierarchy ### Description Retrieves the full JSON view hierarchy of the currently visible screen on the connected device. Useful for inspecting element names, IDs, and positions before writing or debugging flow scripts. The hierarchy is fetched in compact mode from device index 0. ### Method ```python cli.get_hierarchy() ``` ### Parameters None ### Request Example ```python from src.maestro_mcp.maestro_cli import MaestroCli cli = MaestroCli(api_key="your-api-key", maestro_binary_path="~/.maestro/bin/maestro") hierarchy = cli.get_hierarchy() print(hierarchy) ``` ### Response #### Success Response - **hierarchy** (str) - A compact JSON string representing the UI tree of the current screen. #### Response Example ```json {"nodes":[{"id":"login_button","text":"Login","bounds":{"x":100,"y":400,"w":200,"h":50}}, {"id":"username_field","text":"","hint":"Username",...}]} ``` ``` -------------------------------- ### MaestroCli.check_syntax Source: https://context7.com/mobile-dev-inc/maestro-mcp/llms.txt Validates a block of Maestro YAML code without executing it. ```APIDOC ## MaestroCli.check_syntax ### Description Validates a block of Maestro YAML code without executing it. Returns `"OK"` if the code is valid, or a descriptive error message if it is not. ### Method ```python cli.check_syntax(code: str) ``` ### Parameters #### Request Body - **code** (str) - Required - The Maestro YAML code to validate. ### Request Example ```python from src.maestro_mcp.maestro_cli import MaestroCli cli = MaestroCli(api_key="your-api-key", maestro_binary_path="~/.maestro/bin/maestro") # Valid code: result = cli.check_syntax('tapOn: "Login"') print(result) # "OK" # Invalid code: try: result = cli.check_syntax('tapO n: "Login"') except Exception as e: print(e) # "Did you mean `tapOn`? ..." ``` ### Response #### Success Response (OK) - **result** (str) - Returns `"OK"` if the YAML code is syntactically correct. #### Error Response - **result** (str) - A descriptive error message indicating the syntax issue and potential suggestions. #### Response Example (Success) ``` OK ``` #### Response Example (Error) ``` Did you mean `tapOn`? ... ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.