Skip to main content
Glama
senseisven

MCP Remote macOS Control Server

by senseisven

remote_macos_open_application

Open or activate macOS applications remotely using app names, paths, or bundle IDs, returning the process ID for subsequent control operations.

Instructions

Opens/activates an application and returns its PID for further interactions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
identifierYesREQUIRED. App name, path, or bundle ID.

Implementation Reference

  • Core handler function that executes the tool: connects to remote macOS via VNC, simulates Cmd+Space to open Spotlight, types the application identifier, and presses Enter to launch it.
    def handle_remote_macos_open_application(arguments: dict[str, Any]) -> List[types.TextContent]:
        """
        Opens or activates an application on the remote MacOS machine using VNC.
    
        Args:
            arguments: Dictionary containing:
                - identifier: App name, path, or bundle ID
    
        Returns:
            List containing a TextContent with the result
        """
        # Use environment variables
        host = MACOS_HOST
        port = MACOS_PORT
        password = MACOS_PASSWORD
        username = MACOS_USERNAME
        encryption = VNC_ENCRYPTION
    
        identifier = arguments.get("identifier")
        if not identifier:
            raise ValueError("identifier is required")
    
        start_time = time.time()
    
        # Initialize VNC client
        vnc = VNCClient(host=host, port=port, password=password, username=username, encryption=encryption)
    
        # Connect to remote MacOs machine
        success, error_message = vnc.connect()
        if not success:
            error_msg = f"Failed to connect to remote MacOs machine at {host}:{port}. {error_message}"
            return [types.TextContent(type="text", text=error_msg)]
    
        try:
            # Send Command+Space to open Spotlight
            cmd_key = 0xffeb  # Command key
            space_key = 0x20  # Space key
    
            # Press Command+Space
            vnc.send_key_event(cmd_key, True)
            vnc.send_key_event(space_key, True)
    
            # Release Command+Space
            vnc.send_key_event(space_key, False)
            vnc.send_key_event(cmd_key, False)
    
            # Small delay to let Spotlight open
            time.sleep(0.5)
    
            # Type the application name
            vnc.send_text(identifier)
    
            # Small delay to let Spotlight find the app
            time.sleep(0.5)
    
            # Press Enter to launch
            enter_key = 0xff0d
            vnc.send_key_event(enter_key, True)
            vnc.send_key_event(enter_key, False)
    
            end_time = time.time()
            processing_time = round(end_time - start_time, 3)
    
            return [types.TextContent(
                type="text",
                text=f"Launched application: {identifier}\nProcessing time: {processing_time}s"
            )]
    
        finally:
            # Close VNC connection
            vnc.close()
  • Tool schema definition including input schema requiring 'identifier' string.
    types.Tool(
        name="remote_macos_open_application",
        description="Opens/activates an application and returns its PID for further interactions.",
        inputSchema={
            "type": "object",
            "properties": {
                "identifier": {
                    "type": "string",
                    "description": "REQUIRED. App name, path, or bundle ID."
                }
            },
            "required": ["identifier"]
        },
    ),
  • Registration in the tool dispatch handler: maps tool name to the handler function.
    elif name == "remote_macos_open_application":
        return handle_remote_macos_open_application(arguments)
  • Import of the handler function for use in tool registration.
    from action_handlers import (
        handle_remote_macos_get_screen,
        handle_remote_macos_mouse_scroll,
        handle_remote_macos_send_keys,
        handle_remote_macos_mouse_move,
        handle_remote_macos_mouse_click,
        handle_remote_macos_mouse_double_click,
        handle_remote_macos_open_application,
        handle_remote_macos_mouse_drag_n_drop
    )
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions the action ('Opens/activates') and return value ('PID for further interactions'), but lacks critical behavioral details: it doesn't specify if this requires specific permissions, whether it can open multiple instances, error handling, or platform constraints (e.g., macOS-only). For a mutation tool with zero annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action and return value. Every word earns its place with no redundancy or waste, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a remote macOS application-opening tool with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects like permissions, errors, or platform specifics, and lacks output details beyond mentioning PID. For a mutation tool in this context, more information is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the parameter 'identifier' fully documented in the schema as 'App name, path, or bundle ID.' The description adds no additional meaning beyond this, such as examples or constraints. Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Opens/activates') and resource ('an application'), and specifies the return value ('returns its PID for further interactions'). However, it doesn't explicitly differentiate from sibling tools like remote_macos_send_keys, which might also interact with applications. The purpose is specific but lacks sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., remote access to macOS), exclusions, or comparisons to sibling tools like remote_macos_send_keys for application interaction. Usage is implied by the action but not explicitly defined.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/senseisven/mcp_macos'

If you have feedback or need assistance with the MCP directory API, please join our Discord server