Skip to main content
Glama
mcp-jenkins
by lanbaoshen

MCP 젠킨스

PyPI 버전PyPI - 다운로드 PyPI 다운로드 대장간 배지 시험특허

모델 컨텍스트 프로토콜(MCP)은 Anthropic의 MCP 사양을 준수하여 Jenkins와 AI 언어 모델을 연결하는 오픈 소스 구현입니다. 이 프로젝트는 데이터 프라이버시와 보안을 유지하면서 Jenkins 도구와 안전하고 상황에 맞는 AI 상호작용을 가능하게 합니다.

커서 데모

커서 데모

Related MCP server: MCP Jenkins

설정 가이드

설치

다음 설치 방법 중 하나를 선택하세요.

지엑스피1

구성 및 사용

커서

  1. 커서 설정 열기

  2. MCP로 이동

    • 새로운 글로벌 MCP 서버 추가를 클릭하세요

이렇게 하면 MCP 서버 구성으로 ~/.cursor/mcp.json 파일이 생성되거나 편집됩니다.

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

줄 인수

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

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

자동 생성

자동 생성 설치:

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

파이썬 스크립트 실행:

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())

사용 가능한 도구

도구

설명

모든 일자리를 얻으세요

모든 일자리를 얻으세요

get_job_config

작업 구성 가져오기

일자리 검색

특정 분야로 직업 검색

get_running_builds

빌드 실행하기

빌드_정보 얻기

빌드 정보 가져오기

일자리 정보 얻기

구인정보 받기

빌드_작업

매개변수를 사용하여 작업 빌드

빌드 로그 가져오기

빌드 로그 가져오기

모든 노드 가져오기

노드 가져오기

get_node_config

노드의 구성을 가져옵니다

모든 대기열 항목 가져오기

모든 대기열 항목 가져오기

get_queue_item

대기열 항목 정보 가져오기

대기열 항목 취소

대기열 항목 취소

개발 및 디버깅

# 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

사전 커밋 후크

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

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

유타

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

# Execute UT
uv run pytest --cov=mcp_jenkins

특허

MIT 라이선스에 따라 배포됩니다. 라이선스 파일을 참조하세요. 이 제품은 Jenkins 공식 제품이 아닙니다.

Available Tools

36 tools
build_itemA

Build an item in Jenkins

Args: fullname: The fullname of the item data: The parameters to trigger the build with. Required if build_type is 'buildWithParameters'. build_type: If your item is configured with parameters, you must use 'buildWithParameters' as build_type.

Returns: The queue item number of the item.

Inputs: fullname (required), build_type (required), data. Returns: result

cancel_queue_itemC

Cancel a specific item in Jenkins queue by id

Args: id: The id of the queue item

Inputs: id (required).

get_all_build_artifactsA

List the artifacts of a specific build in Jenkins

Args: fullname: The fullname of the job number: The number of the build, if None, get the last build

Returns: A list of artifact metadata dicts with fileName, relativePath, and displayPath

Inputs: fullname (required), number. Returns: result

get_all_itemsB

Get all items from Jenkins

Returns: A list of items

Inputs: no named parameters. Returns: result

get_all_nodesA

Get all nodes from Jenkins

Returns: A list of all nodes

Inputs: no named parameters. Returns: result

get_all_pluginsA

Get all installed plugins from Jenkins

Args: depth: The depth of the information to retrieve. Default is 2 (includes dependencies).

Returns: A list of all installed plugins

Inputs: depth. Returns: result

get_all_queue_itemsB

Get all items in Jenkins queue

Returns: A list of all items in the Jenkins queue

Inputs: no named parameters. Returns: result

get_all_viewsA

Get all top-level views from Jenkins.

Returns: A list of views with their name and URL.

Inputs: no named parameters. Returns: result

get_buildA

Get specific build info from Jenkins

Args: fullname: The fullname of the job number: The number of the build, if None, get the last build

Returns: The build info

Inputs: fullname (required), number. Returns: object

get_build_artifactA

Download an artifact from a specific build in Jenkins

Binary files are returned as base64-encoded content; text files are returned as plain text.

Args: fullname: The fullname of the job relative_path: The relative path of the artifact (e.g. playwright-report/index.html) number: The number of the build, if None, get the last build

Returns: A dict with 'content' (str) and 'encoding' ('utf-8' or 'base64')

Inputs: fullname (required), relative_path (required), number. Returns: object

get_build_artifact_urlB

Get the direct URL of an artifact from a specific build in Jenkins

Args: fullname: The fullname of the job relative_path: The relative path of the artifact (e.g. playwright-report/index.html) number: The number of the build, if None, get the last build

Returns: The direct Jenkins URL of the artifact

Inputs: fullname (required), relative_path (required), number. Returns: result

get_build_console_outputA

Get the console output of a specific build in Jenkins

