create_pipeline
Create a new GitLab CI/CD pipeline for a project by specifying the branch or tag and optional variables to automate software delivery processes.
Instructions
Create a new pipeline
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Project ID or path | |
| ref | Yes | Branch or tag name | |
| variables | No | Pipeline variables |
Implementation Reference
- src/handlers/pipelines.ts:53-72 (handler)The handler function that implements the create_pipeline tool logic. It constructs a request with ref and optional variables, posts to GitLab API endpoint /projects/{project_id}/pipeline, and returns the response as text content.async createPipeline(args: CreatePipelineParams) { const requestData: any = { ref: args.ref, }; if (args.variables && args.variables.length > 0) { requestData.variables = args.variables; } const data = await this.client.post(`/projects/${encodeURIComponent(args.project_id)}/pipeline`, requestData); return { content: [ { type: 'text', text: JSON.stringify(data, null, 2), }, ], }; }
- src/tools/pipelines.ts:87-121 (schema)MCP tool definition including the inputSchema (JSON Schema) for validating parameters: project_id (string, required), ref (string, required), variables (array of key-value objects, optional).{ name: 'create_pipeline', description: 'Create a new pipeline', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID or path', }, ref: { type: 'string', description: 'Branch or tag name', }, variables: { type: 'array', items: { type: 'object', properties: { key: { type: 'string' }, value: { type: 'string' }, variable_type: { type: 'string', enum: ['env_var', 'file'], default: 'env_var', }, }, required: ['key', 'value'], }, description: 'Pipeline variables', }, }, required: ['project_id', 'ref'], }, },
- src/server.ts:295-298 (registration)Registration of the create_pipeline tool handler in the MCP server's CallToolRequestSchema switch statement, dispatching to pipelineHandlers.createPipeline.case "create_pipeline": return await this.pipelineHandlers.createPipeline( args as unknown as CreatePipelineParams );
- src/types.ts:367-375 (schema)TypeScript interface defining the parameters for createPipeline, used in handlers and server for type checking.export interface CreatePipelineParams { project_id: string; ref: string; variables?: Array<{ key: string; value: string; variable_type?: 'env_var' | 'file'; }>; }