home / mcp / jenkins mcp server
Provides tools to check Jenkins build status, trigger builds, and fetch build logs via MCP
Configuration
View docs{
"mcpServers": {
"hekmon8-jenkins-server-mcp": {
"command": "node",
"args": [
"/path/to/jenkins-server-mcp/build/index.js"
],
"env": {
"JENKINS_URL": "https://your-jenkins-server.com",
"JENKINS_USER": "your-username",
"JENKINS_TOKEN": "your-api-token"
}
}
}
}You can interact with a Jenkins CI/CD server through a dedicated MCP (Model Context Protocol) server. This MCP exposes tools to check build statuses, trigger builds, and retrieve build logs in a standardized way, making it easy to integrate Jenkins automation into AI assistants and workflow automations.
Use an MCP client to connect to the Jenkins MCP server and call its built-in tools. You can check the current status of a Jenkins job, trigger new builds with parameters, and retrieve the console output for debugging. Each action is exposed as a tool you can invoke through the MCP interface, using the job path and optional build identifiers or parameters to tailor the operation.
# Prerequisites
- Ensure you have Node.js and npm installed. You can verify with:
node -v
npm -v
# 1. Clone the repository
git clone https://github.com/hekmon8/jenkins-server-mcp.git
cd jenkins-server-mcp
# 2. Install dependencies
npm install
# 3. Build the project
npm run buildConfigure the Jenkins MCP server by setting environment variables for Jenkins access. The MCP server expects the Jenkins URL, username, and API token so it can perform actions on your Jenkins instance.
{
"mcpServers": {
"jenkins-server": {
"command": "node",
"args": ["/path/to/jenkins-server-mcp/build/index.js"],
"env": {
"JENKINS_URL": "https://your-jenkins-server.com",
"JENKINS_USER": "your-username",
"JENKINS_TOKEN": "your-api-token"
}
}
}
}Protect your Jenkins credentials. Use a dedicated Jenkins account with scoped permissions and store the API token securely. Limit the MCP server’s access to only the necessary Jenkins projects and jobs.
If you encounter connectivity or authentication issues, verify that the Jenkins URL is reachable from the MCP host and that the provided credentials have the required permissions. Check that the MCP server process has access to the build script at the specified path and that the build tool can reach your Jenkins instance.
npm run watch
```
```bash
npm run inspector
`Retrieves the status of a specific Jenkins build given a job path and optional build number or lastBuild placeholder.
Triggers a new Jenkins build for a given job path with optional build parameters (e.g., BRANCH, BUILD_TYPE).
Fetches the console output for a specified Jenkins build, with support for lastBuild or a specific build number.