Args: fullname: The fullname of the job number: The number of the build, if None, get the last build pattern: Optional regex pattern to filter lines (only matching lines are returned) offset: Number of lines to skip from the beginning after filtering, default 0 limit: Maximum number of lines to return after filtering and offset

Returns: The console output of the build

Inputs: fullname (required), limit, number, offset, +1 more. Returns: result

get_build_parametersA

Get the parameters of a specific build in Jenkins

Args: fullname: The fullname of the job number: The number of the build, if None, get the last build

Returns: A dictionary of build parameter names and their values

Inputs: fullname (required), number. Returns: object

get_build_scriptsA

Get the scripts used in a specific build in Jenkins

Args: fullname: The fullname of the job number: The number of the build, if None, get the last build

Returns: A list of scripts used in the build

Inputs: fullname (required), number. Returns: result

get_build_test_failuresB

Get the failing tests of a specific build in Jenkins, with their error details

For a matrix build, the failures of all configurations are returned, each with the URL of its configuration build.

Args: fullname: The fullname of the job number: The number of the build, if None, get the last build limit: Maximum number of failures to return, None for all of them max_stack_trace_length: Stack traces longer than this are cut to this many characters

Returns: The test counts of the build, its failures and whether the failures were truncated to the limit

Inputs: fullname (required), limit, number, max_stack_trace_length. Returns: object

get_build_test_reportA

Get the test report of a specific build in Jenkins

The report lists every test case, passing ones included, so it can be very large; use get_build_test_failures to see what failed.

Args: fullname: The fullname of the job number: The number of the build, if None, get the last build

Returns: The test report of the build

Inputs: fullname (required), number. Returns: object

get_itemC

Get specific item from Jenkins

Args: fullname: The fullname of the item

Returns: The item

Inputs: fullname (required). Returns: object

get_item_configA

Get specific item config from Jenkins

Args: fullname: The fullname of the item

Returns: The config of the item

Inputs: fullname (required). Returns: result

get_item_parametersA

Get the parameter definitions of a Jenkins job

Args: fullname: The fullname of the item

Returns: A list of parameter definitions, each containing name, type, defaultValue, and description

Inputs: fullname (required). Returns: result

get_nodeB

Get a specific node from Jenkins

Contains executor about the node.

Args: name: The name of the node

Returns: The node

Inputs: name (required). Returns: object

get_node_configB

Get node config from Jenkins

Args: name: The name of the node

Returns: The config of the node

Inputs: name (required). Returns: result

get_pending_inputsA

Get the pending input steps of a specific build in Jenkins

A pipeline showing "Paused for Input" is waiting on an input step. Call this before submit_input to discover the input id and the parameter definitions the pipeline is waiting for.

Only the given build is inspected. With number=None that is the job's last build, so a paused build that is no longer the most recent one is not found that way — locate it with get_running_builds and pass its number explicitly.

Args: fullname: The fullname of the job number: The number of the build, if None, check the last build

Returns: A list of pending inputs with id, message, proceedText and inputs (parameter definitions)

Inputs: fullname (required), number. Returns: result

get_pluginA

Get a specific plugin from Jenkins

Contains detailed information about the plugin, including dependencies when depth >= 2.

Args: short_name: The short name of the plugin depth: The depth of the information to retrieve. Default is 2 (includes dependencies).

Returns: The plugin details, or None if not found

Inputs: short_name (required), depth. Returns: result

get_plugin_dependency_graphA

Get dependency graph for a specific plugin in Graphviz format

Recursively analyzes dependencies down to leaf nodes. Returns nodes and edges that can be used to generate a dependency graph.

Args: short_name: The short name of the plugin to analyze

Returns: A dictionary with 'nodes' and 'edges' for Graphviz rendering

Inputs: short_name (required). Returns: object

get_plugins_with_backupA

Get plugins that can be downgraded

Returns plugins that have a backupVersion and can be rolled back.

Args: depth: The depth of the information to retrieve. Default is 0.

Returns: A list of plugins that can be downgraded

Inputs: depth. Returns: result

get_plugins_with_problemsA

Get all plugins with problems from Jenkins

These are plugins that have issues such as missing dependencies, incompatible versions, core version mismatch, or other configuration problems.

Returns: A list of plugins with problems

Inputs: no named parameters. Returns: result

get_plugins_with_updatesB

Get plugins that have available updates

Args: depth: The depth of the information to retrieve. Default is 0.

Returns: A list of plugins with available updates

Inputs: depth. Returns: result

get_queue_itemA

Get a specific item in Jenkins queue by id

Args: id: The id of the queue item

Returns: The queue item

Inputs: id (required). Returns: object

get_running_buildsA

Get all running builds from Jenkins

Returns: A list of all running builds

Inputs: no named parameters. Returns: result

get_viewA

Get a Jenkins view by path, returning its jobs and/or nested sub-views.

Views can be nested up to multiple levels deep. Use "/" to separate levels in the path. If the view contains sub-views instead of jobs, the response will include their names so you can drill down further.

