MCP ExplorerExplorer

Jenkins Server Mcp

@hekmon8on a year ago
8 MIT
FreeCommunity
AI Systems
A server for interacting with Jenkins CI/CD, enabling build status checks and logs retrieval.

Overview

What is Jenkins Server Mcp

Jenkins-server-mcp is a Model Context Protocol (MCP) server designed to facilitate interactions with Jenkins CI/CD servers. It allows AI assistants to check build statuses, trigger builds, and retrieve build logs through a standardized interface.

Use cases

Use cases for Jenkins-server-mcp include automating build processes, monitoring build statuses, and integrating Jenkins functionalities into AI assistants or other automated systems.

How to use

To use Jenkins-server-mcp, clone the repository, install the dependencies, and build the project. Configure the server with your Jenkins URL, username, and API token in the MCP settings file. You can then use tools to get build status or trigger builds by calling the appropriate functions with the required parameters.

Key features

Key features of Jenkins-server-mcp include the ability to check build statuses, trigger builds with parameters, and retrieve build logs. It provides a standardized interface for seamless integration with Jenkins CI/CD servers.

Where to use

Jenkins-server-mcp can be used in software development environments where continuous integration and continuous deployment (CI/CD) practices are implemented. It is particularly useful for teams utilizing Jenkins as their CI/CD tool.

Content

Jenkins Server MCP

A Model Context Protocol (MCP) server that provides tools for interacting with Jenkins CI/CD servers. This server enables AI assistants to check build statuses, trigger builds, and retrieve build logs through a standardized interface.

Installation

  1. Clone this repository:
git clone https://github.com/hekmon8/jenkins-server-mcp.git
cd jenkins-server-mcp
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Configuration

The server requires the following environment variables:

  • JENKINS_URL: The URL of your Jenkins server
  • JENKINS_USER: Jenkins username for authentication
  • JENKINS_TOKEN: Jenkins API token for authentication

Configure these in your MCP settings file:

For Claude Desktop

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "jenkins-server": {
      "command": "node",
      "args": [
        "/path/to/jenkins-server-mcp/build/index.js"
      ],
      "env": {
        "JENKINS_URL": "https://your-jenkins-server.com",
        "JENKINS_USER": "your-username",
        "JENKINS_TOKEN": "your-api-token"
      }
    }
  }
}

Tools and Usage

1. Get Build Status

Get the status of a Jenkins build:

// Example usage
const result = await mcpClient.useTool("jenkins-server", "get_build_status", {
  jobPath: "view/xxx_debug",
  buildNumber: "lastBuild"  // Optional, defaults to lastBuild
});

Input Schema:

2. Trigger Build

Trigger a new Jenkins build with parameters:

// Example usage
const result = await mcpClient.useTool("jenkins-server", "trigger_build", {
  jobPath: "view/xxx_debug",
  parameters: {
    BRANCH: "main",
    BUILD_TYPE: "debug"
  }
});

Input Schema:

3. Get Build Log

Retrieve the console output of a Jenkins build:

// Example usage
const result = await mcpClient.useTool("jenkins-server", "get_build_log", {
  jobPath: "view/xxx_debug",
  buildNumber: "lastBuild"
});

Input Schema:

Development

For development with auto-rebuild:

npm run watch

Debugging

Since MCP servers communicate over stdio, you can use the MCP Inspector for debugging:

npm run inspector

This will provide a URL to access debugging tools in your browser.

Thanks

Thanks AIMCP(https://www.aimcp.info).

License

This project is licensed under the MIT License - see the LICENSE file for details.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers