You can build an AI agent that clicks buttons, fills forms, and navigates real UIs instead of relying on fragile CSS selectors. The Coasty MCP server connects Cursor, Claude Desktop, or any MCP-compatible client to the Coasty computer use API. A developer can start an agent that watches a screen, predicts actions, and drives a browser or desktop just by speaking natural instructions.
How it works
The MCP server exposes a set of tools that map directly to Coasty endpoints. A client (Cursor, Claude Desktop, or another MCP host) calls these tools to run a task. The server handles authentication with an API key and translates the tool call into a Coasty request. Under the hood it talks to the Coasty computer use API. For example, starting a task run uses the POST /v1/runs endpoint with a machine_id, task, cua_version, and optional settings like max_steps or deadline_seconds. The server returns a run_id. You can stream events with GET /v1/runs/{id}/events to track state changes like queued, running, succeeded, or failed. When a run finishes, the MCP tool returns the final status, events, and any output produced by the agent. The MCP server makes this feel like a local function call instead of a raw HTTP request.
import os
import asyncio
from anthropic import Anthropic
COASTY_API_KEY = os.getenv("COASTY_API_KEY")
async def run_coasty_task(task: str):
client = Anthropic(api_key=os.getenv("ANTHROPIC_API_KEY"))
# MCP tool placeholder: run a Coasty task on a cloud machine
# In a real MCP integration, the tool would be provided by the Coasty MCP server.
print(f"Starting Coasty task: {task}")
print("Use the Coasty MCP server to call the computer use API from Cursor or Claude Desktop.")
print("Get your API key at https://coasty.ai/developers")
if __name__ == "__main__":
asyncio.run(run_coasty_task("Open https://example.com, print the title, and close the browser"))Key configuration options
- machine_id: A cloud VM provisioned via POST /v1/machines that the agent drives.
- task: A natural language instruction for the agent to carry out.
- cua_version: Set to v3 for standard agent behavior or v4 for autonomous runs with a pass/fail verifier.
- max_steps: Limits how many agent steps the run can take, each billed $0.05.
- deadline_seconds: A timeout for the entire run.
- on_awaiting_human: Controls behavior when the agent needs human input, pause, fail, or cancel the run.
- webhook_url: Optional URL to receive state changes and results via HMAC-signed webhooks.
The MCP server exposes Coasty tools as local functions so you can call them from Cursor or Claude Desktop without writing raw HTTP code.
Where this beats brittle automation
Traditional automation relies on CSS selectors, XPath, or hardcoded element IDs. Those break when UIs change, layouts shift, or the site uses dynamic rendering. A computer use agent sees the screen just like a human. It captures screenshots, reads visual context, and predicts clicks, scrolls, and keystrokes. That means you do not need to maintain brittle selectors or rewrite scripts for every UI update. You can describe high-level goals in natural language and let the agent figure out the steps. This approach scales to complex workflows like multi-step forms, dynamic dashboards, and browser-based workflows that change frequently.
What to build next
- Create a Cursor extension that chains Coasty task runs to automate local development tasks like running tests or formatting code.
- Build a Claude Desktop plugin that lets you ask "Run this browser workflow" and the MCP server executes it on a real machine.
- Design workflows with POST /v1/workflows to orchestrate multiple tasks, assertions, and parallel steps, then drive them from Cursor or Claude.
- Explore the Coasty machine provisioning API to spin up fresh cloud VMs for each run and keep state isolated between tasks.
Embed a computer use agent into Cursor or Claude Desktop using the Coasty MCP server. Build agents that see screens and act like humans instead of brittle selectors. Get your API key at https://coasty.ai/developers and start automating real UIs today.
Want to see this in action?
View Case Studies