MagicMtn Docs • Provider Registry • Contributing • Cloud service
Distributed inference and sandboxed compute platform for agents. The open-source edition of MagicMtn Cloud that runs on your own infrastructure.
- Inference — Run agent workloads with models from providers such as Amazon Bedrock, SageMaker, and Ollama.
- Sandboxed compute — Run agent commands in isolated environments, from Apple Container on a Mac to microVMs on Linux or AWS.
- CLI — Use
magicto manage sandboxes, execute commands, and install providers. - Provider SDK — Build and package your own inference or compute providers in Rust.
- Agent integrations — Connect Pi and OpenCode to MagicMtn workspaces, or expose sandbox tools to other MCP clients.
cli-pi-demo.mp4
Launch a cloud agent from Pi, disconnect while it keeps running, then SSH into the machine MagicMtn provisioned.
Run the installer on macOS or Linux.
curl -fsSL https://magicmtn.ai/install.sh | shThe shell installer counts completed installs. To opt out, run curl -fsSL https://magicmtn.ai/install.sh | MAGIC_NO_INSTALL_ANALYTICS=1 sh.
On macOS, you can also use Homebrew.
brew install useMagicMtn/tap/magicSee the CLI installation guide for more options.
Install Apple Container.
Start Apple Container and install the MagicMtn provider:
container system start
magic provider install apple-containerIf you previously signed in to MagicMtn Cloud, run magic logout. Start the local server in its own terminal and keep it open:
magic server startIn another terminal, prepare the bundled Canonical image, create a sandbox, run a command, and delete the sandbox:
magic images prepare canonical --provider apple-container
sandbox_id=$(magic computer new --image canonical --provider apple-container)
magic computer exec "$sandbox_id" -- /bin/echo "hello from the sandbox"
magic computer terminate "$sandbox_id" --yesThe command result includes hello from the sandbox. Run magic server stop when finished. See the local server guide for custom images, configuration, and cleanup.
Use Modal for inference while Pi works inside a MagicMtn Canonical 1 VM on your Apple silicon Mac. MagicMtn manages Pi, the inference connection, and the sandbox lifecycle.
Install the Modal provider and the Apple Container provider from the MagicMtn Registry:
magic provider install modal
magic provider install apple-containerCreate a Modal workspace API token with access to manage endpoints and Proxy Tokens. Save it as modal-credentials.json:
{
"MODAL_TOKEN_ID": "YOUR_TOKEN_ID",
"MODAL_TOKEN_SECRET": "YOUR_TOKEN_SECRET"
}Start the local server in its own terminal and keep it open:
magic server startIn another terminal, configure Modal:
magic provider configure modal --secret-file ./modal-credentials.jsonThis establishes access to your Modal account. Model selection determines which inference resource MagicMtn provisions; the provider manages its endpoint and credentials.
Install Apple Container on your Apple silicon Mac, start its runtime, and make the Canonical image available to it:
container system start
magic images prepare canonical --provider apple-containerInstall Pi, then install the MagicMtn Pi integration and open Pi:
magic agents install pi
piIn Pi, run /magic default and select Kimi K3 with Modal as the inference provider. Run /magic new and choose Apple Container as the sandbox backend.
MagicMtn starts Pi inside the local VM and routes its model requests to your Modal endpoint.
Example: Ask Pi to work in its isolated workspace:
Create a Python script in /computer that prints the first 20 Fibonacci numbers, run it, and show me the output.
Press Ctrl+] to disconnect while Pi keeps running. Use /magic view and choose Resume to reconnect, or Terminate to delete the workspace when finished.
Run the same Pi workflow inside a sandbox in your own Modal account.
Reuse the configured Modal connection and selected model, and make the Canonical image available to Modal:
magic images prepare canonical --provider modal
piKeep the same model in /magic default. Run /magic new and choose Modal as the sandbox backend. MagicMtn runs Pi in the Modal sandbox and sends inference requests to the same model endpoint.
Use the same prompt, Ctrl+] to disconnect, and /magic view to resume or terminate the workspace. After terminating your workspaces, run magic server stop to stop the local server.
See the Modal provider setup guide for account and endpoint configuration.
Start the server with magic server start, then open http://localhost:1900 to view your computers and images, configure templates, and browse the MCP Catalog. Sign in as magic with the dashboard password printed in the terminal.
See the Web UI guide for a tour.
Sign up for MagicMtn Cloud, our managed platform for inference and cloud computers for agents.
Install the its Pi extension, and open Pi.
magic login
magic agents install pi
piIn Pi, run /magic new to start a managed workspace. Press Ctrl+] to disconnect while Pi keeps running, then use /magic view and choose Resume to rejoin. Pi setup guide
For OpenCode 2.3.2 or later, sign in with magic login, then run magic agents install opencode. Hosted and local modes have separate credentials.
CLI error reporting is opt-in.
Install Rust 1.100.0 or later and a C/C++ build toolchain (Xcode Command Line Tools on macOS, or GCC and Make on Linux). Download and extract the source archive, then run these commands from the extracted repository root:
cargo install --path cli --locked --bin magic
magic --versionCargo installs magic in ~/.cargo/bin; add that directory to your PATH. To build a provider in a separate project, start with the provider SDK example.
See CONTRIBUTING.md to build and test the engine and SDK. Read the security model for sandbox boundaries and provider trust. Send vulnerability reports through the private channel in SECURITY.md.
MagicMtn is licensed under the Apache License 2.0.
Footnotes
-
MagicMtn Canonical is the default machine/sandbox image. ↩