Labsco
lanbaoshen logo

MCP Jenkins

β˜… 130

from lanbaoshen

Enables secure, contextual AI interactions with Jenkins tools via the Model Context Protocol.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeNeeds API keys

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.

Line Arguments

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

Copy & paste β€” that's it
# Simple streamable-http example
uvx mcp-jenkins --transport streamable-http
ArgumentDescriptionRequired
--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

Health Check Endpoint

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

Copy & paste β€” that's it
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:

Copy & paste β€” that's it
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_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.

Contributing

CONTRIBUTING.md

License

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

Star History

Star History Chart