Skip to main content
Glama
Jenkins MCP
by kjozsa

詹金斯 MCP

铁匠徽章用于管理 Jenkins 操作的 MCP 服务器。

安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 Jenkins MCP:

npx -y @smithery/cli install @kjozsa/jenkins-mcp --client claude

手动安装

uvx install jenkins-mcp

Related MCP server: jenkins-mcp-server

配置

使用以下 JSON 配置片段添加 MCP 服务器:

{
  "mcpServers": {
    "jenkins-mcp": {
      "command": "uvx",
      "args": ["jenkins-mcp"],
      "env": {
        "JENKINS_URL": "https://your-jenkins-server/",
        "JENKINS_USERNAME": "your-username",
        "JENKINS_PASSWORD": "your-password",
        "JENKINS_USE_API_TOKEN": "false"
      }
    }
  }
}

CSRF Crumb 处理

Jenkins 使用“crumbs”实现 CSRF 防护 - 即 POST 请求中必须包含的令牌。本 MCP 服务器通过两种方式处理 CSRF crumbs:

  1. 默认模式:自动获取并包含带有构建请求的 CSRF 信息

    • 使用会话 cookie 来维护网络会话

    • 处理幕后的所有 CSRF 保护

  2. API 令牌模式:使用不受 CSRF 保护的 Jenkins API 令牌

    • 设置JENKINS_USE_API_TOKEN=true

    • 将JENKINS_PASSWORD设置为您的 API 令牌而不是密码

    • 适用于 Jenkins 2.96+,不需要 crumbs 进行 API 令牌认证

您可以在 Jenkins 中生成 API 令牌:用户 → 配置 → API 令牌 → 添加新令牌

特征

  • 列出 Jenkins 职位

  • 使用可选参数触发构建

  • 检查构建状态

  • CSRF crumb 处理,实现安全 API 访问

发展

# Install dependencies
uv pip install -r requirements.txt

# Run in dev mode with Inspector
mcp dev jenkins_mcp/server.py

Available Tools

3 tools
get_build_statusB

Get build status

Args:
    job_name: Name of the job
    build_number: Build number to check, defaults to latest

Returns:
    Build information dictionary

Inputs: job_name (required), build_number.

list_jobsB

List all Jenkins jobs

Inputs: no named parameters. Returns: result

trigger_buildB

Trigger a Jenkins build

Args:
    job_name: Name of the job to build
    parameters: Optional build parameters as a dictionary (e.g. {"param1": "value1"})

Returns:
    Dictionary containing build information including the build number

Inputs: job_name (required), parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: get_build_status retrieves status information, list_jobs enumerates available jobs, and trigger_build initiates new builds. There is no overlap in functionality, making tool selection straightforward for an agent.

    Naming Consistency5/5

    All tools follow a consistent verb_noun naming pattern (get_build_status, list_jobs, trigger_build). The verbs are descriptive and appropriate for their actions, and snake_case is used uniformly throughout.

    Tool Count2/5

    With only 3 tools, the set feels thin for a Jenkins integration, which typically involves more operations like viewing logs, managing job configurations, or canceling builds. This limited scope may hinder agent workflows that require broader control.

    Completeness2/5

    The toolset is severely incomplete for Jenkins automation. It lacks essential operations such as viewing build logs, updating job configurations, canceling builds, or managing nodes/plugins. This creates significant gaps that will likely cause agent failures in common use cases.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers