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-mcpCheck 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.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description provides minimal behavioral insight: it counts based on 'last build' and 'FAILURE state'. It does not mention rate limits, authentication, performance, or whether the count is cached. Adequate for a simple read operation, but leaves gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single, concise sentence with no unnecessary words. It is front-loaded and efficient, earning its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter tool returning a simple count, the description is largely sufficient. However, it does not specify scope (e.g., all jobs or filtered by permissions) or output format. Sibling tools exist but no comparison provided. Almost complete but minor ambiguity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist, so the description need not add param details. Schema coverage is trivially 100%. The baseline of 4 is appropriate as no further information is required.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action: count jobs with 'last build in FAILURE state'. It uses specific verb 'count' and resource 'Jenkins jobs', and is distinguishable from siblings that get status, log, or list jobs.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use versus alternatives like 'list_recent_failed_jobs' or 'get_build_status'. The purpose implies use for obtaining a count, but without contrast to siblings, the agent must infer selection criteria.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
create_jenkins_userA
Create a new Jenkins user in the internal user database. Requires admin permissions.
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes | Username for the new account | |
| password | Yes | Password for the new account | |
| fullName | No | Full name of the user | |
| No | Email address of the user (optional) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It discloses the need for admin permissions but does not describe potential side effects, idempotency, or what happens if the user already exists.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that front-loads the main purpose and adds a permission requirement. It is efficient with no unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema and no annotations, the description is too brief. It lacks information about return values, error handling, and whether the operation is idempotent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% (all four parameters have descriptions). The description does not add any additional meaning beyond what the schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Create a new Jenkins user in the internal user database.' It uses a specific verb-resource combination and is distinct from sibling tools which focus on jobs and builds.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description mentions 'Requires admin permissions,' providing a prerequisite. However, it does not explicitly state when to use this tool versus alternatives, though the sibling context makes it clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_build_logC
Get the console output of a Jenkins build
| Name | Required | Description | Default |
|---|---|---|---|
| jobPath | Yes | Path to the Jenkins job | |
| buildNumber | Yes | Build number (use "lastBuild" for most recent) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description must fully disclose behavior. It states 'Get' implying a read operation, but does not mention authentication, error states, or output characteristics. Missing details like whether it supports partial output or handles large logs.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence with no wasted words. It is front-loaded with the primary action. Slightly more structure (e.g., listing parameters) could improve scannability.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simplicity (2 params, no output schema), the description is minimally adequate. However, it lacks information about the return format (e.g., plain text, truncated, streaming) and any limitations. A bit more context would be helpful.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions for both parameters. The description adds no extra semantics beyond what the schema already provides. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Get' and the resource 'console output of a Jenkins build'. It is specific and distinct from sibling tools like get_build_status, though it could note that it retrieves full output versus status.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives (e.g., get_failed_build_log for failed builds). The description simply states the function without context for selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_build_statusB
Get the status of a Jenkins build
| Name | Required | Description | Default |
|---|---|---|---|
| jobPath | Yes | Path to the Jenkins job (e.g., "view/xxx_debug") | |
| buildNumber | No | Build number (use "lastBuild" for most recent) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden for behavioral disclosure. It only says 'Get the status' without explaining what status information is returned, whether it is read-only, or any side effects. This is insufficient for an agent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with no wasted words. However, it is arguably too minimal, lacking details that could be added without much verbosity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema is provided, and the description does not mention what the status response looks like (e.g., fields, format). For a tool returning build status, this is a significant gap that leaves agents uninformed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% because both parameters have descriptions. The description adds no additional meaning beyond the schema, so it meets the baseline of 3 but does not exceed it.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'get' and the resource 'status of a Jenkins build', making the purpose explicit. It distinguishes from sibling tools like get_build_log and trigger_build by focusing on status retrieval.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description lacks explicit guidance on when to use this tool versus alternatives such as get_build_log or get_failed_build_log. The usage context is only implied through the tool's name and siblings, not stated directly.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_failed_build_logB
Get the console output of the last failed build for a given Jenkins job.
| Name | Required | Description | Default |
|---|---|---|---|
| jobPath | Yes | Path to the Jenkins job (e.g., "job/MyJob" or "view/xxx/job/MyJob") |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must fully disclose behavior. It does not mention what happens if no failed build exists (e.g., returns empty or null), whether the output is truncated, or if special authentication is needed. Basic read behavior is implied but edge cases are missing.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence that directly conveys the purpose. It is front-loaded and to the point. While some additional details could be added, it is not overly verbose and avoids redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has no output schema, so the description should clarify the return format (e.g., plain text, JSON). It does not mention error conditions or whether the output is always the full log. For a simple tool, more context about returned content is needed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the parameter jobPath is well-documented in the schema itself. The description does not add extra meaning or examples beyond the schema, so baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it retrieves the console output of the last failed build for a Jenkins job. The verb 'Get' and resource 'console output' are specific, and it distinguishes from siblings like get_build_log (any build) and get_build_status (status only).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. It does not specify that get_build_log should be used for arbitrary builds or that count_failed_jobs is for count. The description is purely functional without contextual advice.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_all_jobsA
List all Jenkins jobs with their name, URL, and last build status.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Description discloses the output fields but lacks details on error conditions, authentication requirements, or performance implications. Since annotations are absent, the description carries the full burden but only partially addresses behavioral transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single concise sentence that front-loads the core purpose. Every word is meaningful and there is no superfluous content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple list tool with no parameters and no output schema, the description covers the main functionality. It would benefit from mentioning if the list is paginated or ordered, but overall it is complete for typical use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist, so schema coverage is 100%. The baseline of 3 applies because the description adds no additional parameter information, which is adequate given the zero-parameter schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states it lists all Jenkins jobs and specifies the returned attributes (name, URL, last build status). This specific verb+resource definition distinguishes it from siblings like count_failed_jobs or trigger_build.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool versus alternatives. While the name implies it for a full list, there is no mention of when not to use it or how it compares to siblings like list_recent_failed_jobs.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_recent_failed_jobsB
List Jenkins jobs whose most recent build failed, sorted by most recent failure time.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of failed jobs to return |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, and the description lacks behavioral details such as read-only nature, authentication requirements, or response format. It only mentions sorting but not scope (only most recent build per job) or potential impacts.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no redundancy. However, it could include more useful information without significant lengthening.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of output schema and annotations, the description does not specify the return format or content (e.g., job names, URLs). This leaves the agent guessing what the response looks like.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% for the single 'limit' parameter with a clear description. The tool description adds no extra meaning beyond what the schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool lists Jenkins jobs with failed most recent builds, sorted by failure time. It differentiates from siblings like list_all_jobs and count_failed_jobs.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is for failed jobs but does not explicitly state when to use this over alternatives like list_all_jobs or count_failed_jobs. No exclusions or prerequisites mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
trigger_buildB
Trigger a new Jenkins build
| Name | Required | Description | Default |
|---|---|---|---|
| jobPath | Yes | Path to the Jenkins job | |
| parameters | Yes | Build parameters (optional) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must fully disclose behavior. It only states it triggers a build, but lacks details on idempotency, blocking, returned output, or side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, no redundancy. It is concise, but could add more detail without becoming verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema and two parameters (including a nested object), the description is too minimal. It fails to explain return values, authentication, or build lifecycle behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema descriptions already cover both parameters (jobPath, parameters). The description adds no extra meaning beyond 'trigger a build', so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Trigger') and resource ('Jenkins build'), clearly differentiating it from sibling tools that retrieve or manage builds.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives (e.g., get_build_status, list_all_jobs). No context about prerequisites or scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
8 tool updates
v0.1.0- First observed
count_failed_jobs - First observed
create_jenkins_user - First observed
get_build_log - First observed
get_build_status - First observed
get_failed_build_log - First observed
list_all_jobs - First observed
list_recent_failed_jobs - First observed
trigger_build
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.
Agentic CI operations for build inspection, failure diagnosis, and runner troubleshooting.
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.
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
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Jenkins CI jobs, including triggering and stopping builds, retrieving job details, and fetching build logs.-
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to access Jenkins job data, trigger builds, and manage Jenkins tasks through a standardized interface.5-