All Products
Search
Document Center

AgentBay:Connect using MCP

Last Updated:Mar 14, 2026

The AgentBay platform uses the open standard Model Context Protocol (MCP) to provide a unified interface between AI models and runtime environments. It integrates deeply with cloud environments, enabling direct access to cloud features through MCP, such as session management, file operations, command execution, application management, and window control.

Prerequisites

Get an API key

  1. Log on to the AgentBay console.

  2. In the navigation pane on the left, click 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 the IMAGEID field in your MCP URL to the image that matches your business needs. The MCP URLs shown below are code examples only. Use the actual code from the console. For more information about how to obtain your MCP URL, see Get your MCP URL.

Select the latest image

When you configure your environment to use the latest image, it always uses the latest image for that environment.

  • Cloud desktop (Windows): windows_latest

  • Cloud desktop (Linux): linux_latest

  • Cloud browser: browser_latest

  • Code sandbox: code_latest

  • Cloud phone: mobile_latest

Select a specific version image

Set the IMAGEID field to a specific version of an OS image or a custom image.

OS images

  1. Log on to the AgentBay console.

  2. In the navigation pane on the left, click Image Management (Beta).

  3. In Image Management (Beta), click the OS Images tab. Then copy the image ID from the image list.

Custom images

  1. Log on to the AgentBay console.

  2. In the navigation pane on the left, click Image Management (Beta).

  3. In Image Management (Beta), click the Custom Images tab. Then copy the image ID from the image list.

Configure the MCP server

Add your MCP URL to any tool that supports MCP, such as Cline or Cursor. The steps below use Cursor v0.50.5.

  1. Open the Cursor Settings panel. In the navigation pane on the left, click MCP.

  2. In the MCP Servers panel, click Add new global MCP server in the top-right corner.

  3. Paste the MCP URL code block from Get your MCP URL into your mcp.json file. Save the file to complete the configuration. Three connection methods are supported: SSE, Stdio, and Streamable. Choose the one that fits your project needs.

    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

Use the cloud browser image to visit the Alibaba Cloud website

After you configure the AgentBay MCP in a tool that supports MCP, you can interact with the tool’s agent to run tasks on AgentBay MCP.

Note

The examples below use IMAGEID set to browser_latest.

  1. Run this command. The agent opens the Alibaba Cloud website in a cloud browser session.

    Visit the Alibaba Cloud website
  2. Run this command to retrieve the sandbox environment URL. Use the URL to view the task status.

    Return the URL of the Wuying MCP service sandbox environment
    • This URL expires and has a limit on how many times it can be opened. Use it immediately.

    • You can use the URL parameters &input=true&keyboard=true to enable or disable keyboard and mouse interaction. You can also change these settings in real time using the Web SDK. For details, see Web SDK.

What to do next

  • Use a custom image: If you encounter issues such as poor network performance or missing applications in the default image, use a custom image. For details, see Create an image.

  • Learn about MCP tools: To learn which MCP tools are supported and how to use them, see MCP tools summary.