Jenkins MCP Server
Integrate with Jenkins CI/CD pipelines through your AI assistant - trigger builds, check status, and manage jobs.
Jenkins MCP Server
This page documents the community server lanbaoshen/mcp-jenkins. It is published on PyPI as mcp-jenkins and as the container image ghcr.io/lanbaoshen/mcp-jenkins.
The server bridges Jenkins with MCP clients, covering jobs, builds, queues, nodes, views, and plugins.
What it Does
- Job inspection: List and query items, read item configuration and parameters
- Build control: Trigger builds, stop builds, and inspect running builds
- Log access: Retrieve build console output
- Queue management: List, inspect, and cancel queue items
- Node and view inspection: List nodes, node configuration, and views
- Plugin inspection: List installed plugins and available updates
Installation
# Using uv (recommended)
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
Configuration
{
"mcpServers": {
"jenkins": {
"command": "uvx",
"args": ["mcp-jenkins"],
"env": {
"JENKINS_URL": "https://jenkins.example.com",
"JENKINS_USERNAME": "alice",
"JENKINS_PASSWORD": "your-api-token"
}
}
}
}
JENKINS_PASSWORD accepts a password or an API token. The server also supports JENKINS_TIMEOUT and JENKINS_VERIFY_SSL.
Available Tools
| Tool | Purpose | Category |
|---|---|---|
get_all_items | Get all items in Jenkins | Jobs |
get_item | Get a specific item by name | Jobs |
get_item_config | Get the configuration of an item | Jobs |
get_item_parameters | Get the parameters of an item | Jobs |
query_items | Query items based on a pattern | Jobs |
build_item | Build an item | Builds |
get_build | Get a build by job name and build number | Builds |
get_build_console_output | Get the console output of a build | Debugging |
get_running_builds | Get all currently running builds | Builds |
stop_build | Stop a build | Builds |
get_all_nodes | Get all nodes in Jenkins | Infrastructure |
get_node | Get a specific node by name | Infrastructure |
get_node_config | Get the configuration of a node | Infrastructure |
get_all_queue_items | Get all queue items | Queue |
get_queue_item | Get a queue item by ID | Queue |
cancel_queue_item | Cancel a queue item by ID | Queue |
get_all_views | Get all views | Views |
get_all_plugins | Get all installed plugins | Plugins |
get_plugins_with_updates | Get plugins with available updates | Plugins |
The full tool list is in the upstream README.
Common Workflows
Debugging a Failed Build
- Use
get_all_itemsorquery_itemsto find the job - Use
get_buildto get the failed build - Use
get_build_console_outputto retrieve the console log - Ask "Summarize what caused this build failure based on the log"
Monitoring Running Builds
- Use
get_running_buildsto list active builds - Use
get_all_queue_itemsto check queued items - Use
get_buildto inspect a specific build - Use
get_build_console_outputfor progress details - Notify the team when the build completes
Jenkins Health Check
- Use
get_all_nodesto list agent nodes - Use
get_nodeandget_node_configto inspect a specific node - Use
get_plugins_with_updatesto review available updates - Generate a Jenkins infrastructure health report
Example Prompts
- "Show me the last 5 builds for the api-service job"
- "Why did build #1234 fail?"
- "Trigger the deploy-to-staging job"
- "Show the console output for the latest build"
- "List all items in the frontend folder"
- "Which Jenkins agents are currently offline?"
Troubleshooting
| Issue | Likely Cause | Solution |
|---|---|---|
| "Connection refused" | Jenkins URL is unreachable | Verify JENKINS_URL and network connectivity |
| "Authentication failed" | Invalid username, password, or API token | Set JENKINS_USERNAME and JENKINS_PASSWORD; use an API token if required |
| TLS certificate error | Jenkins uses a certificate the client does not trust | Set JENKINS_VERIFY_SSL=false |
| Request timeout | Jenkins API is slow | Increase JENKINS_TIMEOUT |
| Job not found | Wrong job name or path | Use get_all_items or query_items to verify the item name |
Security Notes
- Use an API token instead of a password
- Keep certificate verification enabled unless you have a specific reason to disable it
- Use a dedicated Jenkins account with minimal permissions
- Use HTTPS for the Jenkins URL
Sources
Related Articles & Guides
Accessibility Scanner MCP Server
Accessibility Scanner MCP servers enable AI models to perform WCAG compliance checks, capture annotated screenshots, and generate detailed accessibility reports.
Auth0 MCP Server
Auth0 MCP server enables AI models to interact with Auth0 identity and access management, including applications, APIs, actions, logs, and forms.
AWS MCP Server
Interact with Amazon Web Services through your AI assistant using the AWS API MCP Server.