Sandbox
@lanbaoshen/mcp-jenkins

MCP server for Jenkins tools

This project exposes Jenkins as MCP tools so an agent can query jobs, builds, queues, nodes, plugins, and artifacts. It also supports build actions like triggering jobs, stopping builds, submitting pipeline input, and running Groovy scripts.

148 stars66 forksPythonUpdated 10d ago
Who it's for

Builders who want Claude Code, Copilot, or another MCP client to work with Jenkins state and actions.

What it delivers

You can ask your agent to inspect and control Jenkins instead of clicking through the Jenkins UI.

What it does

Jenkins job and build tools

Get items, queues, builds, parameters, console output, test reports, and artifacts through MCP calls.

Pipeline control

Trigger builds, stop running builds, inspect pending input steps, and submit or abort pipeline inputs.

Node, view, and plugin access

List Jenkins nodes and views, inspect plugins, see plugin updates and dependency graphs, and check plugin problems.

Groovy script execution

Run an arbitrary Groovy script on Jenkins when you need direct server-side access.

Multiple transports

Run it over stdio, SSE, or streamable HTTP for local use and remote setups.

Docker and health check support

Includes container files plus a `/healthz` endpoint for liveness and readiness probes.

How to get it

  1. 1Run the Jenkins MCP server with the following command
    uvx mcp-jenkins \
      --jenkins-url xxx \
      --jenkins-username xxx  \
      --jenkins-password xxx \
      --transport sse

README

MCP Jenkins

PyPI Version PyPI Downloads test codecov License

The Model Context Protocol (MCP) is an open-source implementation that bridges Jenkins with AI language models following Anthropic's MCP specification. This project enables secure, contextual AI interactions with Jenkins tools while maintaining data privacy and security.

Installation

Choose one of these installation methods:

# Using uv (recommended)
pip install uv
uvx mcp-jenkins

# Using pip
pip install mcp-jenkins
mcp-jenkins

# Docker
docker pull ghcr.io/lanbaoshen/mcp-jenkins:latest
docker run -p 9887:9887 --rm ghcr.io/lanbaoshen/mcp-jenkins:latest --transport streamable-http

Line Arguments

When using command line arguments, you can specify the Jenkins server details as follows:

# Simple streamable-http example
uvx mcp-jenkins --transport streamable-http
ArgumentDescriptionRequired
--env-filePath to a .env file to load configuration from. See Environment Variables / .env file below.No
--jenkins-urlThe URL of the Jenkins server. (Http app can set it via headers x-jenkins-url)No
--jenkins-usernameThe username for Jenkins authentication. (Http app can set it via headers x-jenkins-username)No
--jenkins-passwordThe password or API token for Jenkins authentication. (Http app can set it via headers x-jenkins-password)No
--jenkins-timeoutTimeout for Jenkins API requests in seconds. Default is 5 seconds.No
--jenkins-verify-ssl/--no-jenkins-verify-sslWhether to verify SSL certificates when connecting to Jenkins. Default is to verify.No
--jenkins-session-singleton/--no-jenkins-session-singletonWhether to use a singleton Jenkins client for all requests in the same session. Default is True.No
--read-onlyWhether to enable read-only mode. Default is FalseNo
--transportTransport method to use for communication. Options are stdio, sse or streamable-http. Default is stdio.No
--hostHost address for streamable-http transport. Default is 0.0.0.0No
--portPort number for streamable-http transport. Default is 9887.No

Environment Variables / .env file

Instead of passing credentials on the command line, you can set them as environment variables, or put them in a .env file:

JENKINS_URL=https://jenkins.example.com
JENKINS_USERNAME=alice
JENKINS_PASSWORD=xxxx
JENKINS_TIMEOUT=5
JENKINS_VERIFY_SSL=true

If a .env file is present in the current directory (or a parent directory), it is loaded automatically — no flag needed:

uvx mcp-jenkins --transport streamable-http

To load a .env file from a specific location, use --env-file:

uvx mcp-jenkins --env-file /path/to/.env --transport streamable-http

Values already set in the real environment take precedence over the .env file, and any --jenkins-* CLI flag takes precedence over both.

Configuration and Usage

