Skip to main content
Glama
Jenkins MCP Server

Jenkins MCP Server

by kud

TypeScript Node.js npm MIT

Jenkins MCP server with bearer token authentication support

Website · Documentation

Features

  • 39 tools — covers ~95% of the Jenkins API: jobs, builds, nodes, views, queue, plugins, and system operations

  • Bearer token auth — supports both classic API token and modern bearer token authentication

  • Multiple instances — connect to several Jenkins servers simultaneously using comma-separated env vars

  • Pipeline awareness — retrieve stage-by-stage pipeline status, console logs, test results, and build artefacts

  • Failure diagnosis — jenkins_diagnose_build reads a failed build in one screen: failing stages, the error lines from their logs, report links and failed tests

  • Node management — list agents, toggle nodes online/offline, and inspect system info without leaving your AI client

  • Zero-install usage — run directly via npx --yes @kud/mcp-jenkins@latest with no local setup required

Related MCP server: host-mcp-jenkins

Install

npm install -g @kud/mcp-jenkins

Or use without installing via npx (see Usage below).

Usage

Add the server to your MCP client config. The recommended approach uses environment variables:

{
  "mcpServers": {
    "jenkins": {
      "command": "npx",
      "args": ["--yes", "@kud/mcp-jenkins@latest"],
      "env": {
        "MCP_JENKINS_URL": "https://pipeline.yourcompany.com",
        "MCP_JENKINS_USER": "your_username",
        "MCP_JENKINS_API_TOKEN": "your_api_token"
      }
    }
  }
}

For bearer token authentication, replace the env block with:

"env": {
  "MCP_JENKINS_URL": "https://pipeline.yourcompany.com",
  "MCP_JENKINS_BEARER_TOKEN": "your_bearer_token"
}

Slow instances

Every request this server makes is bounded by one deadline, 30 seconds by default. A large or busy Jenkins can spend even longer answering a single call. When that happens, the error you see (Jenkins request timed out) comes from this server giving up, not from Jenkins refusing anything.

Raise it with MCP_JENKINS_TIMEOUT_MS:

"env": {
  "MCP_JENKINS_URL": "https://pipeline.yourcompany.com",
  "MCP_JENKINS_BEARER_TOKEN": "your_bearer_token",
  "MCP_JENKINS_TIMEOUT_MS": "60000"
}

Or on the command line:

mcp-jenkins --url https://pipeline.yourcompany.com --bearer-token abc123 --timeout-ms 60000

One value applies to every configured instance. To find out what your instance actually needs, time the call the server makes:

time curl -u user:token 'https://pipeline.yourcompany.com/job/my-job/api/json'

Environment variables

Variable

Description

Default

MCP_JENKINS_URL

Jenkins server URL. Comma-separated to connect to several instances.

Required

MCP_JENKINS_USER

Username for Basic auth, positional alongside the URL values.

None

MCP_JENKINS_API_TOKEN

API token for Basic auth, positional alongside the URL values.

None

MCP_JENKINS_BEARER_TOKEN

Bearer token for token-based auth, instead of Basic auth.

None

MCP_JENKINS_ANONYMOUS

true for a Jenkins instance that needs no authentication.

false

MCP_JENKINS_TIMEOUT_MS

Per-request deadline in milliseconds, applied to every instance.

30000

MCP_JENKINS_INSTANCES

Comma-separated instance names, pairing each name with a URL position.

Hostname per URL

MCP_JENKINS_ALLOW_TOOLS

Comma-separated tool names: expose only these tools.

All tools

MCP_JENKINS_BLOCK_TOOLS

Comma-separated tool names: hide these tools (ignored when the allowlist is set).

All tools

Tools

Category

Tools

Job operations

jenkins_list_jobs, jenkins_search_jobs, jenkins_get_job_status, jenkins_get_job_parameters, jenkins_enable_job, jenkins_disable_job, jenkins_delete_job, jenkins_get_job_config, jenkins_create_job, jenkins_update_job_config, jenkins_rename_job, jenkins_copy_job

Build operations

jenkins_get_build_status, jenkins_get_recent_builds, jenkins_trigger_build, jenkins_stop_build, jenkins_delete_build, jenkins_replay_build, jenkins_get_console_log, jenkins_get_build_changes, jenkins_get_pipeline_stages, jenkins_diagnose_build

Testing & artefacts

jenkins_get_test_results, jenkins_list_artifacts, jenkins_get_artifact

Queue management

jenkins_get_queue, jenkins_cancel_queue

System & nodes

jenkins_list_nodes, jenkins_get_node, jenkins_toggle_node_offline, jenkins_get_system_info, jenkins_get_version, jenkins_get_plugins, jenkins_quiet_down, jenkins_cancel_quiet_down

Views

jenkins_list_views, jenkins_get_view

Instances & admin

jenkins_list_instances, jenkins_safe_restart

Development

git clone https://github.com/kud/mcp-jenkins.git
cd mcp-jenkins
npm install
npm run dev

To test interactively with the MCP Inspector:

npm run inspect:dev

📚 Full documentation → mcp-jenkins/docs

Available Tools

38 tools
jenkins_cancel_queueA
Destructive

Cancel a queued build by queue ID

Inputs: queueId (required), instance.

jenkins_cancel_quiet_downB

Cancel Jenkins quiet mode and resume accepting new builds

Inputs: instance.

jenkins_copy_jobB

Copy/duplicate a Jenkins job under a new name

Inputs: newName (required), fromName (required), instance.

jenkins_create_jobB

Create a new Jenkins job from an XML configuration

Inputs: jobName (required), configXml (required), instance.

