HJ

hekmon8/jenkins-server-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

15 stars 17 forks 质量 81 趋势 17MIT

一个模式背景协议(MCP)服务器,提供与Jenkins CI/CD服务器互动的工具.

概览

一个模式背景协议(MCP)服务器,提供与Jenkins CI/CD服务器互动的工具. 这个服务器可以让AI助手检查构建状态,触发构建,并通过一个标准化的界面检索构建日志. 服务器需要以下环境变量: - JENKINS URL:您的 Jenkins 服务器的URL - JENKINS USER: Jenkins 用户名用于认证 - JENKINS TOKEN: Jenkins API 签名用于认证 在您的 MCP 设置文件中配置这些 : MacOS:~/图书馆/应用程序支持/Claude/claude desktop config.json 窗口 :% APPDATA%/ Claude/ claude desktop config.json 触发带有参数的新 Jenkins 构建 : 获取 Jenkins 架构的控制台输出 : 由于 MCP 服务器通过 stdio 进行通信, 您可以使用 MCP 检查器进行调试 :

概述(AI 翻译)

□ 赞助者

网站 描述 |-|-|-. QQ产品dirs.com 自由AI SaaS产品目录和上市平台 - 提交AI产品和SaaS工具自由曝光和发现. QQ thistools.app QQFree AI Tools & SaaS 开发者目录 - 发现并列出创新的AI驱动工具和SaaS应用程序 QQ QQ aiimgcombiner.com 自由AI-Powered Image 合并和组合工具 - 合并和将多个图像无心地与AI技术合并 QQ

– – . . .

Jenkins 服务器 MCP

一个模式背景协议(MCP)服务器,提供与Jenkins CI/CD服务器互动的工具. 这个服务器可以让AI助手检查构建状态,触发构建,并通过一个标准化的界面检索构建日志.

□ 安装

  1. 克隆此存储器:

  2. 安装依赖性:

  3. 建设项目:

□ 配置

服务器需要以下环境变量:

  • [[T0]: 您 Jenkins 服务器的 URL
  • [[T1]: 用于认证的 Jenkins 用户名
  • [[T2]: Jenkins API 认证证书

在您的 MCP 设置文件中配置这些 :

用于 Claude 桌面

本页由 AI 翻译,技术细节请以原文为准。

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", {
在 GitHub 查看完整 README

安装

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

Open the repository installation guide 新手?先看 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" } } } }