npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jesbrian/jenkins-mcp-server

v0.2.1

Published

Jenkins MCP Server with Modular Configuration

Readme

Jenkins MCP Server

基于 Model Context Protocol (MCP) 的 Jenkins API 服务。该服务器提供了一组工具,允许 AI 模型与 Jenkins 实例进行交互,主要专注于流水线管理和构建操作。

项目信息

  • 包名: @jesbrian/jenkins-mcp-server
  • 版本: 0.2.1
  • 类型: CommonJS
  • 主入口: index.js
  • 可执行文件: jenkins-mcp-server
  • 配置模块: config/Config.js

项目结构

jenkins-mcp-server/
├── index.js                          # 主入口文件
├── config/                           # 配置目录
│   └── Config.js                     # 集中配置文件
├── lib/                              # 库目录
│   └── JenkinsClient.js              # Jenkins API 客户端
├── package.json
└── README.md

模块化设计

  • JenkinsClient.js: 封装 Jenkins API 调用的客户端类(根目录)
  • config/Config.js: 集中管理所有配置项(Jenkins 连接、客户端选项、MCP Server 配置、Tools 定义)
  • index.js: MCP Server 主逻辑,负责工具调用和请求处理

功能特性

  • 流水线管理
    • 获取流水线最近一次构建状态。
    • 获取流水线的参数定义。
    • 获取所有流水线列表。
  • 构建操作
    • 触发无参数流水线构建。
    • 触发带参数流水线构建。
    • 获取指定构建号的详细信息。
    • 停止正在运行的构建。
  • 队列管理
    • 获取 Jenkins 构建队列信息。

配置管理

所有配置项已集中到 config/Config.js 文件中,支持通过环境变量自定义:

需要配置以下环境变量:

| 变量名 | 描述 | 必填 | 默认值 | | :--- | :--- | :--- | :--- | | JENKINS_URL | Jenkins 实例地址 (例如 https://jenkins.example.com) | 是 | - | | JENKINS_USER | Jenkins 用户名 | 是 | - | | JENKINS_TOKEN | Jenkins API 令牌 | 是 | - | | TIMEOUT | 请求超时时间 (毫秒) | 否 | 10000 | | WAIT_INTERVAL | 轮询等待间隔 (毫秒) | 否 | 2000 |

运行方式

作为 MCP Server 使用

在 Claude Desktop 的配置文件中添加:

方式一:使用 npx(推荐)

{
  "mcpServers": {
    "jenkins": {
      "command": "npx",
      "args": ["@jesbrian/jenkins-mcp-server"],
      "env": {
        "JENKINS_URL": "https://your-jenkins-url.com",
        "JENKINS_USER": "your-username",
        "JENKINS_TOKEN": "your-api-token"
      }
    }
  }
}

方式二:本地路径运行

本地启动项目后再配置 Claude Code:

# 克隆项目后,进入目录并安装依赖
cd jenkins-mcp-server
npm install

# 本地启动服务(任选一种方式)
npm start              # 方式一:使用 npm scripts
node index.js          # 方式二:直接运行
jenkins-mcp-server     # 方式三:全局安装后使用命令

在 Claude Code 的 MCP 配置中添加:

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

可用工具

流水线管理

  • get_job_status: 获取指定流水线最近一次构建的状态。
  • get_job_params: 获取指定流水线的参数定义。
  • get_job_list: 获取 Jenkins 所有流水线列表(支持 depth 参数)。

构建操作

  • trigger_build: 触发无参数流水线构建。
  • trigger_build_with_parameters: 触发带参数流水线构建(支持传入 key-value 格式的构建参数)。
  • get_build_info: 获取指定构建号的详细信息(包括构建状态、持续时间、参数等)。
  • stop_build: 停止正在运行的构建。

队列管理

  • get_queue_info: 获取 Jenkins 构建队列信息(包括排队中的项目、等待原因等)。