Skip to content

Docker Tools

Tools for launching and managing flowgraphs in Docker containers.

launch_flowgraph

Launch a flowgraph in a Docker container with Xvfb (headless X11).

Parameters

NameTypeDefaultDescription
flowgraph_pathstr-Path to the .py flowgraph file
namestr | NoneNoneContainer name (defaults to gr-{stem})
xmlrpc_portint0XML-RPC port (0 = auto-allocate)
enable_vncboolFalseEnable VNC server for visual debugging
enable_coverageboolFalseEnable Python code coverage collection
enable_controlportboolFalseEnable ControlPort/Thrift
controlport_portint9090ControlPort port
enable_perf_countersboolTrueEnable performance counters
device_pathslist[str] | NoneNoneHost device paths to pass through
imagestr | NoneNoneDocker image to use
auto_imageboolFalseAuto-detect OOT modules and build image

Returns

Type: ContainerModel

Container information including name, status, and ports.

Example

# Basic launch
container = launch_flowgraph(
flowgraph_path="/tmp/fm_receiver.py",
name="fm-radio"
)
# With XML-RPC and VNC
container = launch_flowgraph(
flowgraph_path="/tmp/fm_receiver.py",
name="fm-radio",
xmlrpc_port=8080,
enable_vnc=True
)
# With SDR hardware access
container = launch_flowgraph(
flowgraph_path="/tmp/fm_receiver.py",
name="fm-hardware",
device_paths=["/dev/bus/usb"]
)
# Auto-detect OOT modules
container = launch_flowgraph(
flowgraph_path="/tmp/lora_rx.py",
auto_image=True
)

list_containers

List all GR-MCP managed containers.

Returns

Type: list[ContainerModel]

List of containers with status and port information.

Example

containers = list_containers()
# Returns: [
# ContainerModel(
# name="fm-radio",
# status="running",
# xmlrpc_port=32768,
# vnc_port=5900,
# ...
# ),
# ...
# ]

stop_flowgraph

Stop a running flowgraph container (graceful shutdown).

Parameters

NameTypeDefaultDescription
namestr-Container name

Returns

Type: bool

True if successful.

Example

stop_flowgraph(name="fm-radio")
# Returns: True

remove_flowgraph

Remove a flowgraph container.

Parameters

NameTypeDefaultDescription
namestr-Container name
forceboolFalseForce remove even if running

Returns

Type: bool

True if successful.

Example

# Normal removal (must be stopped first)
remove_flowgraph(name="fm-radio")
# Force removal
remove_flowgraph(name="fm-radio", force=True)

capture_screenshot

Capture a screenshot of the flowgraph’s QT GUI.

Parameters

NameTypeDefaultDescription
namestr | NoneNoneContainer name (uses active if not specified)

Returns

Type: ScreenshotModel

Screenshot information with path and dimensions.

Example

screenshot = capture_screenshot(name="fm-radio")
# Returns: ScreenshotModel(
# path="/tmp/gr-mcp-screenshots/fm-radio-2024-01-15-14-30-00.png",
# width=1024,
# height=768
# )

get_container_logs

Get logs from a flowgraph container.

Parameters

NameTypeDefaultDescription
namestr | NoneNoneContainer name (uses active if not specified)
tailint100Number of lines to return

Returns

Type: str

Container stdout/stderr output.

Example

logs = get_container_logs(name="fm-radio", tail=50)
# Returns: "Using Volk machine: avx2_64_mmx\nStarting flowgraph...\n..."