home / mcp / jenkins mcp server

Jenkins MCP Server

An MCP server for interacting with a Jenkins server. Allows you to trigger jobs, check build statuses, and manage your Jenkins instance through MCP.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ashwinighuge3012-jenkins-mcp-server": {
      "command": "jenkins-mcp",
      "args": [],
      "env": {
        "JENKINS_URL": "http://your-jenkins-server:8080",
        "JENKINS_USER": "your-username",
        "JENKINS_API_TOKEN": "your-api-token"
      }
    }
  }
}

You deploy and run a production-ready MCP server to manage Jenkins CI/CD workflows through a programmable API. This server lets AI assistants and automation tools trigger jobs, monitor builds, fetch logs, manage artifacts, and perform advanced queries against your Jenkins instance in a scalable, secure way.

How to use

You run the MCP server locally or in your environment and connect your MCP client to it. Use the provided tools to trigger jobs, check build statuses, stream console logs, manage artifacts, and monitor queues. If you enable HTTP transport, you can expose the MCP API over HTTP for integration with gateways or webhooks. The server handles authentication, validation, and retries to ensure reliable interactions with Jenkins.

How to install

Prerequisites: Node.js 14.0.0 or higher, Python 3.12 or higher, and Jenkins 2.401+ with an API token.

# Global installation (recommended)
npm install -g @ashwinighuge/jenkins-mcp-server

# Or use directly with npx
npx @ashwinighuge/jenkins-mcp-server --help

Configuration and start guidance

Configure access to Jenkins by setting the required environment variables when you start the server. The MCP server reads Jenkins connection details from these variables and uses them to authenticate and interact with Jenkins.

# Claude Desktop integration snippet
{
  "mcpServers": {
    "jenkins": {
      "command": "jenkins-mcp",
      "env": {
        "JENKINS_URL": "http://your-jenkins-server:8080",
        "JENKINS_USER": "your-username",
        "JENKINS_API_TOKEN": "your-api-token"
      }
    }
  }
}

Using the server with an MCP client

You can operate the Jenkins MCP server from an MCP client to perform a wide range of actions. The server exposes a set of endpoints for job control, status retrieval, artifact management, batch operations, caching controls, and more. Use the client to call these endpoints in your automation scripts, chat assistants, or workflow orchestrators.

Additional setup notes

When running in STDIO mode, you interact with the server via standard input/output, which is ideal for local desktop integrations. In HTTP mode, you expose the MCP API over a port and can integrate with MCP Gateways or web services.

Troubleshooting

If you encounter connection issues to Jenkins, verify the URL, the API token’s validity, and your network access. For 2FA or CSRF challenges, prefer using API tokens and ensure the MCP server handles CSRF protection automatically.

Enable verbose logging during setup to diagnose issues: set DEBUG=jenkins-mcp and run the server to view detailed output.

Notes on usage patterns

  • Trigger a job with parameters and monitor its progress
  • Query for jobs with filtering by status, date, or last result
  • Stream or fetch console logs for in-progress or completed builds
  • List and download artifacts across builds
  • Run multiple jobs in parallel with priority controls
  • Inspect queue status and manage waiting builds
  • Cache frequently accessed data to improve response times
  • Handle retry logic with exponential backoff for reliability

Available tools

trigger_job

Triggers a Jenkins job with optional parameters and returns a queue reference for monitoring.

get_job_info

Retrieves detailed information about a Jenkins job, including parameters and last build.

get_build_status

Fetches the status, timestamp, duration, and URL for a specific build.

get_console_log

Retrieves the console output for a specific build, with optional start offset.

list_jobs

Lists all Jenkins jobs with filtering options like status, last build result, and date ranges.

search_jobs

Searches for Jenkins jobs by pattern with options for depth and regex matching.

get_queue_info

Returns information about builds currently waiting in the queue.

server_info

Provides basic information about the Jenkins server, including version and URL.

get_pipeline_status

Gathers detailed stage-by-stage status for Jenkins Pipeline builds.

list_build_artifacts

Lists all artifacts for a specified build.

download_build_artifact

Downloads a specific build artifact, with safety limits for text-based artifacts.

search_build_artifacts

Searches for artifacts across recent builds of a job using patterns.

batch_trigger_jobs

Triggers multiple Jenkins jobs in parallel with priority and concurrency controls.

batch_monitor_jobs

Monitors the status of a batch operation and its individual jobs.

batch_cancel_jobs

Cancels a batch operation and optionally running builds.

get_cache_statistics

Returns cache performance metrics for all cache types.

clear_cache

Clears caches by type or for a specific job.

warm_cache

Warms frequently accessed data into caches to speed up responses.

summarize_build_log

Demonstrates log summarization using a pre-configured prompt.