Jenkins Task Automation MCP Server
Automate Jenkins task creation with this MCP server to streamline CI/CD workflows, schedule jobs, and manage pipelines efficiently.
npx -y @jasonkylelol/jenkins-mcp-serverOverview
This MCP (Model Context Protocol) server provides a simple HTTP bridge between LLM-driven orchestrators and Jenkins. It exposes Jenkins task and pipeline operations through an MCP-compatible API so automated agents, chatbots, or other workflow systems can create, update, schedule, and manage Jenkins jobs programmatically. By packaging Jenkins interactions behind a predictable JSON interface, it reduces the friction of integrating CI/CD control into AI-assisted automation flows.
The server is intended for developer tooling and productivity workflows: orchestrators send MCP-style action requests (tool name + structured input), and the server translates them into Jenkins API calls. This lets you automate job creation, pipeline deployment, and scheduled runs without embedding Jenkins credentials into the orchestrator itself, and makes it easier to add safety, logging, and validation around automated changes to your CI/CD system.
Features
- Exposes Jenkins operations via an MCP-compatible HTTP endpoint
- Create, update, and delete Jenkins jobs and pipelines
- Schedule or trigger job builds (one-shot or recurring)
- Translate MCP tool requests into Jenkins REST API calls
- Configurable Jenkins credentials and base URL via environment variables
- Health and readiness endpoints for orchestration monitoring
- JSON-based request/response format suitable for LLM tool integrations
Installation / Configuration
Below are common ways to run the server. The exact commands may vary depending on the repository version; adjust paths and filenames as needed.
Clone the repository:
Run with Docker:
# Build (if Dockerfile is present)
# Run container (example)
Run locally (Node example):
# Install dependencies (if Node)
# Environment variables (example .env or shell export)
# Start
Environment variables (example)
| Variable | Description | Required |
|---|---|---|
| JENKINS_URL | Base URL of your Jenkins instance (https://jenkins.example.com) | Yes |
| JENKINS_USER | Jenkins username with API access | Yes |
| JENKINS_TOKEN | Jenkins API token or password | Yes |
| PORT | Port for the MCP server (default: 8080) | No |
Available Resources
Common HTTP endpoints and payload shapes used by the server.
- POST /mcp
- Accepts MCP-style JSON requests to invoke tools. Body typically includes action/tool name and structured input.
- GET /health
- Returns simple status for orchestration readiness.
- GET /metrics (optional)
- Exposes basic metrics if enabled (request count, errors).
Typical MCP request format (JSON):
Typical MCP response format (JSON):
Use Cases
Create a new Jenkins job from an LLM workflow
- An LLM suggests a pipeline for a new repository. The orchestrator sends a
jenkins.create_jobMCP request with the job name and Jenkins XML config. The server creates the job and returns its URL for verification.
Example curl:
- An LLM suggests a pipeline for a new repository. The orchestrator sends a
Schedule recurring builds
- Convert a natural-language schedule into a cron expression in your orchestrator, then call
jenkins.update_jobwith the schedule field. The MCP server updates the job configuration and enables scheduled builds.
- Convert a natural-language schedule into a cron expression in your orchestrator, then call
Trigger on-demand pipeline runs
- Use
jenkins.trigger_buildto start an immediate build of a pipeline as part of a deployment or rollback workflow, returning build number and status URL for downstream steps.
- Use
Automate pipeline updates during PR merges
- Upon merging a PR, an automation tool can send an MCP request to update pipeline definitions or environment variables in Jenkins to reflect new configuration or promote artifacts.
Secure agent-driven CI changes
- Agents or tools with limited access can call the MCP server instead of Jenkins directly. The server centralizes credential usage and can enforce validations, audit logs, and policy checks before performing Jenkins operations.
Notes for Developers
- Validate and sanitize incoming MCP payloads before forwarding to Jenkins; treat automation requests as privileged.
- Keep Jenkins credentials secure. Use secrets management or container orchestration secret stores where possible.
- Monitor the /health endpoint from your orchestrator to avoid sending requests when the server is unhealthy.
- If you need custom operations, extend the server’s tool mappings to translate new MCP tool names into Jenkins REST API calls.