By integrating the Alibaba Cloud DevOps MCP Server with Tongyi Lingma, R&D teams can automate the end-to-end workflow, from parsing work item content to automatically generating code. This topic describes how to use the Alibaba Cloud DevOps MCP Server to generate code based on a work item, create a branch, commit the code, and submit a merge request. For information about how the Alibaba Cloud DevOps MCP Server works with other large language models, see https://github.com/aliyun/alibabacloud-devops-mcp-server.
MCP FAQ
Alibaba Cloud DevOps MCP Server DingTalk group: 134400004101
Prerequisites
- You have created a Standard Edition organization.
- You have installed Tongyi Lingma in your IDE.
- You have configured an SSH key so that your local host can run push/pull operations on the Codeup-Demo sample repository. The Codeup-Demo repository is created by default in your Alibaba Cloud DevOps organization.
Step 1: Create a code requirement in Projex
- Go to Projex and click Agile Development Sample Project. The Agile Development Sample Project is created by default in your Alibaba Cloud DevOps organization. You can also choose another project.
- In the Agile Development Sample Project, click Requirements in the left-side navigation pane, and then click New in the upper-right corner. On the New Requirement page that appears, enter the following:
- Title: Add QuickSortUtils sorting utility class.
- Content: Create a QuickSortUtils sorting utility class to sort arrays.
- Click New to complete the creation, and copy the requirement ID (for example, DEMO-38).
Step 2: Create a personal access token
- On the Alibaba Cloud DevOps homepage, click your profile picture in the upper-right corner and then click Personal Settings.
- Click Personal Access Tokens in the left-side navigation pane, and then click New Token. On the New Access Token page, configure the following items:
- Token name: Enter a name as needed.
- Expiration time: The default validity period is 7 days. You can select a longer period.
- Select permissions: Grant read-only or read/write permissions to each sub-item under Organization Management, Project Collaboration, and Code Management.
- After the token is created, be sure to copy and save it immediately so that you can use it when you install the MCP Server.
Step 3: Add the Alibaba Cloud DevOps service
- Click the MCP Marketplace tab, search for Alibaba Cloud DevOps, and then click Install.
- In the dialog box that appears, enter the personal access token that you created in Step 2, and then click Add Now. After the installation is complete, go to My Services to verify. If the icon is displayed, the connection is successful and the service is ready to use. Expand the details to view the list of tools provided by the MCP Server. The host running the IDE must have Node.js installed; otherwise, an error may appear: "failed to create MCP client for yunxiao: failed to start command: exec: "npx": executable file not found in %PATH%". For a fix, see MCP FAQ: The environment required by the npx command is missing.
Step 4: Generate code and submit a merge request
- Pull the Codeup-Demo sample repository to your local host and open the project in IntelliJ IDEA.
- Go to the Qwen Qoder CN Intelligent Chat page, switch to Agent mode, and enter the following two prompts for testing.
-
After a successful test, enter the formal prompt.
-
Because this prompt includes multiple operations—reading the requirement, writing code, uploading code, and creating a merge request—the system prompts you multiple times when invoking the MCP tools and waits for your confirmation before proceeding. After Qoder CN generates the QuickSortUtils code, click Accept at the bottom of the diff view to accept the generated code, and then press Ctrl+Enter to confirm the execution of the git commands in the terminal. QuickSortUtils.java snippet generated by Qoder CN:
Git commit and push commands to be executed in the terminal:
- After the interaction is complete, you can view the newly created branch and its corresponding merge request in the Codeup-Demo sample repository. The merge request is titled Add QuickSortUtils sorting utility class, merging from branch feature/DEMO-38 to master. The status shows Pending Merge, with Merge Allowed and No Code Conflicts. On the File Changes tab, you can view the diff of QuickSortUtils.java, which adds 41 lines of quicksort utility code.