Jenkins (MCP)¶
The Jenkins MCP Server Plugin enables Holmes to interact with your Jenkins CI/CD infrastructure.
Prerequisites¶
- A running Jenkins instance with the MCP Server Plugin installed
- A Jenkins API token for authentication
- Network connectivity from Holmes to the Jenkins MCP endpoint
Installing the Jenkins MCP Plugin:
- In Jenkins, go to Manage Jenkins → Plugins → Available plugins
- Search for "MCP Server" and install it
- Restart Jenkins if required
Creating a Jenkins API Token:
- Sign in to Jenkins
- Click your username in the upper-right corner → Security
- Under API Token, click Add new Token
- Enter a descriptive name and click Generate
- Copy the token immediately (it won't be shown again)
- Click Save
Encoding credentials for Basic authentication:
The Jenkins MCP server uses HTTP Basic authentication. Encode your credentials:
Store the encoded credential securely for use in the configuration below.
Configuration¶
Add the following to ~/.holmes/config.yaml. Create the file if it doesn't exist:
mcp_servers:
jenkins:
description: "Jenkins CI/CD server"
config:
url: "https://your-jenkins-instance/mcp-server/mcp"
mode: streamable-http
headers:
Authorization: "Basic <base64_encoded_credentials>"
verify_ssl: false # Set to true if using valid SSL certificates
icon_url: "https://cdn.simpleicons.org/jenkins/D24939"
llm_instructions: |
When investigating build failures, start with recent build status and then examine console output.
Use pagination for large result sets to avoid token overflow.
Replace <base64_encoded_credentials> with your encoded username:api_token.
After making changes to your configuration, run:
Create Kubernetes Secret:
# Encode your credentials
JENKINS_AUTH=$(echo -n "username:api_token" | base64)
# Create the secret
kubectl create secret generic jenkins-credentials \
--from-literal=token="$JENKINS_AUTH" \
-n <namespace>
Configure Helm Values:
# values.yaml
additionalEnvVars:
- name: JENKINS_AUTH_TOKEN
valueFrom:
secretKeyRef:
name: jenkins-credentials
key: token
mcp_servers:
jenkins:
description: "Jenkins CI/CD server"
config:
url: "https://your-jenkins-instance/mcp-server/mcp"
mode: streamable-http
headers:
Authorization: "Basic {{ env.JENKINS_AUTH_TOKEN }}"
verify_ssl: false
icon_url: "https://cdn.simpleicons.org/jenkins/D24939"
llm_instructions: |
When investigating build failures, start with recent build status and then examine console output.
Use pagination for large result sets to avoid token overflow.
Then deploy or upgrade your Holmes installation:
Create Kubernetes Secret:
# Encode your credentials
JENKINS_AUTH=$(echo -n "username:api_token" | base64)
# Create the secret
kubectl create secret generic jenkins-credentials \
--from-literal=token="$JENKINS_AUTH" \
-n <namespace>
Configure Helm Values:
# generated_values.yaml
holmes:
additionalEnvVars:
- name: JENKINS_AUTH_TOKEN
valueFrom:
secretKeyRef:
name: jenkins-credentials
key: token
mcp_servers:
jenkins:
description: "Jenkins CI/CD server"
config:
url: "https://your-jenkins-instance/mcp-server/mcp"
mode: streamable-http
headers:
Authorization: "Basic {{ env.JENKINS_AUTH_TOKEN }}"
verify_ssl: false
icon_url: "https://cdn.simpleicons.org/jenkins/D24939"
llm_instructions: |
When investigating build failures, start with recent build status and then examine console output.
Use pagination for large result sets to avoid token overflow.
Then deploy or upgrade your Robusta installation:
MCP endpoint path
The Jenkins MCP server serves on /mcp-server/mcp for Streamable HTTP transport. Other available endpoints:
- Streamable HTTP:
/mcp-server/mcp(recommended) - SSE:
/mcp-server/sse - Stateless:
/mcp-server/stateless
Testing the Connection¶
Common Use Cases¶
Investigate a failed build:
Check build status:
View build logs:
Monitor pipeline stages:
Check queue status:
Analyze build trends:
Troubleshooting¶
Authentication Errors
If you receive 401 or 403 errors:
- Verify your API token is valid and not expired
- Ensure the credentials are properly base64 encoded (username:token format)
- Check that the Jenkins user has appropriate permissions
Connection Issues
If Holmes cannot connect to Jenkins:
- Verify the Jenkins URL is accessible from the Holmes pod/container
- Check if SSL certificate verification is causing issues (
verify_ssl: falsefor self-signed certs) - Ensure the MCP Server plugin is installed and enabled in Jenkins
Plugin Not Found
If the /mcp-server/mcp endpoint returns 404:
- Verify the MCP Server plugin is installed in Jenkins
- Restart Jenkins after plugin installation
- Check Jenkins system logs for plugin errors