Supports Docker integration for building and testing environments, with specific commands for building Docker images and running tests in containerized environments.
Allows interaction with Jenkins CI/CD platform, enabling triggering of jobs, retrieving build statuses, and performing other Jenkins operations through the MCP interface.
mcp_jenkins
A Jenkins MCP server. Model Context Protocol (MCP) lets AI tools (like chatbots) talk to and control your Jenkins setup, i. e. retrieve information and modify settings.
Note: This is a minimal experimental version of the MCP Jenkins server and is currently in early development.
Description
This project provides a Model Context Protocol (MCP) server for interacting with Jenkins. It allows users to trigger Jenkins jobs, get build statuses, and perform other Jenkins-related operations through the MCP interface.
Components
server.py
: The core MCP Jenkins server application.functions_schema.md
: Defines the schema for the functions exposed by the MCP Jenkins server.client.py
: An example client demonstrating how to interact with the MCP Jenkins server (provided for reference only).functional tests
: Contains functional tests for the MCP Jenkins server.
Installation
To install the package, run:
Usage
Common Workflows
Running the Server
To run the MCP server:
Running the Example Client
To run the example client:
For example, to list builds for a job named "backups" using a specific model, you can run:
Note: If the package is installed via pip install .
, the mcp_jenkins_client
console script is also available.
This might produce output similar to:
Building and Testing with Docker
A common workflow for development and testing is to first build the Docker image and then execute the tests:
- Build the Docker image:
This step prepares the environment needed for testing.
- Run tests:
After the build is complete, execute the tests.
This sequence ensures that tests are performed against the latest build in a consistent Dockerized environment.
Deploying a Test Environment
To deploy a local Jenkins testing instance (without authentication, for functional tests only):
Connecting to an Existing Jenkins Instance
To use the MCP Jenkins server with an existing Jenkins instance, you need to configure the following environment variables:
JENKINS_URL
: The full URL of your Jenkins instance (e.g.,http://your-jenkins-host:8080
). This is required.JENKINS_USER
: (Optional) Your Jenkins username if authentication is required.JENKINS_API_TOKEN
: (Optional) Your Jenkins API token. This must be provided along withJENKINS_USER
if authentication is used. You can generate an API token in your Jenkins user's configuration page (<Jenkins URL>/me/configure
).MCP_API_KEY
: A secret API key to secure this MCP server. Requests to the MCP server will need to include this key in theX-API-Key
header. This is required unlessDEBUG_MODE
is set totrue
.DEBUG_MODE
: Set totrue
to run the MCP server in debug mode, which bypasses theMCP_API_KEY
requirement and provides more verbose logging. Do not use in production.
Example Configuration (Bash):
Once these environment variables are set, you can run the MCP server using the Docker script:
The MCP server will then attempt to connect to your specified Jenkins instance.
OpenWebUI Integration
The file open-webui/open_webui_interface.py
provides an example of how to integrate this MCP Jenkins server with an OpenWebUI instance.
To use it:
- In your OpenWebUI interface, navigate to the section for adding or configuring tools.
- Create a new tool.
- Copy the entire content of the
open-webui/open_webui_interface.py
file and paste it into the tool configuration in OpenWebUI. - Important: You will need to adjust the connection parameters within the pasted code, specifically:
MCP_JENKINS_SERVER_URL
: Set this environment variable in your OpenWebUI environment to the URL of your running MCP Jenkins server (e.g.,http://localhost:5000
). The script defaults tohttp://localhost:5000
if the variable is not set.MCP_API_KEY
: If your MCP Jenkins server is configured to require an API key, ensure this environment variable is set in your OpenWebUI environment. The script will print a warning if it's not found but will still attempt to make requests.
Once configured, the tools defined in open_webui_interface.py
(e.g., list_jobs
, trigger_build
, get_build_status
) should become available for use within your OpenWebUI chat interface.
License
This project is licensed under the MIT License.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A Model Context Protocol (MCP) server that enables AI tools like chatbots to interact with and control Jenkins, allowing users to trigger jobs, check build statuses, and perform other Jenkins operations through natural language.
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that enables AI assistants to interact with Jenkins CI/CD servers, providing tools to check build statuses, trigger builds, and retrieve build logs.Last updated -3JavaScriptMIT License
- AsecurityAlicenseAqualityA server that uses the Model Context Protocol (MCP) to allow AI agents to safely execute shell commands on a host system.Last updated -1762TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol (MCP) server that enables real-time, interactive AI chat with Selector AI through a streaming-capable server and Docker-based client communicating via stdin/stdout.Last updated -1PythonApache 2.0
- -securityAlicense-qualityThe Model Context Protocol (MCP) Jenkins integration 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.Last updated -19PythonMIT License