Skip to main content

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.

Project description

MCP Jenkins

PyPI Version PyPI Downloads 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.

Installation

Choose one of these installation methods:

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

# Using pip
pip install mcp-jenkins

Line Arguments

When using command line arguments, you can specify the Jenkins server details as follows:

# Simple streamable-http example
uvx mcp-jenkins --transport streamable-http
Argument Description Required
--jenkins-url The URL of the Jenkins server. (Http app can set it via headers x-jenkins-url) No
--jenkins-username The username for Jenkins authentication. (Http app can set it via headers x-jenkins-username) No
--jenkins-password The password or API token for Jenkins authentication. (Http app can set it via headers x-jenkins-password) No
--jenkins-timeout Timeout for Jenkins API requests in seconds. Default is 5 seconds. No
--jenkins-verify-ssl/--no-jenkins-verify-ssl Whether to verify SSL certificates when connecting to Jenkins. Default is to verify. No
--read-only Whether to enable read-only mode. Default is False No
--tool-regex A regex pattern to filter available tools. Default is to allow all tools. No
--transport Transport method to use for communication. Options are stdio, sse or streamable-http. Default is stdio. No
--host Host address for streamable-http transport. Default is 0.0.0.0 No
--port Port number for streamable-http transport. Default is 9887. No

Configuration and Usage

Jetbrains Github Copilot

  1. Open Jetbrains Settings
  2. Navigate to Github Copilot > MCP > Configure
  3. Add the following configuration:
{
  "servers": {
    "my-mcp-server": {
      "type": "stdio",
      "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 menu.
  2. Insert the following configuration:
  • SSE mode
{
    "servers": {
        "jenkins": {
            "url": "http://localhost:9887/sse",
            "type": "sse"
        }
    }
}
  • Streamable-Http mode
{
    "servers": {
        "mcp-jenkins-mcp": {
            "autoApprove": [],
            "disabled": false,
            "timeout": 60,
            "type": "streamableHttp",
            "url": "http://localhost:9887/mcp"
        }
    }
}

Run the Jenkins MCP server with the following command:

uvx mcp-jenkins \
  --jenkins-url xxx \
  --jenkins-username xxx  \
  --jenkins-password xxx \
  --transport sse

Available Tools

Tool Description
get_item Get a specific item by name.
get_item_config Get the configuration of a specific item.
get_all_items Get all items in Jenkins.
query_items Query items based on pattern.
build_item Build a item.
get_all_nodes Get all nodes in Jenkins.
get_node Get a specific node by name.
get_node_config Get the configuration of a specific node.
get_all_queue_items Get all queue items in Jenkins.
get_queue_item Get a specific queue item by ID.
cancel_queue_item Cancel a specific queue item by ID.
get_build Get a specific build by job name and build number.
get_build_scripts Get scripts associated with a specific build.
get_build_console_output Get the console output of a specific build.
get_build_test_report Get the test report of a specific build.
get_running_builds Get all currently running builds in Jenkins.
stop_build Stop a specific build by job name and build number.

Contribution

CONTRIBUTION.md

License

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

Star History

Star History Chart

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_jenkins-1.0.0.dev0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_jenkins-1.0.0.dev0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file mcp_jenkins-1.0.0.dev0.tar.gz.

File metadata

  • Download URL: mcp_jenkins-1.0.0.dev0.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mcp_jenkins-1.0.0.dev0.tar.gz
Algorithm Hash digest
SHA256 3822a104b11ee760ba364e4057c37eba9d07ba42c63c9674a7a2575d4c8dc0ac
MD5 8f7c21dbf34cceea9eb84e38a0c0a7b5
BLAKE2b-256 ce9b1f1eae23a04312f769f8da11f62bf46098a46482e169c6df4e46dc769b7e

See more details on using hashes here.

File details

Details for the file mcp_jenkins-1.0.0.dev0-py3-none-any.whl.

File metadata

  • Download URL: mcp_jenkins-1.0.0.dev0-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mcp_jenkins-1.0.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 d55380a23dea4414be5ee362321b23ae24801d99479b00150c7b8f2e421c76bf
MD5 d369ae9b311fe01274cd83ec0d86f370
BLAKE2b-256 e0cd3e6a980410209eea2489f57c1fc384ac353c97e0f72585392e0367587fdb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page