Building and Deploying a 2048 Game with CodeBuddy and EdgeOne Pages Using MCP
This article demonstrates how to use the AI‑powered CodeBuddy tool together with the Model Context Protocol (MCP) to automatically generate a complete 2048 web game in HTML/CSS/JavaScript and deploy it to the public Internet via EdgeOne Pages, including bug fixing and final testing.
Background
AI‑assisted programming has become increasingly powerful, evolving from simple agents and function calling to the Model Context Protocol (MCP), which dramatically lowers the cost of learning and using AI for development.
In this case study we use CodeBuddy + MCP to create a 2048 mini‑game and publish it online without writing a single line of code manually; all interactions are done through conversational prompts.
MCP Introduction
The Model Context Protocol (MCP) acts as a standardized bridge between AI models and various tools or data sources, allowing developers to avoid tedious integration work. It enables AI applications to safely access and manipulate local or remote data, effectively connecting AI to the “internet of things.”
CodeBuddy Integration with EdgeOne Page MCP Server
Connecting MCP
Click the MCP button in the CodeBuddy chat window, then search for “EdgeOne Pages” in the MCP marketplace, install the service, and a JSON configuration file for the EdgeOne Page MCP Server is generated.
Automatic 2048 Game Generation
We ask CodeBuddy:
"Write a 2048 game and deploy it to EdgeOne Pages."
CodeBuddy begins generating the game files.
The overall workflow is:
Task Analysis: The user wants a classic sliding‑tile 2048 game deployed to EdgeOne Pages.
Technology Choice: Implemented with pure HTML, CSS, and JavaScript, requiring no backend.
Implementation Steps: Create an HTML entry file. Add CSS styling. Write JavaScript game logic. Deploy to EdgeOne Pages.
Complexity Assessment: Involves 3‑4 files; moderate difficulty.
Tool Requirements: Create the game files. Use the edgeone-pages-mcp deploy‑html tool to publish.
CodeBuddy shows the generated HTML, JS, and CSS files.
Local inspection reveals the three files.
Automatic Deployment to the Public Internet
CodeBuddy calls the EdgeOne Pages MCP Server, uploads the code, and returns a public URL.
Opening the URL launches the 2048 game.
Bug Fixing
We reported a bug: all tiles appeared in the top‑left corner, making the game unplayable.
"There is a bug; the tiles are stuck in the top‑left corner."
CodeBuddy corrected the issue and redeployed a new site.
The fixed game now works correctly.
Finally, the author promotes their personal website, which hosts more technical content.
Wukong Talks Architecture
Explaining distributed systems and architecture through stories. Author of the "JVM Performance Tuning in Practice" column, open-source author of "Spring Cloud in Practice PassJava", and independently developed a PMP practice quiz mini-program.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.