HJ

hekmon8/jenkins-server-mcp

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

15 stars 17 forks Качество 81 Тренд 29MIT

A Model Context Protocol (MCP) server that provides tools for interacting with Jenkins CI/CD servers.

Обзор

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. 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: MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%/Claude/claude_desktop_config.json Trigger a new Jenkins build with parameters: Retrieve the console output of a Jenkins build: Since MCP servers communicate over stdio, you can use the MCP Inspector for debugging:

README

Показан фрагмент оригинального README. Открыть оригинал.

Sponsors

Website Description
productdirs.com Free AI SaaS Product Directory & Listing Platform - Submit your AI products and SaaS tools for free exposure and discovery
thistools.app Free AI Tools & SaaS Directory for Developers - Discover and list innovative AI-powered tools and SaaS applications
aiimgcombiner.com Free AI-Powered Image Merging & Combination Tool - Merge and combine multiple images effortlessly with AI technology

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:

{
  "jobPath": "string",  // Relative Jenkins job path (must not start with "/", "\\", or include a URL scheme)
  "buildNumber": "string"  // Optional, build number or "lastBuild"
}

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:

{
  "jobPath": "string",  // Relative Jenkins job path (must not start with "/", "\\", or include a URL scheme)
  "parameters": {
    // Build parameters as key-value pairs
  }
}

3. Get Build Log

Retrieve the console output of a Jenkins build:

// Example usage
const result = await mcpClient.useTool("jenkins-server", "get_build_log", {
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "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" } } } }