On this page

MCP server

The MIOSA MCP (Model Context Protocol) server exposes 145 tools that let AI coding assistants create sandboxes, run commands, write files, take computer screenshots, manage deployments, storage, databases, and more - all without leaving the editor. The server speaks the MCP transport protocol, so any compliant client can drive it.


Two ways to use MCP

Point any MCP-compatible client directly at the MIOSA API. No pip, no npm, nothing to install or run locally.

https://api.miosa.ai/api/v1/mcp

This is the easiest path. Your API key travels in the Authorization header; the hosted endpoint is always up-to-date with the latest tool catalog.

Local server

Run the MCP server process on your machine. Useful when you need offline access, custom MIOSA_API_URL overrides, or want to inspect traffic.

# Python
pip install git+https://github.com/Miosa-osa/miosa-mcp.git
miosa-mcp

# TypeScript (no install)
npx @miosa/cli mcp serve

How it works

The MCP server is a thin stateless proxy. Your API key travels with every request; the server never stores credentials.

When a client sends initialize, the server returns an instructions field containing a workflow guide - a compact description of MIOSA resource types, lifecycle conventions, and recommended tool patterns. MCP-aware clients like Claude Code surface this to the model at session start, so the agent understands the platform without requiring extra prompting.


Configuration

Claude Code

Add to ~/.claude/mcp.json:

Cursor

Open Cursor → Settings → MCP and add:

Windsurf

In ~/.codeium/windsurf/mcp_config.json:

Reload Windsurf. Tools are available in the Cascade panel.

Environment variable reference (local server only)

VariableRequiredDefaultDescription
MIOSA_API_KEYYes-Your msk_u_... key
MIOSA_API_URLNohttps://api.miosa.aiOverride for self-hosted or staging
MIOSA_DEFAULT_TEMPLATENomiosa-sandboxTemplate used when sandbox_create omits template
MIOSA_TIMEOUT_MSNo30000Per-request HTTP timeout in milliseconds
MIOSA_LOG_LEVELNowarndebug, info, warn, error

Tool catalog (145 tools)

Computer lifecycle (8 tools)

ToolDescription
computer_createBoot a Linux desktop VM. Accepts template, size, name.
computer_listList computers. Filterable by workspace_id, status.
computer_getGet computer status, IP, template, region.
computer_updateUpdate computer name or configuration.
computer_destroyPermanently delete a computer.
computer_startStart a stopped computer.
computer_stopStop a running computer.
computer_restartRestart a running computer.

Desktop control (30 tools)

ToolDescription
desktop_screenshotTake a full-screen screenshot. Returns base64 PNG.
desktop_clickLeft-click at coordinates.
desktop_right_clickRight-click at coordinates.
desktop_double_clickDouble-click at coordinates.
desktop_typeType text (Unicode supported).
desktop_keySend a key or chord, e.g. ctrl+c.
desktop_hotkeySend a multi-key hotkey.
desktop_key_downHold a key down.
desktop_key_upRelease a held key.
desktop_scrollScroll at a position: direction, amount.
desktop_dragClick-drag from start to end coordinates.
desktop_move_cursorMove the mouse cursor without clicking.
desktop_mouse_downPress and hold a mouse button.
desktop_mouse_upRelease a mouse button.
desktop_waitPause execution for N seconds.
desktop_list_windowsList open windows with IDs, titles, positions.
desktop_launchOpen a named application.
desktop_focus_windowBring a window to the front.
desktop_set_window_sizeResize a window to specific dimensions.
desktop_set_window_positionMove a window to specific coordinates.
desktop_maximize_windowMaximize a window.
desktop_minimize_windowMinimize a window to the taskbar.
desktop_close_windowClose a window by ID.
desktop_get_screen_sizeGet display dimensions.
desktop_get_cursor_positionGet current cursor position.
desktop_get_clipboardRead clipboard contents.
desktop_set_clipboardWrite text to clipboard.
desktop_get_desktop_envGet display, session type, user, desktop environment.
desktop_set_wallpaperSet desktop wallpaper from a URL (white-label branding).
desktop_accessibility_treeGet the AT-SPI accessibility tree for element detection.

File I/O (9 tools)

ToolDescription
file_bashRun a shell command on a computer or sandbox. Returns stdout, stderr, exit_code.
file_writeWrite a file at an absolute path. Creates parent directories.
file_readRead a file. Returns content as string.
file_listList directory contents. Accepts recursive flag.
file_statGet file metadata (size, permissions, mtime).
file_mkdirCreate a directory.
file_renameRename or move a file.
file_copyCopy a file.
file_deleteDelete a file or directory.