Jetbrains Github Copilot

  1. Open Jetbrains Settings
  2. Navigate to Github Copilot > MCP > Configure
  3. Add the following configuration:
{
  "servers": {
    "my-mcp-server": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-jenkins",
        "--jenkins-url=xxx",
        "--jenkins-username=xxx",
        "--jenkins-password=xxx"
      ]
    }
  }
}

VSCode Copilot Chat

  1. Create .vscode folder with mcp.json file in you workspace for local setup or edit settings.json trough settings menu.
  2. Insert the following configuration:
  • SSE mode
{
    "servers": {
        "jenkins": {
            "url": "http://localhost:9887/sse",
            "type": "sse"
        }
    }
}
  • Streamable-Http mode
{
    "servers": {
        "mcp-jenkins-mcp": {
            "autoApprove": [],
            "disabled": false,
            "timeout": 60,
            "type": "streamableHttp",
            "url": "http://localhost:9887/mcp"
        }
    }
}

Run the Jenkins MCP server with the following command:

uvx mcp-jenkins \
  --jenkins-url xxx \
  --jenkins-username xxx  \
  --jenkins-password xxx \
  --transport sse

Health Check Endpoint

When running with --transport streamable-http or --transport sse, the server exposes a plain HTTP liveness endpoint:

GET /healthz  ->  200 OK

It always returns 200 and bypasses the x-jenkins-* auth headers, so it is safe to use directly as a Kubernetes liveness/readiness probe without any Jenkins credentials. Example probe:

livenessProbe:
  httpGet:
    path: /healthz
    port: 9887
  initialDelaySeconds: 5
  periodSeconds: 10

Note: this is a liveness check only — it does not verify connectivity to the upstream Jenkins server.

Available Tools

ToolDescription
get_itemGet a specific item by name.
get_item_configGet the configuration of a specific item.
get_item_parametersGet the parameters of a specific item.
get_all_itemsGet all items in Jenkins.
query_itemsQuery items based on pattern.
build_itemBuild a item.
get_all_nodesGet all nodes in Jenkins.
get_nodeGet a specific node by name.
get_node_configGet the configuration of a specific node.
get_all_queue_itemsGet all queue items in Jenkins.
get_queue_itemGet a specific queue item by ID.
cancel_queue_itemCancel a specific queue item by ID.
get_buildGet a specific build by job name and build number.
get_build_scriptsGet scripts associated with a specific build.
get_build_console_outputGet the console output of a specific build.
get_build_parametersGet the parameters of a specific build.
get_build_test_reportGet the test report of a specific build.
get_running_buildsGet all currently running builds in Jenkins.
stop_buildStop a specific build by job name and build number.
get_pending_inputsGet the pending input steps of a build paused for input.
submit_inputProceed with or abort a pipeline input step of a build.
get_all_build_artifactsList the artifacts of a specific build.
get_build_artifactDownload an artifact from a specific build.
get_build_artifact_urlGet the direct URL of an artifact from a specific build.
get_viewGet a specific view by name.
get_all_viewsGet the configuration of a specific view.
get_all_pluginsGet all installed plugins.
get_pluginGet a specific plugin by short name.
get_plugins_with_problemsGet plugins with problems (missing dependencies, version mismatch, etc.).
get_plugins_with_backupGet plugins that can be downgraded.
get_plugins_with_updatesGet plugins that have available updates.
get_plugin_dependency_graphGet dependency graph for a plugin in Graphviz format.
run_groovy_scriptExecute an arbitrary Groovy script on Jenkins.

Note: get_pending_inputs reads the wfapi endpoint served by the pipeline-rest-api plugin (bundled with pipeline-stage-view). submit_input only needs that plugin when input_id is omitted — pass input_id explicitly and it works on any Jenkins with the pipeline-input-step plugin.

Contributing

CONTRIBUTING.md

License

Licensed under MIT - see LICENSE file. This is not an official Jenkins product.

Star History

Star History Chart

Files in the repo

Repository payload14 top-level entries
  • .github
  • docker
  • src
  • tests
  • .gitignore
  • .gitmessage.txt
  • .pre-commit-config.yaml
  • AGENTS.md
  • CONTRIBUTING.md
  • LICENSE
  • pyproject.toml
  • README.md
  • SECURITY.md
  • uv.lock

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
tirth8205/
code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

31k
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k
t8y2/dbxConnectors

20 MB lightweight cross-platform database client for 90+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 90+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP Server。

19k