Token导航 LogoToken导航TokenDH.com
Jenkins Investigator MCP Server logo
开发工具stdio官方级别未说明来源级核验

Jenkins Investigator MCP Server

MCP Server

一个帮助AI助手高效调试Jenkins CI作业失败的服务器,通过过滤冗长的API响应,仅返回关键错误信息、提交消息和失败测试。

工具数

27

提示词数

0

GitHub Stars

1

资源数

0
PythonClaude开发工具Claude DesktopClaudeCursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

omrisaba

提供方

omrisaba

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install uv

详细介绍

Jenkins Investigator MCP Server

A Model Context Protocol server that helps AI assistants debug failing Jenkins CI jobs efficiently — without blowing through a context window.

Note: This codebase was generated with AI assistance (Claude/Cursor) and reviewed, tested, and validated by humans.

How It Works

Raw Jenkins API responses are enormous. This server acts as a filter: it fetches the verbose data, strips the noise, and returns only what matters — error snippets, commit messages, failing tests.

Tools

Bundles — Start Here

Bundles combine multiple API calls into a single tool invocation, saving tokens and latency.

BundleWhat It Does
investigate_build_failurePrimary entry point. Returns build info, stages, errors, tests, commits, params, and trend in one call.
compare_failing_vs_passingDiffs the last failing vs last passing build: parameter changes, agent, trigger, cumulative commits.
deep_dive_test_failuresTraces each failing test back through recent builds to find the regression point and suspect commit. Enriches with JUnit XML artifacts when available (failure classification, blast-radius detection, extended stdout/stderr).
analyze_flaky_jobScores flakiness and clusters failures by node, stage, and time of day.
diagnose_infrastructure_issueChecks node health and per-node failure correlation to determine if a failure is infra-related.
search_across_jobsSearches console logs across all jobs in a folder for a specific error pattern. Concurrent, with status filtering and early termination.
triage_folderScans a folder for broken jobs with consecutive-failure counts — a team health dashboard.

Individual Tools

Use these for targeted follow-up after a bundle gives you the big picture.

ToolWhen to Use
get_last_build_infoDiscover the latest (or latest failed) build number from a job name.
list_jobsBrowse jobs in a Jenkins folder.
get_build_summaryQuick build overview: status, runtime, agent, trigger.
get_pipeline_stagesStage table with status and duration.
get_build_parametersSee build parameters (branch, env, flags).
get_build_historyRecent build results with trend analysis.
get_scm_changesCommits in this build (Git, SVN, Mercurial).
get_error_logsPrioritized error extract from the console log (≤250 lines).
get_stage_logsError extract from a specific pipeline stage's log.
search_console_logGrep the console log for a string or regex with context lines.
get_test_failuresFailing tests with error messages and stack traces.
get_build_artifactsList artifacts or fetch a specific artifact's content.
get_job_configParsed job config: SCM, triggers, agent label, pipeline definition.
get_build_environmentCI-relevant environment variables (requires EnvInject plugin).
get_queue_infoBuild queue with reasons why builds are waiting.
compare_buildsDiff any two builds (params, agent, trigger, commits).
get_upstream_downstream_buildsUpstream trigger chain for a build.
get_node_statusAgent online status and disk space.
get_node_listAll agents with labels, executors, and disk space.
get_pipeline_flow_nodesParallel branches and step-level detail inside a stage.

Setup

1. Install dependencies

pip install uv
uv pip install -e .

Or with plain pip:

pip install fastmcp>=3.0.0 requests>=2.31 pydantic>=2.0 python-dotenv>=1.0

2. Configure credentials

cp .env.example .env

Edit .env:

JENKINS_URL=http://your-jenkins:8080
JENKINS_USER=your-username
JENKINS_TOKEN=your-api-token

Your API token can be generated from Jenkins → your user → Configure → API Token.

3. Run the server

python server.py

By default the server starts with Streamable HTTP transport on 0.0.0.0:8000. You'll see the local and network URLs printed on startup.

4. Connect from Cursor / Claude Desktop

HTTP transport (default):

{
  "mcpServers": {
    "jenkins-investigator": {
      "url": "http://192.168.1.42:8000/mcp"
    }
  }
}

Replace the IP with the Network URL printed at server startup.

Stdio transport (set MCP_TRANSPORT=stdio in .env):

{
  "mcpServers": {
    "jenkins-investigator": {
      "command": "python",
      "args": ["/absolute/path/to/jenkins-mcp/server.py"],
      "env": {
        "MCP_TRANSPORT": "stdio",
        "JENKINS_URL": "http://your-jenkins:8080",
        "JENKINS_USER": "your-username",
        "JENKINS_TOKEN": "your-api-token"
      }
    }
  }
}

Job Names

For simple jobs, use the job name directly: my-job.

For jobs inside folders or multibranch pipelines, use slash-separated paths:

my-org/my-repo/main

The server automatically converts this to the correct Jenkins API path (/job/my-org/job/my-repo/job/main/).

Configuration

VariableRequiredDefaultDescription
JENKINS_URLYesBase URL of your Jenkins instance
JENKINS_USERYesJenkins username
JENKINS_TOKENYesJenkins API token (not your password)
JENKINS_VERIFY_SSLNotrueSet to false for Jenkins with self-signed or internal CA certificates
MCP_TRANSPORTNohttpTransport protocol: http (Streamable HTTP) or stdio
MCP_HOSTNo0.0.0.0Bind address for HTTP transport
MCP_PORTNo8000Port for HTTP transport
TOOL_DELAY_SECONDSNo2Delay between tool calls to avoid hitting AI provider TPM limits

Documentation

See Architecture for system design, layer responsibilities, and resilience strategy.

See Tool Flow for decision trees, bundle internals, and per-tool quick reference.

Project Structure

jenkins-mcp/
├── server.py          # FastMCP server — 20 individual tools + 7 bundles
├── utils/
│   ├── __init__.py
│   ├── jenkins_api.py # Jenkins REST wrappers with retry/backoff
│   ├── junit_parser.py# JUnit XML parser (assertion vs exception classification, blast radius)
│   ├── log_parser.py  # Priority-budgeted error extraction
│   └── scm.py         # changeSet/changeSets normalization across SCMs
├── docs/
│   ├── architecture.md # System design and layer diagrams
│   └── tool-flow.md    # Decision trees and bundle internals
├── tests/             # pytest suite (162 tests)
├── .env               # Your credentials (gitignored)
├── .env.example       # Template
├── .gitignore
└── pyproject.toml

Security

  • Credentials are read from environment variables only — never hardcoded.
  • The server is read-only: no tools delete jobs, wipe workspaces, or trigger builds.
  • The .env file is gitignored by default.
  • Console logs are capped at 10 MB to prevent memory exhaustion on large builds.

目录标签

目录标签

PythonClaude开发工具Jenkins本地部署CI/CD故障诊断自动化测试

支持客户端

Claude DesktopClaudeCursor

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

token

工具数量(toolCount,工具数)

27

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiotoken部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP