All Products
Search
Document Center

Edge Security Acceleration:From Zero to Global Deployment: Launch a Game in One Minute with Edge Routine + MCP Server

Last Updated:Sep 15, 2025

Deploy the 2048 game globally in one minute using ESA Edge Routine, ESA MCP Server, a large model, and an AI programming tool. A single sentence and a simple configuration are all you need.

Solution advantages

image

Solution overview

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

  1. Activate the ESA Edge Routine service: This provides a runtime environment for the game. ESA Edge Routine offers global deployment, ultra-low latency, automatic scaling, and a serverless architecture.

  2. Configure the Cline AI programming tool: Use Cline to establish an efficient connection between your IDE and the large model. A single instruction generates and debugs code. Cline also calls ESA MCP Server to deploy the code to ESA edge nodes.

  3. Configure ESA MCP Server: MCP (Model Context Protocol) is a standard protocol that establishes bidirectional communication between large models and external systems. With MCP, large models can retrieve context information, such as user identity and device status. They can also call platform APIs to perform remote operations, such as reading and writing data or controlling devices. This helps them respond more accurately to user instructions and needs.

    ESA MCP Server is a standard, open API service provided by ESA that integrates with large models. Developers can use a large model-driven approach to trigger Edge Routine operations, such as creation, updates, and publishing, through ESA MCP Server. This enables the intelligent management of edge computing tasks.

  4. Generate and deploy the game code: After you complete the preceding steps, you can use a single sentence to have the large model automatically generate code. The code is then deployed globally to edge nodes through ESA MCP Server.

Activate the ESA Edge Routine service

When you first activate the service, it runs in free mode by default. You can switch to the pay-as-you-go billing method as needed. For more information, see Edge Routine billing.
  1. Open the ESA console and navigate to the Edge Routine page.

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

Configure the Cline AI programming tool

Request an API key

The API key requested here is used for authentication when Cline calls the Alibaba Cloud Model Studio large model. You can first use the free quota for new users provided by Model Studio. After the free quota is used, you are charged based on the billing rules for large model products.
  1. Go to the My API-KEY page and click Create My API-KEY.

  2. In the Operation 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 Extensions, search for and install Cline.

    image

  2. Open the Cline settings page to configure the API information for the large model. The following four items are required. You can keep the default values for the other items.

    • API Provider: Alibaba Qwen

    • Alibaba API Line: International API

    • Qwen API Key: The API key you requested in the previous step.

    • Model: Use qwen-max-latest.

    image

Configure ESA MCP Server

Request an AccessKey pair for a RAM account

The AccessKey pair requested here is used for authentication when ESA MCP Server calls ESA Edge Routine.
  1. Go to the RAM console and create a new RAM user.

  2. After the user is created, immediately save the AccessKey ID and AccessKey Secret. You cannot retrieve them after you close the page.

    image

Configure permissions for the RAM account

Based on the principle of least privilege for RAM users, grant only the necessary ESA operation permissions to this account.
  1. Find the user that you created in the previous step and click Add Permissions.

    image

  2. On the Permission Management tab, click Grant Permission.

  3. In the Select Policy section, select AliyunESAFullAccess and 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 code into the cline_mcp_settings.json file. Replace the values of ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET with the AccessKey ID and AccessKey Secret that you obtained in the previous step. Then, use the keyboard shortcut Ctrl+S (Windows/Linux) or Command+S (Mac) to save the configuration.

    {
      "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 saving, wait for 3 to 5 seconds. The esa-mcp-server service appears in the Installed list of MCP Server in Cline and shows a green enabled status. This indicates that ESA MCP Server is configured successfully.

    image

Generate and deploy the game code

  1. After everything is ready, send your request to Cline:

    Write a 2048 game, deploy it on an Alibaba Cloud ESA routine, and show the default access URL provided by ER.

    The large model calls the tools provided by ESA MCP Server based on your request. These tools create the function, submit the code, and deploy it globally. Finally, a publicly accessible URL is returned.

    image.png

    image.png

  2. After the 2048 game is generated and deployed, you can access the game page using the domain name provided by ESA. The entire process, from sending the request to the AI to accessing the game on the public network, can be completed in minutes.

    image

Further reading

What is MCP?

image

MCP is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). Think of MCP as the USB-C port for AI applications. Just as USB-C provides a standard way to connect your devices to various peripherals and accessories, MCP provides a standard way to connect AI models to different data sources and tools. There are currently three types of MCP:

  • STDIO

  • SSE

  • Streamable HTTP

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

What is Edge Routine (ER)?

Edge Routine (ER) is a serverless service from Alibaba Cloud ESA, which is an upgraded version of Alibaba Cloud Content Delivery Network (CDN). ER lets you write JavaScript code and deploy it to Alibaba Cloud's global edge nodes in seconds. The code runs on these nodes. ER supports ES6 syntax and is compatible with the Node.js and Deno ecosystems. When you deploy your application on ESA Edge Routine, user requests are handled at the nearest ESA point of presence (POP). This reduces latency and improves response speed compared to centralized servers.

  • Global deployment, near-site scheduling, and ultra-low latency: Compared with common cloud computing services, such as Function Compute and Elastic Compute Service (ECS), Edge Routine does not need to be deployed in a specific region. Edge Routine runs on POPs around the globe. Client requests are automatically scheduled to the nearest POPs, which immediately run your code and process client requests. Edge Routine can significantly reduce the server response time, which helps you deliver low-latency services to your users.

  • Automatic scale-out and pay-as-you-go billing: Alibaba Cloud has constructed an edge network that consists of more than 3,200 POPs around the world. These POPs provide unparalleled scalability. If the number of client requests in a region surges, these requests are automatically redirected to the nearest POPs that have sufficient computing resources. You are charged for Edge Routine based on the number of calls that are made to the service.

  • Easy-to-use serverless environment: Edge Routine allows you to focus on your business logic without having to manage underlying resources, such as the CPU, memory, network, and operating system. You can upload your code by using the console or API to deploy applications. Serverless development can effectively cut your development and O&M costs.