jenkins-server-mcp
Provides tools for interacting with a Jenkins CI/CD server, including checking build status, triggering builds, retrieving logs, listing jobs, and user management.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@jenkins-server-mcp Check the last build status of the main branch pipeline"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Jenkins Server MCP
A Model Context Protocol (MCP) server that provides tools for interacting with Jenkins CI/CD servers. This server enables AI assistants to check build statuses, trigger builds, and retrieve build logs through a standardized interface.
Installation
Clone this repository:
git clone https://github.com/iamishaan24/jenkins-mcp-server.git
cd jenkins-mcp-serverInstall dependencies:
npm installBuild the project:
npm run buildRelated MCP server: Jenkins MCP Server
Configuration
The server requires the following environment variables:
JENKINS_URL: The URL of your Jenkins serverJENKINS_USER: Jenkins username for authenticationJENKINS_TOKEN: Jenkins API token for authentication
Configure these in your MCP settings file:
For Claude Desktop
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"jenkins-server": {
"command": "node",
"args": ["/path/to/jenkins-server-mcp/build/index.js"],
"env": {
"JENKINS_URL": "https://your-jenkins-server.com",
"JENKINS_USER": "your-username",
"JENKINS_TOKEN": "your-api-token"
}
}
}
}Tools and Usage
1. get_build_status
Retrieves the current status of a Jenkins build, including whether it is running, the result, timestamps, duration, and build URL. Supports fetching the latest build by default.
2. list_all_jobs
Lists all Jenkins jobs available on the server along with their job name, job URL, last build number, last build result, and Jenkins status color (blue, red, yellow, disabled, etc.).
3. list_recent_failed_jobs
Returns a list of Jenkins jobs whose most recent build failed. The results are sorted by the most recent failure time and can be limited to a specific number of jobs.
4. count_failed_jobs
Counts how many Jenkins jobs currently have their last build in a FAILURE state. Useful for quick health checks of the Jenkins instance.
5. get_failed_build_log
Fetches the console output of the last failed build for a specified Jenkins job. If no failed builds exist, the tool reports that clearly.
6. trigger_build
Triggers a new Jenkins build for a given job.
Uses /build for jobs without parameters.
Uses /buildWithParameters when parameters are provided. Automatically handles Jenkins CSRF (crumb) protection.
7. get_build_log
Retrieves the full console output of a specific Jenkins build, including support for fetching logs from the latest build.
8. create_jenkins_user
Creates a new Jenkins user in the internal Jenkins user database. This operation requires administrative permissions and supports setting username, password, full name, and email.
Development
For development with auto-rebuild:
npm run watchDebugging
Since MCP servers communicate over stdio, you can use the MCP Inspector for debugging:
npm run inspectorThis will provide a URL to access debugging tools in your browser.
Thanks
Thanks AIMCP(https://www.aimcp.info).
License
This project is licensed under the MIT License - see the LICENSE file for details.
Available Tools
8 toolscount_failed_jobsA
Count how many Jenkins jobs currently have their last build in FAILURE state.
Inputs: no named parameters.
create_jenkins_userA
Create a new Jenkins user in the internal user database. Requires admin permissions.
Inputs: username (required), password (required), fullName, email.
get_build_logC
Get the console output of a Jenkins build
Inputs: jobPath (required), buildNumber (required).
get_build_statusB
Get the status of a Jenkins build
Inputs: jobPath (required), buildNumber.
get_failed_build_logB
Get the console output of the last failed build for a given Jenkins job.
Inputs: jobPath (required).
list_all_jobsA
List all Jenkins jobs with their name, URL, and last build status.
Inputs: no named parameters.
list_recent_failed_jobsB
List Jenkins jobs whose most recent build failed, sorted by most recent failure time.
Inputs: limit.
trigger_buildB
Trigger a new Jenkins build
Inputs: jobPath (required), parameters (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Most tools have distinct purposes, but 'get_build_log' and 'get_failed_build_log' could cause minor confusion, and 'count_failed_jobs' and 'list_recent_failed_jobs' overlap in domain though differ in output.
All tool names use snake_case with verb_noun pattern (e.g., trigger_build, list_all_jobs). The naming is largely consistent, though 'get_failed_build_log' is a longer variant of 'get_build_log'.
With 8 tools, the set is well-scoped for a Jenkins monitoring and triggering server, covering essential operations without excess.
The server covers basic monitoring (status, logs, failed jobs) and build triggering, but lacks job creation, deletion, configuration update, or parameterized build support, leaving notable gaps.
Maintenance
Related MCP Connectors
Plan Salesforce deploys, open pull requests and trigger pipelines from your AI client.
Connect AI agents to CloudBees Unify: feature flags, CI/CD, release orchestration, and security
Direct access to Cypress tests results and accessibility reports in your AI workflow.
Inspect and control your Northflank projects, services, jobs, and builds from your AI assistant.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Jenkins CI/CD systems through natural language, providing build management, job monitoring, log analysis, and debugging capabilities.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Jenkins CI/CD systems for build management, job monitoring, console log analysis, and debugging through natural language commands.2MIT
- AlicenseBqualityDmaintenanceProvides AI assistants with full access to Jenkins CI/CD systems, enabling querying, managing, and controlling Jenkins jobs, builds, nodes, and queues through natural language.221,362 npm2MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI assistants to securely inspect and manage Jenkins servers, providing tools for jobs, builds, nodes, queues, views, plugins, artifacts, and Groovy scripts through natural-language workflows.-