Skip to main content
Glama

spawn_process

Launch programs on mobile or desktop devices for runtime analysis and reverse engineering using Frida's dynamic instrumentation capabilities.

Instructions

Spawn a program.

Returns:
    Information about the spawned process

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
programYesThe program or application identifier to spawn.
argsNoOptional list of arguments for the program.
device_idNoOptional ID of the device where the program should be spawned. Uses smart selection when omitted.

Implementation Reference

  • The implementation of the 'spawn_process' tool. This handler function is decorated with @mcp.tool(), which registers it with the FastMCP server. It resolves the target device, prepares command-line arguments if provided, and uses Frida's device.spawn() method to spawn the process, returning the PID on success.
    @mcp.tool()
    def spawn_process(
        program: str = Field(description="The program or application identifier to spawn."),
        args: Optional[List[str]] = Field(
            default=None, description="Optional list of arguments for the program."
        ),
        device_id: Optional[str] = Field(
            default=None,
            description="Optional ID of the device where the program should be spawned. Uses smart selection when omitted.",
        ),
    ) -> Dict[str, Any]:
        """Spawn a program.
    
        Returns:
            Information about the spawned process
        """
        try:
            device = _resolve_device_or_raise(device_id)
    
            argv = None
            if args:
                argv = list(args)
                if not argv or argv[0] != program:
                    argv.insert(0, program)
    
            pid = device.spawn(program, argv=argv)
    
            return {"pid": pid}
        except Exception as e:
            raise ValueError(f"Failed to spawn {program}: {str(e)}")

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/rmorgans/frida-mcp'

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