All Products
Search
Document Center

Edge Security Acceleration:Deploy a game globally in 1 minute with ESA Functions and Pages and MCP

Last Updated:Jun 02, 2026

Deploy a 2048 game to ESA Functions and Pages globally in one minute by using ESA MCP Server with an LLM-powered AI programming tool.

Solution advantages

image

Solution overview

To quickly create and deploy the 2048 game, follow these steps:

  1. Activate ESA Functions and Pages service: ESA Functions and Pages provides a serverless edge runtime with global deployment, ultra-low latency, and automatic scaling.

  2. Configure Cline: Connect your IDE to the LLM through Cline, then use ESA MCP Server to deploy code to ESA points of presence (POPs).

  3. Configure ESA MCP Server:  Model Context Protocol (MCP) is a protocol that enables bidirectional communication between an LLM and external systems, allowing the LLM to access context and call platform APIs for remote operations.

    ESA MCP Server is an open API service that integrates with LLMs. Developers can create, update, and publish Functions and Pages applications through the ESA MCP Server.

  4. Generate and deploy the game code: Use a single prompt to have the LLM generate the game code and deploy it globally through the ESA MCP Server.

Activate ESA Functions and Pages

The service starts in free mode. You can switch to pay-as-you-go on demand. Billing information.
  1. Open the ESA console and go to the Functions and Pages page.

  2. If you are a new user, click Activate Now and follow the on-screen instructions.

Configure Cline

Request an API key

This API key authenticates Cline's calls to Model Studio LLMs. Model Studio offers a free trial for new users. After the trial, standard billing rules for large language model products apply.
  1. Go to the My API-KEY page and click Create My API KEY.

  2. In the Actions column for the API key you created, click View to obtain the API KEY.

    image

Install and configure Cline in VS Code

  1. In VS Code, open Extensions, search for Cline, and install it.

    image

  2. Open the Cline settings page and configure the following required fields. Keep default values for other settings.

    • API Provider: Alibaba Qwen

    • Alibaba API Line: International API

    • Qwen API key: The API key that you obtained in the previous step.

    • Model: Use qwen-max-latest (recommended).

    image

Configure ESA MCP Server

Create an AccessKey pair for a RAM user

The AccessKey pair authenticates ESA MCP Server calls to ESA Functions and Pages.
  1. Go to the RAM console, and create a new RAM user.

  2. Save the AccessKey ID and AccessKey Secret immediately. You cannot retrieve them after closing this page.

    image

Configure RAM account permissions

Grant this RAM user only ESA permissions (least privilege principle).
  1. Find the RAM user you created and click Add Permissions.

    image

  2. On the Permissions tab, click Grant Permission.

  3. In the Select Policy section of the Grant Permission panel, select AliyunESAFullAccess, and then click OK.

    image

Configure ESA MCP Server in Cline

  1. Open the cline_mcp_settings.json file in Cline.

    image

  2. Copy the following configuration into cline_mcp_settings.json. Replace ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET with your actual values, then save the file (Ctrl+S / Command+S).

    {
      "mcpServers": {
        "esa-mcp-server": {
          "command": "npx",
          "args": ["-y", "mcp-server-esa"],
          "env": {
            "ALIBABA_CLOUD_ACCESS_KEY_ID": "your AccessKey ID",
            "ALIBABA_CLOUD_ACCESS_KEY_SECRET": "your AccessKey Secret"
          }
        }
      }
    }

    image

  3. After you save the file, wait 3–5 seconds. The esa-mcp-server service appears with a green status in the Installed list under MCP Server in Cline, confirming that ESA MCP Server is configured.

    image

Generate and deploy the game code

  1. Submit the following prompt to Cline:

    Please help me write a 2048 game and deploy it on an Alibaba Cloud ESA routine, displaying the default access URL provided by ER.

    The LLM calls ESA MCP Server tools to create functions, submit code, and deploy globally, then returns a publicly accessible URL.

  2. After deployment, access the game through the domain provided by ESA. The entire process takes minutes.

    image

Learn more

MCP overview

image

MCP is an open protocol that standardizes how applications provide context to LLMs. Like USB-C for devices, MCP provides a standard way to connect AI models to data sources and tools. Three transport types are available:

  • STDIO

  • SSE

  • Streamable HTTP

This topic uses the STDIO method, where the server runs locally. Remote MCP servers using SSE and Streamable HTTP will be available in the future.

What is Functions and Pages

Functions and Pages is a serverless service provided by the Alibaba Cloud ESA product, an upgraded version of Alibaba Cloud CDN. Write JavaScript (ES6, Node.js/Deno compatible) and deploy it to Alibaba Cloud's global POPs within seconds. ESA Functions and Pages processes requests at the nearest ESA POP. Compared to centralized servers, Functions and Pages significantly reduces latency and improves response speed.

  • Global deployment, proximity-based routing, and ultra-low latency: Unlike common cloud computing services such as Function Compute and elastic computing, Functions and Pages does not require you to deploy your functions to a single, specific region. Functions and Pages runs on globally distributed points of presence (POPs). Client requests are automatically routed to the nearest POP, which triggers the execution of the Functions and Pages code to process the request and return the result to the client. Functions and Pages can significantly reduce the response time for client requests, providing you with a low-latency computing experience.

  • Automatic scaling and pay-as-you-go: Alibaba Cloud has a global network of more than 3,200 edge nodes, which provides inherent elasticity. When client requests in a region surge, they are automatically scheduled to the nearest available edge nodes with sufficient computing resources. This scaling and scheduling process is fully automated. Functions and Pages are billed based on the number of invocations. No charges are incurred when there are no requests.

  • Serverless model: Simple and easy to use: When you use Functions and Pages, you do not need to manage the underlying infrastructure, such as the CPU, memory, network, and operating system of servers. This allows you to focus on developing your business code. You can deploy your application by simply uploading the code through the console or OpenAPI. The serverless development model can effectively reduce your development and O&M costs.