jenkins_delete_buildB
Destructive

Delete a specific build

Inputs: jobName (required), buildNumber (required), instance.

jenkins_delete_jobA
Destructive

Permanently delete a job (WARNING: cannot be undone)

Inputs: jobName (required), instance.

jenkins_disable_jobB
Destructive

Disable a job to prevent it from running

Inputs: jobName (required), instance.

jenkins_enable_jobB

Enable a disabled job

Inputs: jobName (required), instance.

jenkins_get_artifactA
Read-onlyIdempotent

Download a specific artifact from a build (returns base64-encoded content)

Inputs: jobName (required), buildNumber (required), relativePath (required), instance.

jenkins_get_build_changesB
Read-onlyIdempotent

Get Git commits/changes for a build

Inputs: jobName (required), buildNumber (required), instance.

jenkins_get_build_statusB
Read-onlyIdempotent

Get detailed status of a specific build number for a job

Inputs: jobName (required), buildNumber (required), instance.

jenkins_get_console_logA
Read-onlyIdempotent

Get console log output from a build. Returns both a snippet and full log.

Inputs: jobName (required), instance, buildNumber.

jenkins_get_job_configA
Read-onlyIdempotent

Get job configuration XML

Inputs: jobName (required), instance.

jenkins_get_job_parametersA
Read-onlyIdempotent

Get the parameter definitions for a parameterised Jenkins job — names, types, defaults, and choices

Inputs: jobName (required), instance.

jenkins_get_job_statusA
Read-onlyIdempotent

Get the status of the last build for a specific job

Inputs: jobName (required), instance.

jenkins_get_nodeA
Read-onlyIdempotent

Get detailed information about a specific Jenkins node/agent

Inputs: nodeName (required), instance.

jenkins_get_pipeline_stagesA
Read-onlyIdempotent

Get pipeline stages and their status for a build

Inputs: jobName (required), buildNumber (required), instance.

jenkins_get_pluginsA
Read-onlyIdempotent

List all installed Jenkins plugins

Inputs: instance.

jenkins_get_queueB
Read-onlyIdempotent

Get the current build queue showing pending builds

Inputs: instance.

jenkins_get_recent_buildsA
Read-onlyIdempotent

Get recent builds for a job with their status and metadata

Inputs: jobName (required), limit, instance.

jenkins_get_system_infoA
Read-onlyIdempotent

Get Jenkins system information

Inputs: instance.

jenkins_get_test_resultsA
Read-onlyIdempotent

Get test results for a build (pass/fail counts, test suites)

Inputs: jobName (required), buildNumber (required), instance.

jenkins_get_versionC
Read-onlyIdempotent

Get Jenkins version

Inputs: instance.

jenkins_get_viewB
Read-onlyIdempotent

Get details and job list for a specific Jenkins view

Inputs: viewName (required), instance.

jenkins_list_artifactsA
Read-onlyIdempotent

List all artifacts produced by a specific build

Inputs: jobName (required), buildNumber (required), instance.

jenkins_list_instancesA
Read-onlyIdempotent

List all configured Jenkins instances with their names and URLs

Inputs: instance.

jenkins_list_jobsA
Read-onlyIdempotent

List all Jenkins jobs with their names and URLs

Inputs: instance.

jenkins_list_nodesA
Read-onlyIdempotent

List all Jenkins nodes/agents and their status

Inputs: instance.

jenkins_list_viewsA
Read-onlyIdempotent

List all Jenkins views with their jobs

Inputs: instance.

jenkins_quiet_downA
Destructive

Put Jenkins into quiet mode — no new builds will start until cancelled (requires confirm: true)

Inputs: confirm (required), reason, instance.

jenkins_rename_jobB
Destructive

Rename a Jenkins job

Inputs: jobName (required), newName (required), instance.

jenkins_replay_buildA

Replay/rerun a pipeline build, optionally with a modified pipeline script

Inputs: jobName (required), buildNumber (required), instance, mainScript.

jenkins_safe_restartA
Destructive

Safely restart Jenkins — waits for running builds to finish before restarting (requires confirm: true)

Inputs: confirm (required), instance.

jenkins_search_jobsA
Read-onlyIdempotent

Search for Jenkins jobs by name (case-insensitive substring match)

Inputs: query (required), instance.

jenkins_stop_buildA
Destructive

Stop/abort a running build

Inputs: jobName (required), buildNumber (required), instance.

jenkins_toggle_node_offlineB
Destructive

Toggle a Jenkins node/agent between online and offline

Inputs: nodeName (required), instance, offlineMessage.

jenkins_trigger_buildB

Trigger a new build for a job, optionally with parameters

Inputs: jobName (required), params, instance.

jenkins_update_job_configA
Destructive

Update an existing job's XML configuration

Inputs: jobName (required), configXml (required), instance.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 38 tools

    Disambiguation5/5

    Each tool targets a distinct Jenkins resource or action (e.g., jobs, builds, nodes, views), with clear boundaries. Overlap like get_build_status vs get_job_status is resolved by explicit parameter differences.

    Naming Consistency5/5

    All tools follow the consistent pattern 'jenkins_verb_noun' (e.g., jenkins_create_job, jenkins_list_jobs), with no mixing of conventions or ambiguous verbs.

    Tool Count3/5

    38 tools is significantly above the typical well-scoped range of 3-15. While Jenkins is complex and many tools are justified, the count feels heavy and could overwhelm agents.

    Completeness3/5

    Core operations for jobs and builds are covered, but notable gaps exist: no create/delete for nodes or views, and missing build triggers. This leaves some workflows incomplete.

    Maintenance

    ActivityActive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers