Skip to content

ShabuddinKhan/jenkins-mcp-server-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Functions Jenkins MCP Server

This project is an Azure Functions app written in Python that integrates with Jenkins to manage and trigger builds via HTTP endpoints. It uses a modular blueprint-based structure for each Jenkins-related function.

Features

  • List Jenkins Builds: Query Jenkins for jobs matching a specific pattern (e.g., pipelines).
  • Trigger Jenkins Build: Start a Jenkins build remotely via HTTP request.
  • Get Build Details: Retrieve details for Jenkins jobs and builds.
  • Cancel Jenkins Build: Stop, kill, or terminate a running Jenkins build.
  • Get Console Output: Fetch console output for Jenkins builds.
  • Blueprint-based Structure: Modular design using blueprints for each function.

Main Files

Usage

  1. Deploy the app to Azure Functions or run locally.
  2. Use the HTTP endpoints to interact with Jenkins:
    • List builds containing the word "pipeline".
    • Trigger a build named "Hello-World-Pipeline".
    • Retrieve build/job details, console output, or cancel builds.

Usage Examples

List Jenkins Builds Containing "pipeline"

Send a POST request to the list builds endpoint with the following JSON body:

{
  "arguments": {
    "jenkinsServerFQDN": "jenkins-controller-app.orangemoss-230dd32b.eastus.azurecontainerapps.io",
    "searchString": "pipeline"
  }
}

Trigger Build "Hello-World-Pipeline"

Send a POST request to the trigger build endpoint with the following JSON body:

{
  "arguments": {
    "jenkinsServerFQDN": "jenkins-controller-app.orangemoss-230dd32b.eastus.azurecontainerapps.io",
    "buildName": "Hello-World-Pipeline"
  }
}

Configuration

  • Set Jenkins credentials (JENKINS_USER, Token) in local.settings.json or environment variables.
  • Update Jenkins server URL in your requests as needed.

Example Endpoints

  • POST /listbuilds — Lists Jenkins jobs, optionally filtered by name.
  • POST /triggerbuild — Triggers the specified Jenkins build.
  • Additional endpoints for build details, console output, and cancellation.

Requirements

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages