This file provides guidance to iFlow Cli when working with code in this repository.
npm run build- Compiles TypeScript code to JavaScript in thedistdirectorynpm run watch- Continuously watches and compiles TypeScript files
npm start- Runs the compiled server fromdist/index.jsin stdio modenpm run start:sse- Runs the compiled server fromdist/index.jsin SSE mode
- Use
npm run watchduring development for automatic recompilation - The server entry point is
index.tswhich exports all functionality as an MCP server - To run in SSE mode during development:
node dist/index.js --sse - To run with specific toolsets:
node dist/index.js --toolsets=code-management,project-management
This is an MCP (Model Context Protocol) server implementation that provides AI assistants with the ability to interact with Alibaba Cloud DevOps (Yunxiao) platform.
The server is structured into several modules:
-
Core Entry Point (
index.ts):- Initializes the MCP server
- Registers available tools based on enabled toolsets
- Handles tool requests and maps them to appropriate functions
- Supports both stdio and SSE transports
-
Operations Modules (in
operations/directory):codeup/- Contains functions for code repository operations (branches, files, repositories, change requests)flow/- Contains functions for pipeline operations and service connectionsorganization/- Contains functions for organization and member managementpackages/- Contains functions for package/artifact repository operationsprojex/- Contains functions for project and work item management
-
Common Modules (in
common/directory):types.ts- Defines all Zod schemas for input validationerrors.ts- Custom error handling for Yunxiao API responsesversion.ts- Version information for the servertoolsets.ts- Toolset definitions and configurationtoolsetManager.ts- Toolset management implementation
The server implements a standard MCP server pattern where:
- Tools are registered with their schemas in the ListTools handler based on enabled toolsets
- Actual tool execution happens in the CallTool handler, routed to appropriate toolset handlers
- Each operation has a dedicated function file that makes API calls to Yunxiao
- All inputs are validated using Zod schemas before processing
The server exposes dozens of tools covering:
- Code repository management (branches, files, repositories)
- Code review operations (change requests, comments)
- Project management (projects, work items, work item types)
- Pipeline management (pipelines, runs, jobs)
- Package repository management (artifacts, repositories)
- Organization management (members, departments, roles)
- Service connections management
The server now supports toolsets, allowing you to enable only the tools you need. This can reduce the number of tools presented to the AI assistant and improve performance.
Available toolsets:
code-management: Code repository management tools (includes commit management tools)organization-management: Organization management toolsproject-management: Project management tools (includes effort management tools)pipeline-management: Pipeline management tools (includes service connections, resource member, and VM deploy order tools)packages-management: Package repository management toolsapplication-delivery: Application delivery tools
To use toolsets, you can specify them via command line arguments or environment variables:
- Via command line argument:
npm start -- --toolsets=code-management,project-management- Via environment variable:
DEVOPS_TOOLSETS=code-management,project-management npm startIf no toolsets are specified, all tools will be enabled by default.
The server can run in SSE (Server-Sent Events) mode, which allows it to be accessed over HTTP instead of stdio. This is useful when deploying the server as a remote service.
To run in SSE mode:
- Use
npm run start:sseornode dist/index.js --sse - The server will start an HTTP server on port 3000 (configurable with PORT environment variable)
- Clients can connect via SSE at
http://localhost:3000/sse - Messages are sent to
http://localhost:3000/messages?sessionId=<session-id>
In SSE mode, the server maintains sessions for each connected client, allowing for proper request/response correlation.