CLI & MCP

CLI or MCP: which to use

Two ways into the same platform, with the same API key and the same scopes. Pick the one your client can run.

  • The CLI (miosa) is for humans, scripts and agents with a shell. You type commands, read text or JSON, and branch on exit codes.
  • MCP gives AI clients (Claude Code, Codex, Cursor, Claude Desktop) the same capabilities as tools. The model calls tools by name instead of running shell commands.

Both use the same API key and the same scopes. A key that can create a sandbox from the CLI can create one over MCP, and the reverse. The only difference is the surface.

Which should an agent use?

  • Has a shell? Use the CLI. Claude Code, Codex, Cursor’s terminal and any CI job can run miosa. The CLI is often the better choice: it reaches the whole platform, not just one tool surface; output is scriptable; and it composes with jq, pipes and files.
  • No shell? Use MCP. Claude Desktop chat and other hosted chat products have no shell, so tools are the only path. MCP lets the model call capabilities by name.

Nothing is lost either way, because the key, the scopes and the resources are identical.

Comparison

CLIMCP
Who drives itA person, a script, or an agent with a shellAn AI client without a shell (Claude Desktop), or one that prefers tools
Interfacemiosa <command> [flags]JSON-RPC tools over Streamable HTTP or stdio
Installnpm, Homebrew, install script, ReleasesHosted endpoint, no install, or pip install miosa-mcp
OutputText or JSON, with exit codesStructured tool results and images
CoverageThe whole platform, plus miosa api for any endpointThe MCP tool surface
Best forAgents with shell access, build loops, CI, one-off operationsClients without a shell
Authmsk_u_* key or a profilemsk_u_* key as a Bearer token
Scope modelSame key scopesSame key scopes

Use both

A common split: an agent with a shell drives the platform with the CLI, and a client without a shell reaches the same account over MCP with the same key.

ID=$(miosa create agent-box --size small --wait --json | jq -r .id)   # CLI, from a shell agent
miosa exec "$ID" -- npm test
# the same account over MCP: sandbox_exec(sandbox_id=ID, command="npm run build")
miosa list --json | jq -r '.data[].name'                              # CLI, read back
Was this page helpful?