jenkins-mcp-enterprise

jenkins-mcp-enterprise

A Jenkins MCP server for multi-instance build management, log inspection, failure diagnostics, and optional vector search.

Category
访问服务器

README

Jenkins MCP Server Enterprise

Jenkins MCP server for multi-instance routing, build diagnostics, and optional vector search.

A Model Context Protocol (MCP) server for Jenkins that provides build management, log inspection, failure diagnostics, and multi-instance configuration. The maintained setup paths in this repository are source install and Docker/Compose.

What It Does

  • Trigger builds synchronously or asynchronously
  • Find jobs before triggering or inspecting them
  • Inspect job definitions and source locations
  • Retrieve logs and run targeted log-search tools
  • Discover downstream and sub-build hierarchies
  • Inspect recent builds or a window around a specific build
  • Diagnose build failures with configurable recommendations
  • Route each tool call to the correct Jenkins instance based on jenkins_url
  • Expose semantic_search only when vector search is enabled
  • Expose apply_job_edit only when server-side job editing is enabled

Quick Start

Prerequisites

  • Python 3.10+
  • Jenkins API access
  • Jenkins username and API token
  • Docker and Docker Compose if you want container deployment
  • Qdrant if you want semantic_search

Install from Source

git clone https://github.com/Jordan-Jarvis/jenkins-mcp-enterprise
cd jenkins-mcp-enterprise
python3 -m pip install -e .

Understand the Two Config Layers

The server uses two configuration layers:

  • Primary server config: config/mcp-config.yml
  • Diagnostic config: loaded from one of:
    • --diagnostic-config /path/to/file.yml
    • JENKINS_MCP_DIAGNOSTIC_CONFIG=/path/to/file.yml
    • config/diagnostic-parameters.yml
    • bundled defaults in jenkins_mcp_enterprise/diagnostic_config/diagnostic-parameters.yml

You always need the primary server config. You only need a project-local diagnostic config file if you want to override the bundled diagnostic defaults.

Create the Primary Server Config

mkdir -p config
cp config/mcp-config.example.yml config/mcp-config.yml

Edit config/mcp-config.yml with your Jenkins URLs and credentials.

If you want the optional Jenkins-managed job edit workflow for non-SCM-backed jobs, also set:

settings:
  enable_job_editing: true
  job_edit_workspace_dir: "/tmp/mcp-jenkins/job-definitions"

Optional Project-Local Diagnostic Override

Create this only if you want to tune diagnose_build_failure:

cat > config/diagnostic-parameters.yml << 'ENDDIAG'
semantic_search:
  min_diagnostic_score: 0.65
  max_total_highlights: 4

recommendations:
  max_recommendations: 5
ENDDIAG

If you want semantic search, start the local vector stack and set disable_vector_search: false with vector.host: "http://localhost:6333":

./scripts/start_dev_environment.sh

Docker and Compose

cp config/mcp-config.example.yml config/mcp-config.yml
./start-jenkins_mcp_enterprise.sh

See README-Docker.md for the container deployment flow.

Start the Server

jenkins_mcp_enterprise --config config/mcp-config.yml

Connect to Claude Desktop

Add to ~/.claude_desktop_config.json:

{
  "mcpServers": {
    "jenkins": {
      "command": "jenkins_mcp_enterprise",
      "args": ["--config", "config/mcp-config.yml"]
    }
  }
}

Usage Notes

  • Pass full Jenkins build URLs when a tool or prompt relies on jenkins_url.
  • In multi-Jenkins setups, each tool call resolves exactly one configured instance from jenkins_url. The server does not fan out across all configured Jenkins instances for a single call.
  • semantic_search is available only when vector search is enabled.
  • apply_job_edit is available only when settings.enable_job_editing: true.
  • get_job_definition returns SCM location details for SCM-backed pipelines. For inline pipelines, it stages a local Groovy file for patch/edit/upload. For other Jenkins-managed jobs, it stages config.xml.
  • diagnose_build_failure always uses a diagnostic config layer. If you do not provide a project-local override, the bundled defaults are used.
  • The Docker image includes ripgrep, so ripgrep_search and navigate_log work in container deployments.

Common Usage Patterns

Analyze this failed build: https://jenkins.company.com/job/api-service/456/
Find the root cause in this nested pipeline: https://jenkins.company.com/job/monorepo/job/main/789/
Show me the test failure section from this build: https://jenkins.company.com/job/tests/321/
Find similar authentication failures in recent builds

Available Tools

Tool Purpose
trigger_build Start a build and wait for completion
trigger_build_async Queue a build without waiting for completion
trigger_build_with_subs Trigger a build and track downstream/sub-build execution
get_jenkins_job_parameters Inspect job parameters before triggering builds
find_jobs Search jobs by name, path, or URL on one resolved Jenkins instance
list_job_builds List recent builds for a job, or a small window around a target build number
get_build_info Fetch metadata for a specific build or lastBuild
get_job_definition Inspect whether a job is SCM-backed, inline, multibranch, or XML-backed
ripgrep_search Search logs with regex and context windows
filter_errors_grep Filter logs with common error-oriented patterns
navigate_log Jump to sections or occurrences inside a log
get_log_context Fetch targeted log ranges or chunks
diagnose_build_failure AI-assisted failure diagnosis using logs, hierarchy data, and configured recommendations
semantic_search Vector-backed similarity search across log chunks when vector search is enabled
apply_job_edit Upload a locally edited staged job definition back to Jenkins when job editing is enabled

Configuration Documentation

Development

# Start local supporting services when vector search is enabled
./scripts/start_dev_environment.sh

# Run tests
python3 -m pytest tests/ -v

# Format code
python3 -m black .

License

GPL v3

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选