Drive Coasty from Cursor and Claude with the MCP server
You want to drive Coasty agents from Cursor or Claude Desktop, not from a separate script. The Coasty MCP server exposes the full Computer Use API so you can create task runs, submit workflows, and manage machines entirely inside your IDE or chat. This turns your existing workflow into a single, unified session.
What is the MCP server
The Coasty MCP server is a Model Context Protocol implementation that connects Cursor, Claude Desktop, or any MCP client to the Coasty Computer Use API. It exposes tools that mirror the public endpoints: POST /v1/runs, POST /v1/workflows, and POST /v1/machines. You call these tools from your editor or chat context, and Coasty executes the request on your behalf. No manual curl or HTTP boilerplate. The server handles authentication with the X-API-Key header and tracks your prepaid wallet balance.
How it works
From an MCP client you request a tool like `create_task_run`. The server constructs a POST to /v1/runs with the fields you specify. For example, you provide a `machine_id`, a `task` string, the `cua_version` (e.g. v3 or v4), and optional `instructions` or `system_prompt`. You can set `max_steps`, a `deadline_seconds`, and `on_awaiting_human` to decide what to do when the agent asks for help. The server returns a run ID and initial state. You can poll GET /v1/runs/{id} or stream events with GET /v1/runs/{id}/events. Pricing applies per agent step at $0.05. Use a webhook_url for async callbacks if you prefer.
import os
import json
import httpx
COASTY_API_KEY = os.getenv("COASTY_API_KEY")
BASE_URL = "https://coasty.ai/v1"
client = httpx.Client(timeout=30.0)
# Create a task run via the MCP server abstraction
def create_task_run(machine_id, task, cua_version="v3", instructions=None, max_steps=100, deadline_seconds=600, on_awaiting_human="pause"):
payload = {
"machine_id": machine_id,
"task": task,
"cua_version": cua_version,
"max_steps": max_steps,
"deadline_seconds": deadline_seconds,
"on_awaiting_human": on_awaiting_human,
}
if instructions:
payload["instructions"] = instructions
headers = {"X-API-Key": COASTY_API_KEY}
resp = client.post(f"{BASE_URL}/runs", json=payload, headers=headers)
resp.raise_for_status()
return resp.json()
# Example: start a simple web task
def main():
run = create_task_run(
machine_id="my-cloud-vm-123",
task="Open Chrome, navigate to cozy ai, and print the page title",
cua_version="v3",
max_steps=100,
deadline_seconds=300,
on_awaiting_human="pause"
)
print("Run ID:", run["id"])
print("State:", run["state"])
if __name__ == "__main__":
main()Manage workflows from your IDE
You can also submit workflows directly from the MCP client. Use POST /v1/workflows to define a versioned JSON DSL with steps such as task, assert, if, loop, parallel, human_approval, retry, succeed, and fail. Each task step costs $0.05 per agent step. The DSL supports variables like {{inputs.x}} and stepId.field. Set hard guards such as budget_cents, max_iterations, and deadline_seconds. The MCP server marshals this JSON payload, so you stay in the editor without jumping to a separate configuration file.
Provision machines and control sessions
Use POST /v1/machines to spin up a cloud VM. The agent drives real desktops, browsers, and terminals, not just API calls. Once provisioned, you can start, stop, and snapshot the machine. From the MCP client you reference machine_id when creating runs. This keeps your automation grounded in a real environment instead of mocking or brittle selectors.
Where this beats brittle automation
Traditional automation relies on stable selectors, XPath, or API-only wrappers that break when UI changes. The computer use API lets the agent see the screen, interpret instructions, and act like a human. It handles layout shifts, dynamic content, and mixed environments automatically. With the MCP server you keep this advantage inside Cursor or Claude, so you can prototype, iterate, and ship faster without rewriting tooling.
Use the Coasty MCP server to run full Computer Use agents from Cursor or Claude Desktop, manage task runs, workflows, and machines without leaving your IDE.
Start building with the MCP server today. Create a Coasty API key at https://coasty.ai/developers and connect it to Cursor or Claude Desktop. From there you can drive desktop automation directly from your preferred editor.