Checkpoints (4 tools)

ToolDescription
checkpoint_createSnapshot the current computer or sandbox state.
checkpoint_listList checkpoints for a resource.
checkpoint_restoreRestore to a named checkpoint.
checkpoint_deleteDelete a checkpoint.

Services (7 tools)

ToolDescription
service_createCreate a long-running service on a computer.
service_listList services attached to a computer.
service_startStart a stopped service.
service_stopStop a running service.
service_restartRestart a service.
service_logsStream log output for a service.
service_deleteDelete a service.

Env / Logs / Domains (7 tools)

ToolDescription
env_listList environment variables for a computer or sandbox.
env_setCreate or update an environment variable.
env_deleteDelete an environment variable.
logs_tailStream recent log lines for a computer, sandbox, or deployment.
domain_addAttach a custom domain to a deployment or computer.
domain_listList domains attached to a resource.
domain_deleteRemove a custom domain.

Sandbox (20 tools)

ToolDescription
sandbox_createBoot a new sandbox. Accepts template, external_workspace_id, external_project_id.
sandbox_listList sandboxes. Filterable by external_workspace_id, status.
sandbox_getGet sandbox status, IP, template, created_at.
sandbox_execRun a shell command. Returns stdout, stderr, exit_code.
sandbox_destroyPermanently destroy a sandbox and release compute.
sandbox_pausePause a running sandbox (VM paused, not destroyed).
sandbox_resumeResume a paused sandbox from its last state.
sandbox_pythonExecute a Python snippet directly in the sandbox.
sandbox_write_fileWrite a file scoped to sandbox paths.
sandbox_read_fileRead a file scoped to sandbox paths.
sandbox_list_filesList sandbox directory contents.
sandbox_uploadUpload a local file into the sandbox.
sandbox_snapshot_createSnapshot the current sandbox state.
sandbox_snapshot_listList snapshots for the sandbox.
sandbox_snapshot_restoreRestore a sandbox to a named snapshot.
sandbox_logsStream sandbox log output.
sandbox_exposeExpose a sandbox port as a public HTTPS URL.
sandbox_deployDeploy sandbox output to a permanent URL.
sandbox_template_listList available sandbox templates.
sandbox_template_createCreate a custom sandbox template.

Deployments (11 tools)

ToolDescription
deployment_listList all deployments. Filterable by status, name.
deployment_getGet deployment status and configuration.
deployment_createCreate a new deployment.
deployment_deleteDelete a deployment.
deployment_publishPublish from a sandbox source to production.
deployment_rollbackRoll back to a previous version.
deployment_env_listList environment variables for a deployment.
deployment_env_setSet an environment variable on a deployment.
deployment_logsStream deployment logs.
deployment_version_listList versions for a deployment.
deployment_version_promotePromote a version to active.

Storage (8 tools)

ToolDescription
storage_bucket_listList all buckets.
storage_bucket_createCreate an object storage bucket.
storage_bucket_deleteDelete a bucket.
storage_object_listList objects in a bucket, with optional prefix.
storage_object_uploadUpload an object to a bucket.
storage_object_downloadDownload an object from a bucket.
storage_object_deleteDelete an object.
storage_presignGenerate a time-limited signed URL.

Databases (6 tools)

ToolDescription
database_listList all databases.
database_createProvision a managed Postgres instance.
database_getGet database status and connection details.
database_deleteDelete a database.
database_credentialsRetrieve the connection string.
database_logsStream database log output.

Workspaces (6 tools)

ToolDescription
workspace_listList all workspaces. Filterable by status, name.
workspace_createCreate a workspace for tenant isolation.
workspace_getGet workspace details.
workspace_updateRename or reconfigure a workspace.
workspace_statsGet resource counts for a workspace.
workspace_usageGet compute usage stats for a workspace.

Cron (6 tools)

ToolDescription
cron_listList all cron jobs.
cron_createCreate a scheduled cron job.
cron_deleteDelete a cron job.
cron_pausePause a cron job without deleting it.
cron_resumeResume a paused cron job.
cron_run_nowTrigger a cron job immediately.

Volumes (5 tools)

ToolDescription
volume_listList all volumes.
volume_createCreate a persistent volume.
volume_deleteDelete a volume.
volume_attachAttach a volume to a computer or sandbox.
volume_detachDetach a volume.

