jenkins-server-mcp

grysonbaltazar/jenkins-server-mcp

3.2

If you are the rightful owner of jenkins-server-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

A Model Context Protocol (MCP) server designed to interact with Jenkins CI/CD servers, including CloudBees CI, providing a standardized interface for AI assistants to manage builds.

Tools
5
Resources
0
Prompts
0

Jenkins Server MCP

A Model Context Protocol (MCP) server that provides tools for interacting with Jenkins CI/CD servers (including CloudBees CI). This server enables AI assistants to check build statuses, trigger builds, stop builds, and retrieve build logs through a standardized interface.

Features

  • Get Build Status - Retrieve detailed build information including build number, status, timing, and results
  • Trigger Builds - Start builds with or without parameters (automatically detects build type)
  • Stop Builds - Stop currently running builds
  • List Builds - Get a list of recent builds for any job
  • Get Build Logs - Retrieve console output from builds
  • CloudBees CI Support - Works with both standard Jenkins and CloudBees CI

Installation

  1. Clone this repository:
git clone https://github.com/grysonbaltazar/jenkins-server-mcp.git
cd jenkins-server-mcp
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

The built server will be available at build/index.js.

Configuration

The server requires the following environment variables:

  • JENKINS_URL: The URL of your Jenkins server (e.g., https://jenkins.example.com)
  • JENKINS_USER: Jenkins username for authentication
  • JENKINS_TOKEN: Jenkins API token for authentication

Getting Your Jenkins API Token

  1. Log in to your Jenkins server
  2. Click your username in the top-right corner
  3. Click "Configure" (or go to User → Configure)
  4. Scroll down to the "API Token" section
  5. Click "Add new token" or "Generate"
  6. Give it a name (e.g., "mcp-server")
  7. Click "Generate" and copy the token immediately (it won't be shown again)

For Cursor IDE

Edit ~/.cursor/mcp_config.json (create it if it doesn't exist):

{
  "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"
      }
    }
  }
}

After saving the config file, restart Cursor for changes to take effect.

For Claude Desktop

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "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"
      }
    }
  }
}

After saving the config file, restart Claude Desktop for changes to take effect.

Tools and Usage

Once configured, you can use the Jenkins tools in your AI assistant:

1. Get Build Status

Get detailed status information about a Jenkins build, including build number, status, result, timing, and more.

2. Trigger Build

Trigger a new Jenkins build. Supports both parameterized and non-parameterized builds.

3. Stop Build

Stop a currently running Jenkins build.

4. List Builds

List recent builds for a Jenkins job.

5. Get Build Log

Retrieve the console output of a Jenkins build.

Development

Building

npm run build

Development with auto-rebuild

npm run watch

Debugging

Since MCP servers communicate over stdio, you can use the MCP Inspector for debugging:

npm run inspector

This will provide a URL to access debugging tools in your browser.

License

This project is licensed under the MIT License - see the file for details.