DEV Community

Cover image for Using Jenkins MCP to speed up DevOps workflows
Aryan Patel
Aryan Patel

Posted on

Using Jenkins MCP to speed up DevOps workflows

Lately, I've been trying to find ways to speed up handling incident response in my squad.

This has led me to explore Skills and MCP in coding agents. We use IBM Bob, though everything in this article will hold for other popular agents out there.

We use Jenkins to run all our automations. Setting up a Jenkins MCP server for Bob seemed like a natural next step.

The MCP server lets us query job information in natural language, eliminating the need to navigate the Jenkins UI. It also opens up avenues of creating agent skills that can use the MCP tools to automate repeatable workflows

Pre-requisites

To get started with Jenkins MCP, you'll need the following:

  • Jenkins server
  • Jenkins API token
  • Coding agent of choice

Steps

Installing the Jenkins MCP server plugin

Follow the steps mentioned in https://plugins.jenkins.io/mcp-server.

Once installed, the plugin should appear under the list of installed plugins in the UI. No other setting needs to be configured.

Screenshot showing the MCP plugin in Jenkins UI

Configuring MCP settings in Agent

Open the Global MCP settings of your coding agent. For Bob, this file is located at <user>/.bob/settings/mcp_settings.json. We need to add the following entry to the file:

"jenkins": {
    "type": "streamable-http",
    "url": "https://<server-url>/mcp-server/mcp",
    "headers": {
        "Authorization": "Basic <base64 encoded username:password>"
    },
    "disabled": false,
}
Enter fullscreen mode Exit fullscreen mode

(Optional) Configuring allowed tools

You can optionally enable or disable tools supported by the MCP server in your Agent. List of tools can be found at https://plugins.jenkins.io/mcp-server/#plugin-content-available-tools.

To achieve this, either update mcp_settings.json file with the following:

"disabledTools": [
    "triggerBuild",
    "updateBuild",
    "replayBuild",
    "rebuildBuild"
]
Enter fullscreen mode Exit fullscreen mode

or simply toggle the settings in your agent's MCP UI. For Bob, it's available at Settings > MCP > jenkins.

Bob UI showing MCP tools

MCP in action

Here's an example Bob session using MCP tools to debug a Jenkins job failure:

Prompt to debug a job failure, 1/2

Prompt to debug a job failure, 2/2

Caveats and Final Thoughts

MCP servers can rapidly consume tokens if not used efficiently. While I'll explore optimization techniques in a future article, there's a broader principle worth noting: don't use AI agents for tasks that can be automated. Instead, leverage the coding agent to create scripts that handle repetitive work. Beyond token efficiency, there's a broader principle to consider: it's tempting to use LLMs as a catch-all solution, but this often leads to suboptimal results. These are powerful tools, and learning to use them effectively is a skill worth developing.

Top comments (0)