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
| Name | Type | Default | Description |
|---|---|---|---|
flowgraph_path | str | - | Path to the .py flowgraph file |
name | str | None | None | Container name (defaults to gr-{stem}) |
xmlrpc_port | int | 0 | XML-RPC port (0 = auto-allocate) |
enable_vnc | bool | False | Enable VNC server for visual debugging |
enable_coverage | bool | False | Enable Python code coverage collection |
enable_controlport | bool | False | Enable ControlPort/Thrift |
controlport_port | int | 9090 | ControlPort port |
enable_perf_counters | bool | True | Enable performance counters |
device_paths | list[str] | None | None | Host device paths to pass through |
image | str | None | None | Docker image to use |
auto_image | bool | False | Auto-detect OOT modules and build image |
Returns
Type: ContainerModel
Container information including name, status, and ports.
Example
# Basic launchcontainer = launch_flowgraph( flowgraph_path="/tmp/fm_receiver.py", name="fm-radio")
# With XML-RPC and VNCcontainer = launch_flowgraph( flowgraph_path="/tmp/fm_receiver.py", name="fm-radio", xmlrpc_port=8080, enable_vnc=True)
# With SDR hardware accesscontainer = launch_flowgraph( flowgraph_path="/tmp/fm_receiver.py", name="fm-hardware", device_paths=["/dev/bus/usb"])
# Auto-detect OOT modulescontainer = 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
| Name | Type | Default | Description |
|---|---|---|---|
name | str | - | Container name |
Returns
Type: bool
True if successful.
Example
stop_flowgraph(name="fm-radio")# Returns: Trueremove_flowgraph
Remove a flowgraph container.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name | str | - | Container name |
force | bool | False | Force remove even if running |
Returns
Type: bool
True if successful.
Example
# Normal removal (must be stopped first)remove_flowgraph(name="fm-radio")
# Force removalremove_flowgraph(name="fm-radio", force=True)capture_screenshot
Capture a screenshot of the flowgraph’s QT GUI.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name | str | None | None | Container 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
| Name | Type | Default | Description |
|---|---|---|---|
name | str | None | None | Container name (uses active if not specified) |
tail | int | 100 | Number 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..."