All Products
Search
Document Center

AgentBay:Access through MCP

Last Updated:Jun 02, 2026

AgentBay uses Model Context Protocol (MCP) to provide a unified interface between AI models and cloud runtime environments. Through MCP, you can manage sessions, operate on files, run commands, manage applications, and control windows.

Prerequisites

Get an API key

  1. Log on to the AgentBay console.

  2. In the navigation pane on the left, choose Service Management.

  3. On the Service Management page, click Create API Key.

  4. In the Create API Key dialog box, enter a name and click OK.

    Important

    To protect data security, do not share your API key.

Select an image

Set IMAGEID in your MCP URL to match your needs. The URLs below are examples — use the actual code from the console. For more information about how to get your MCP URL, see Get an MCP address.

Select the latest image

A latest image always resolves to the newest version for each environment type.

  • Cloud computer (Windows): windows_latest

  • Cloud computer (Linux): linux_latest

  • Cloud browser: browser_latest

  • Code sandbox: code_latest

  • Cloud phone: mobile_latest

Use a specific image version

Set IMAGEID to a specific OS image version or a custom image.

System image

  1. Log on to the AgentBay console.

  2. In the navigation pane on the left, choose Image Management.

  3. On the Images (Beta) page, click the System Image tab and copy the image ID.

Custom image

  1. Log on to the AgentBay console.

  2. In the navigation pane on the left, choose Image Management.

  3. On the Images (Beta) page, click the Custom Image tab and copy the image ID.

Configure the MCP server

Add the MCP URL to any MCP-compatible tool, such as Cline or Cursor. The steps below use Cursor v0.50.5.

  1. Open Cursor Settings and choose MCP in the left pane.

  2. In the MCP Servers panel, click Add new global MCP server.

  3. Paste the MCP URL code block from Get an MCP address into your mcp.json file and save. Three connection methods are available: SSE, Stdio, and Streamable.

    SSE

    {
      "mcpServers": {
        "wuying_mcp_server": {
          "url": "https://agentbay-intl.wuying.aliyuncs.com/v2/sse?APIKEY=YOUR_API_KEY&IMAGEID=browser_latest"
        }
      }
    }

    Streamable

    {
      "mcpServers": {
        "wuying_mcp_server": {
          "url": "https://agentbay-intl.wuying.aliyuncs.com/v2/mcp?APIKEY=YOUR_API_KEY&IMAGEID=browser_latest"
        }
      }
    }

Try AgentBay

Browse a website with a cloud browser

After you configure AgentBay MCP in your tool, use the agent to run tasks.

Note

In the following example, IMAGEID is set to browser_latest.

  1. Run this instruction to open the Alibaba Cloud website in a cloud browser session.

    Visit the Alibaba Cloud website
  2. Run this instruction to get the sandbox URL and view the task status.

    Return the URL of the Wuying MCP service sandbox environment
    • This URL expires and has limited uses. Open it immediately.

    • Use the URL parameters &input=true&keyboard=true to toggle keyboard and mouse interaction. You can also adjust these settings in real time with the Web SDK.

Next steps

  • Use a custom image: If the default image has network or application issues, use a custom image. For details, see Create an image.

  • MCP tools: To learn which MCP tools are available, see MCP tools overview.