Skip to main content

MCP Jenkins Fork

Note: This project is a fork of lanbaoshen/mcp-jenkins, originally developed by Lanbao. It has been modified to allow connections to Jenkins without username/password authentication. It is distributed under the MIT License.

MCP Jenkins

PyPI Version PyPI - Downloads PyPI Downloads smithery badge test License

The Model Context Protocol (MCP) is an open-source implementation that bridges Jenkins with AI language models following Anthropic's MCP specification. This project enables secure, contextual AI interactions with Jenkins tools while maintaining data privacy and security.

Cursor Demo

cursor demo

Setup Guide

Installation

Choose one of these installation methods:

# Using uv (recommended)
pip install uv
uvx mcp-jenkins

# Using pip
pip install mcp-jenkins

# Using Smithery
npx -y @smithery/cli@latest install @lanbaoshen/mcp-jenkins --client claude

Configuration and Usage

Cursor

  1. Open Cursor Settings
  2. Navigate to MCP
  3. Click + Add new global MCP server

This will create or edit the ~/.cursor/mcp.json file with your MCP server configuration.

{
  "mcpServers": {
    "mcp-jenkins": {
      "command": "uvx",
      "args": [
        "mcp-jenkins",
        "--jenkins-url=xxx",
        "--jenkins-username=xxx",
        "--jenkins-password=xxx"
      ]
    }
  }
}

VSCode Copilot Chat

  1. Create .vscode folder with mcp.json file in you workspace for local setup or edit settings.json trough settings menù.
  2. Insert the following configuration:
{
    "servers": {
        "jenkins": {
            "url": "http://localhost:3000/sse",
            "type": "sse"
        }
    }
}
  1. Run the Jenkins MCP server with the following command:
uvx mcp-jenkins \
  --jenkins-url http://localhost:3000 \
  --jenkins-username your_username  \
  --jenkins-password your_password \
  --transport sse --port 3000

line arguments

# Stdio Mode
uvx mcp-jenkins --jenkins-url xxx --jenkins-username xxx --jenkins-password xxx --read-only

# SSE Mode
uvx mcp-jenkins --jenkins-url xxx --jenkins-username xxx --jenkins-password xxx --transport sse --port 9887

AutoGen

Install and exec

Install autogen:

pip install "autogen-ext[azure,ollama,openai,mcp]" autogen-chat

Run python scripts:

import asyncio

from autogen_ext.tools.mcp import StdioMcpToolAdapter, StdioServerParams
from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.ui import Console
from autogen_core import CancellationToken


async def main() -> None:
    # Create server params for the remote MCP service
    server_params = StdioServerParams(
        command='uvx',
        args=[
            'mcp-jenkins',
            '--jenkins-username',
            'xxx',
            '--jenkins-password',
            'xxx',
            '--jenkins-url',
            'xxx'
        ],
    )

    # Get the translation tool from the server
    adapter = await StdioMcpToolAdapter.from_server_params(server_params, 'get_all_jobs')

    # Create an agent that can use the translation tool
    agent = AssistantAgent(
        name='jenkins_assistant',
        model_client=[Replace_with_your_model_client],
        tools=[adapter],
    )

    # Let the agent translate some text
    await Console(
        agent.run_stream(task='Get all jobs', cancellation_token=CancellationToken())
    )


if __name__ == "__main__":
    asyncio.run(main())

Available Tools

Tool Description
get_all_jobs Get all jobs
get_job_config Get job config
search_jobs Search job by specific field
get_running_builds Get running builds
stop_build Stop running build
get_build_info Get build info
get_build_sourcecode Get the pipeline source code of a specific build in Jenkins
get_job_info Get job info
build_job Build a job with param
get_build_logs Get build logs
get_all_nodes Get nodes
get_node_config Get the config of node
get_all_queue_items Get all queue items
get_queue_item Get queue item info
cancel_queue_item Cancel queue item
get_multibranch_jobs Get all multibranch pipeline jobs from Jenkins, optionally filtered by patterns
get_multibranch_branches Get all branches for a specific multibranch pipeline job
scan_multibranch_pipeline Trigger a scan of a multibranch pipeline to discover new branches

Development & Debugging

# Using MCP Inspector
# For installed package
npx @modelcontextprotocol/inspector uvx mcp-jenkins --jenkins-url xxx --jenkins-username xxx --jenkins-password xxx

# For local development version
npx @modelcontextprotocol/inspector uv --directory /path/to/your/mcp-jenkins run mcp-jenkins --jenkins-url xxx --jenkins-username xxx --jenkins-password xxx

Pre-Commit Hook

# Install Dependency
uv sync --all-extras --dev
pre-commit install

# Manually execute
pre-commit run --all-files

UT

# Install Dependency
uv sync --all-extras --dev

# Execute UT
uv run pytest --cov=mcp_jenkins

License

Licensed under MIT - see LICENSE file. This is not an official Jenkins product.

MCP-Jenkins in MCP Registries

pypi-AgEIcHlwaS5vcmcCJDU0NWNlMGNhLWU2NjMtNGNkNC05NWYzLTU1MWEwMGQwMWZiNwACKlszLCJjNGUxMmE5NC01NWFjLTQ4ZDQtYmFkYy1iMDJhNjM2MTcyOTUiXQAABiCtaUzDQ6zleXvK_gXRlrQ4EWC1v8O5887H8qNphBzXJw

Metadata

Release files for mcp-jenkins-fork 0.3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-jenkins-fork 0.3.7
File Size Uploaded Provenance
mcp_jenkins_fork-0.3.7.tar.gz 14.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-jenkins-fork 0.3.7
File Interpreter ABI Platform
mcp_jenkins_fork-0.3.7-py3-none-any.whl Python 3 none any Details

Total release size: 29.5 kB

Release files / mcp_jenkins_fork-0.3.7.tar.gz

Download URL mcp_jenkins_fork-0.3.7.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1b41c9fc73e524f154662c9eacd298c695900ccb6d13a6e2bafb70c0a84e0d67
BLAKE2b-256 checksum
How to use checksums
0bb3349bd44ccff81cf0fff92ed3ae8b6d0e1f5a84ccdee2ce50c3e6c46f4a3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / mcp_jenkins_fork-0.3.7-py3-none-any.whl

Download URL mcp_jenkins_fork-0.3.7-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc230a9b13fccc4695a62f423c2eb7b3a8282def1279f9ac90d07c067afe2abe
BLAKE2b-256 checksum
How to use checksums
23533cfdf863eca79b52710f428f1170a129b3bf7dcfebaa34291c846c5c5027
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Security for mcp-jenkins-fork 0.3.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.7 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page