Finish the 3.1.0 secondary disk-tools milestone so stable workspaces can be stopped, inspected offline, exported as raw ext4 images, and started again without changing the primary workspace-first interaction model. Add workspace stop/start plus workspace disk export/list/read across the CLI, SDK, and MCP, backed by a new offline debugfs inspection helper and guest-only validation. Scrub runtime-only guest state before disk inspection/export, and fix the real guest reliability gaps by flushing the filesystem on stop and removing stale Firecracker socket files before restart. Update the docs, examples, changelog, and roadmap to mark 3.1.0 done, and cover the new lifecycle/disk paths with API, CLI, manager, contract, and package-surface tests. Validation: uv lock; UV_CACHE_DIR=.uv-cache make check; UV_CACHE_DIR=.uv-cache make dist-check; real guest-backed smoke for create, shell/service activity, stop, workspace disk list/read/export, start, exec, and delete.
6.2 KiB
Integration Targets
These are the main ways to integrate pyro-mcp into an LLM application.
Use this page after you have already validated the host and guest execution through the CLI path in install.md or first-run.md.
Recommended Default
Use vm_run first for one-shot commands, then move to the stable workspace surface when the
agent needs to inhabit one sandbox across multiple calls.
That keeps the model-facing contract small:
- one tool
- one command
- one ephemeral VM
- automatic cleanup
Move to workspace_* when the agent needs repeated commands, shells, services, snapshots, reset,
diff, or export in one stable workspace across multiple calls.
OpenAI Responses API
Best when:
- your agent already uses OpenAI models directly
- you want a normal tool-calling loop instead of MCP transport
- you want the smallest amount of integration code
Recommended surface:
vm_runworkspace_create(seed_path=...)+workspace_sync_push+workspace_execwhen the agent needs persistent workspace stateworkspace_create(..., secrets=...)+workspace_exec(..., secret_env=...)when the workspace needs private tokens or authenticated setupworkspace_create(..., network_policy="egress+published-ports")+start_service(..., published_ports=[...])when the host must probe one workspace serviceworkspace_diff+workspace_exportwhen the agent needs explicit baseline comparison or host-out file transferstop_workspace(...)+list_workspace_disk(...)/read_workspace_disk(...)/export_workspace_disk(...)when one stopped guest-backed workspace needs offline inspection or a raw ext4 copystart_service/list_services/status_service/logs_service/stop_servicewhen the agent needs long-running processes inside that workspaceopen_shell(..., secret_env=...)/read_shell/write_shellwhen the agent needs an interactive PTY inside that workspace
Canonical example:
MCP Clients
Best when:
- your host application already supports MCP
- you want
pyroto run as an external stdio server - you want tool schemas to be discovered directly from the server
Recommended entrypoint:
pyro mcp serve
Starter config:
- examples/mcp_client_config.md
- examples/claude_desktop_mcp_config.json
- examples/cursor_mcp_config.json
Direct Python SDK
Best when:
- your application owns orchestration itself
- you do not need MCP transport
- you want direct access to
Pyro
Recommended default:
Pyro.run_in_vm(...)Pyro.create_workspace(seed_path=...)+Pyro.push_workspace_sync(...)+Pyro.exec_workspace(...)when repeated workspace commands are requiredPyro.create_workspace(..., secrets=...)+Pyro.exec_workspace(..., secret_env=...)when the workspace needs private tokens or authenticated setupPyro.create_workspace(..., network_policy="egress+published-ports")+Pyro.start_service(..., published_ports=[...])when the host must probe one workspace servicePyro.diff_workspace(...)+Pyro.export_workspace(...)when the agent needs baseline comparison or host-out file transferPyro.start_service(..., secret_env=...)+Pyro.list_services(...)+Pyro.logs_service(...)when the agent needs long-running background processes in one workspacePyro.open_shell(..., secret_env=...)+Pyro.write_shell(...)+Pyro.read_shell(...)when the agent needs an interactive PTY inside the workspace
Lifecycle note:
Pyro.exec_vm(...)runs one command and auto-cleans the VM afterward- use
create_vm(...)+start_vm(...)only when you need pre-exec inspection or status before that final exec - use
create_workspace(seed_path=...)when the agent needs repeated commands in one persistent/workspacethat starts from host content - use
push_workspace_sync(...)when later host-side changes need to be imported into that running workspace without recreating it - use
create_workspace(..., secrets=...)plussecret_envon exec, shell, or service start when the agent needs private tokens or authenticated startup inside that workspace - use
create_workspace(..., network_policy="egress+published-ports")plusstart_service(..., published_ports=[...])when the host must probe one service from that workspace - use
diff_workspace(...)when the agent needs a structured comparison against the immutable create-time baseline - use
export_workspace(...)when the agent needs one file or directory copied back to the host - use
stop_workspace(...)pluslist_workspace_disk(...),read_workspace_disk(...), orexport_workspace_disk(...)when the agent needs offline inspection or one raw ext4 copy from a stopped guest-backed workspace - use
start_service(...)when the agent needs long-running processes and typed readiness inside one workspace - use
open_shell(...)when the agent needs interactive shell state instead of one-shot execs
Examples:
- examples/python_run.py
- examples/python_lifecycle.py
- examples/python_workspace.py
- examples/python_shell.py
Agent Framework Wrappers
Examples:
- LangChain tools
- PydanticAI tools
- custom in-house orchestration layers
Best when:
- you already have an application framework that expects a Python callable tool
- you want to wrap
vm_runbehind framework-specific abstractions
Recommended pattern:
- keep the framework wrapper thin
- map one-shot framework tool input directly onto
vm_run - expose
workspace_*only when the framework truly needs repeated commands in one workspace
Concrete example:
Selection Rule
Choose the narrowest integration that matches the host environment:
- OpenAI Responses API if you want a direct provider tool loop.
- MCP if your host already speaks MCP.
- Python SDK if you own orchestration and do not need transport.
- Framework wrappers only as thin adapters over the same
vm_runcontract.