Args: view_path: View path using "/" to separate levels. Examples: "All", "frontend", "frontend/nightly". Spaces and special characters in view names are handled automatically. depth: Depth of detail to retrieve for each job. Default is 0.

Returns: A dict with the view's name, jobs list, and/or nested views.

Inputs: view_path (required), depth. Returns: object

query_itemsC

Query items from Jenkins

Args: class_pattern: The pattern of the _class fullname_pattern: The pattern of the fullname color_pattern: The pattern of the color folder_depth: The maximum depth of folders to traverse. If None, traverses all levels.

Returns: A list of items

Inputs: folder_depth, class_pattern, color_pattern, fullname_pattern. Returns: result

run_groovy_scriptA

Execute an arbitrary Groovy script on Jenkins.

This tool provides access to Jenkins internal features that are not available via REST API.

Args: script: The Groovy script code to execute.

Returns: The result of the script execution.

Examples: # Basic usage: run_groovy_script(script='println Jenkins.instance.version')

# Access Jenkins information:
run_groovy_script(
    script='''
        def version = Jenkins.instance.version
        def mode = Jenkins.instance.mode
        return "Version: ${version}, Mode: ${mode}"
    '''
)

Inputs: script (required). Returns: result

set_item_configC

Set specific item config in Jenkins

Args: fullname: The fullname of the item config_xml: The config XML of the item

Inputs: fullname (required), config_xml (required).

set_node_configC

Set specific node config in Jenkins

Args: name: The name of the node config_xml: The config XML of the node

Inputs: name (required), config_xml (required).

stop_buildC

Stop a specific build in Jenkins

Args: fullname: The fullname of the job number: The number of the build to stop

Inputs: number (required), fullname (required).

submit_inputA

Respond to a pipeline input step of a build that is paused for input in Jenkins

Warnings: Omitting a declared parameter settles it with null — Jenkins does not fall back to the declared defaults, so every declared parameter must be submitted. That is enforced whenever the pending input can be discovered; when the pending inputs cannot be fetched (wfapi endpoint missing or erroring) an explicit input_id is submitted as-is, so check the declared parameters yourself in that case. If this call times out the input may or may not have been settled: re-check with get_pending_inputs rather than retrying, because a settled input rejects a second submission.

Args: fullname: The fullname of the job number: The number of the paused build, use get_pending_inputs to confirm its pending input (and get_running_builds to locate a paused build that is not the job's last one) input_id: The id of the pending input, if None, resolved automatically when exactly one is pending parameters: A mapping of parameter name to value, e.g. {'APPROVE': True, 'TARGET': 'prod'} action: 'proceed' to continue the pipeline, 'abort' to reject the input and abort the build

Returns: A dict with the fullname, number, inputId and the Jenkins action that was submitted: 'proceed' with values, 'proceedEmpty' with none, or 'abort'

Inputs: number (required), fullname (required), action, input_id, +1 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 36 tools

    Disambiguation4/5

    Most tools target distinct resources and actions, and descriptions actively disambiguate near-neighbors (e.g. get_build_test_report warns to use get_build_test_failures instead, get_pending_inputs/submit_input explain their relationship). Minor overlap remains between get_all_items/query_items and among the many get_build_* variants, but the naming and args keep them separable.

    Naming Consistency4/5

    Strong dominant verb_noun pattern (get_build, set_item_config, build_item, stop_build, cancel_queue_item, run_groovy_script). Slight inconsistencies appear in the get_all_X vs query_items vs get_item phrasing and get_build_artifact vs get_all_build_artifacts, but overall the convention is predictable.

    Tool Count3/5

    36 tools is on the heavy side and exceeds the typical comfortable range. Jenkins genuinely spans many sub-domains (builds, items, nodes, plugins, queue, views, groovy), so most tools earn their place, but the surface is large enough to feel bloated and harder to navigate.

    Completeness4/5

    Coverage is broad: build lifecycle (get/stop/console/tests/params/artifacts), item config and triggering, node config, plugin inspection with dependency graphs, queue management, views, and an escape-hatch groovy script. Missing item/node create-delete operations are minor gaps an agent can work around via groovy or config setters.

    Maintenance

    ActivitySlowing
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI language models to securely interact with Jenkins through the Model Context Protocol, exposing tools to query and manage items, nodes, queues, builds, artifacts, views, plugins, and execute Groovy scripts while maintaining data privacy and security.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI language models to securely interact with Jenkins through the Model Context Protocol, exposing tools for querying and managing jobs, builds, nodes, queues, views, plugins, artifacts, and Groovy scripts.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI language models to interact securely with Jenkins through the Model Context Protocol, supporting job, build, queue, node, view, plugin, artifact, and Groovy script operations while maintaining data privacy and security.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI language models to securely interact with Jenkins through the Model Context Protocol, exposing tools for jobs, builds, nodes, queues, views, plugins, artifacts, and Groovy scripts.
      -