Jenkins MCP
Jenkins MCP
一个基于 Jenkins REST API 的 MCP Server,目标是兼容 Jenkins 2.332.2、2.356 以及后续版本。
它不安装 Jenkins 插件,因此不会受到官方 mcp-server 插件最低 Jenkins 核心版本的限制。一个 MCP Server 可以在配置中同时管理多个 Jenkins 实例,并通过 jenkins_name 选择目标实例。
已实现能力
查询 Jenkins 版本和兼容能力
查询当前认证用户
查询根目录或 Folder 下的 Job
查询 Job 和 Build
获取构建日志,并限制返回行数
查询 Queue、Queue Item 和节点
触发构建、停止构建、取消排队构建
用户名 + API Token 认证
自动获取和重试 Jenkins CSRF Crumb
默认只读,写操作需要显式设置
read_only: false
Related MCP server: Jenkins MCP Server
安装
建议使用 Python 3.10 或更高版本:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e '.[dev]'多 Jenkins 配置
创建 jenkins-mcp.json:
{
"instances": [
{
"name": "jenkins-233",
"base_url": "https://jenkins-233.example.com",
"username": "mcp-user",
"api_token": "replace-me",
"read_only": true,
"verify_ssl": true,
"timeout_seconds": 30,
"max_log_lines": 2000
},
{
"name": "jenkins-356",
"base_url": "https://jenkins-356.example.com/jenkins",
"username": "mcp-user",
"api_token": "replace-me",
"read_only": false
}
],
"server": {
"transport": "stdio",
"log_level": "INFO"
}
}启动:
jenkins-mcp --config jenkins-mcp.json生产环境建议通过环境变量或密钥管理系统注入配置,不要把 API Token 提交到 Git。
单 Jenkins 环境变量配置
也可以使用以下变量:
export JENKINS_URL='https://jenkins.example.com'
export JENKINS_USERNAME='mcp-user'
export JENKINS_API_TOKEN='replace-me'
export JENKINS_READ_ONLY='true'
jenkins-mcp多实例可以把 JSON 数组放入 JENKINS_INSTANCES_JSON,或者使用 JENKINS_CONFIG_FILE 指向 JSON 配置文件。
MCP 客户端配置
stdio 示例:
{
"mcpServers": {
"jenkins": {
"command": "/absolute/path/to/.venv/bin/jenkins-mcp",
"args": ["--config", "/absolute/path/to/jenkins-mcp.json"]
}
}
}工具调用时使用 jenkins_name,例如:
list_jobs(jenkins_name="jenkins-233")
get_build_log(jenkins_name="jenkins-356", job_name="team/app", build_number=123)版本兼容策略
服务通过 Jenkins 的 X-Jenkins 响应头检测版本。2.332.2 是当前最低兼容基线,2.356 使用相同的基础 REST API 能力。版本相关差异放在 versioning.py 的能力模型中,MCP 工具层不直接写版本判断。
基础 REST API 比 Jenkins 插件 API 更适合跨版本使用,但插件特有功能、Pipeline 高级信息和凭据管理不作为当前跨版本保证的一部分。
开发
pytest
ruff check .This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables managing Jenkins operations like listing jobs, triggering builds, and checking build statuses through a configurable MCP server.310Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAn MCP server for interacting with a Jenkins CI/CD server. Allows you to trigger jobs, check build statuses, and manage your Jenkins instance through MCP.5814Apache 2.0
- AlicenseAqualityCmaintenanceA local MCP server for Jenkins that provides 17 tools to interact with Jenkins jobs, builds, logs, SCM, and test results via REST API, no plugin required.171431MIT
- AlicenseNot gradedqualityAmaintenanceMCP server for Jenkins to inspect builds, control jobs, and manage pipeline configuration.192MIT
Related MCP Connectors
MCP server for Appcircle mobile CI/CD platform.
MCP Server for JFrog, providing tools for development and artifact management.
A MCP server built for developers enabling Git based project management with project and personal…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/programsummer/jenkins-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server