Webhooks (4 tools)

ToolDescription
webhook_listList all webhooks.
webhook_createCreate a webhook for an event type.
webhook_deleteDelete a webhook.
webhook_testSend a test payload to a webhook endpoint.

Functions (4 tools)

ToolDescription
function_listList serverless functions.
function_createDeploy a serverless function.
function_invokeInvoke a function immediately. Returns "Function deployment is not yet supported via MCP" if no function is deployed.
function_deleteDelete a function.

API Keys (3 tools)

ToolDescription
api_key_listList API keys for the workspace.
api_key_createCreate a new API key with optional scopes.
api_key_deleteRevoke an API key.

Network (3 tools)

ToolDescription
network_policy_getGet the current network policy for a resource.
network_policy_setUpdate the network policy (allowlists, egress rules).
network_policy_resetReset network policy to defaults.

Ports (3 tools)

ToolDescription
port_exposeExpose a port on a computer or sandbox as a public HTTPS URL.
port_listList exposed ports for a resource.
port_preview_urlGet the public preview URL for an exposed port.

Billing (2 tools)

ToolDescription
billing_usageGet compute usage for a time window.
billing_planGet current plan details and limits.

Regions (1 tool)

ToolDescription
region_listList available regions and their availability.

Settings (4 tools)

ToolDescription
settings_getGet workspace settings.
settings_get_brandingGet branding configuration (logo, colors, domain).
settings_update_brandingUpdate branding configuration.
settings_compute_pricingGet compute pricing for the current plan.

Usage examples

Create a computer and take a screenshot

You: Create a Linux desktop and take a screenshot of whatever is on screen.

The assistant calls computer_create({ template: "miosa-desktop", size: "small" }), waits for it to boot, calls desktop_screenshot(), and describes what it sees. It can then call desktop_click, desktop_type, and desktop_launch to interact.


Deploy a sandbox to production

You: Build the Next.js app in the sandbox and deploy it to a permanent URL.

The assistant calls sandbox_exec({ command: "npm run build" }), confirms exit_code: 0, then calls deployment_publish({ sourceSandboxId: "sbx_...", kind: "static", outputPath: "/workspace/.next/out" }) and returns the live URL.


Set up a cron job

You: Create a cron job that runs a health check script every 5 minutes.

The assistant calls cron_create({ schedule: "*/5 * * * *", command: "bash /workspace/health-check.sh", sandboxId: "sbx_..." }). To trigger it immediately for a smoke test, it calls cron_run_now({ id: "cron_..." }).


Create a database and get credentials

You: Provision a Postgres database and give me the connection string for my app.

The assistant calls database_create({ name: "my-app-db", region: "us-east" }), polls database_get until status is running, then calls database_credentials({ id: "db_..." }) and returns the connection string. It can also call deployment_env_set to inject DATABASE_URL directly into a deployment.


Troubleshooting

401 Unauthorized on hosted MCP - Confirm the Authorization header value starts with Bearer msk_u_ (not just the key alone). Check that the key is active under Dashboard → Settings → API Keys.

MIOSA_API_KEY is not set (local server) - The env var is missing from your MCP config. Confirm the env block is present in your client’s MCP JSON and that the key starts with msk_u_.

Tool calls timeout - Sandbox boots take 2-8 s on first call. Increase MIOSA_TIMEOUT_MS if your client has a short MCP timeout. Claude Code default is 30 s; Cursor default is 10 s.

403 Forbidden - Your key is valid but lacks the required scope. Check API Keys to confirm the key has the scopes needed for the tools you’re calling.

No tools appear in Cursor - Cursor requires the MCP config to be valid JSON. Run node -e "JSON.parse(require('fs').readFileSync('cursor-mcp.json','utf8'))" to validate.


Security considerations

  • Store MIOSA_API_KEY in your client’s secret store, not in a .env file committed to git.
  • Use a scoped key for MCP: grant only the scopes your workflow needs. Never use an admin key for editor integrations.
  • The hosted MCP endpoint and local MCP server both make outbound HTTPS requests only. Neither opens inbound ports.
  • Resources created through MCP are subject to the same tenant-scoped authorization as direct API calls. The MCP server cannot access another tenant’s resources.

See also

AI agent integration

Drive sandboxes and computers from your own agent loop - outside an editor.

Agent guide →

SDK reference

Full Python and TypeScript SDK method signatures.

SDK reference →

Was this helpful?