mcp-jenkins

by lanbaoshen
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Provides tools for interacting with Jenkins CI/CD systems, including retrieving job information, searching jobs, accessing build data, viewing job configurations, and triggering builds with parameters.

MCP 詹金斯

模型上下文协议 (MCP) 是一个开源实现,它遵循 Anthropic 的 MCP 规范,将 Jenkins 与 AI 语言模型连接起来。该项目支持与 Jenkins 工具进行安全的、上下文相关的 AI 交互,同时确保数据隐私和安全。

光标演示

设置指南

安装

选择以下安装方法之一:

# 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

配置和使用

光标

  1. 打开游标设置
  2. 导航至 MCP
  3. 点击“+添加新的全局 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

运行python脚本:

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

可用工具

工具描述
获取所有作业获取所有职位
获取作业配置获取作业配置
搜索职位按特定领域搜索职位
获取运行构建开始运行构建
获取构建信息获取构建信息
获取工作信息获取工作信息
构建作业使用参数构建作业

开发与调试

# 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 # Execute UT uv run pytest --cov=mcp_jenkins

执照

采用 MIT 许可 - 请参阅LICENSE文件。这不是 Jenkins 官方产品。

-
security - not tested
A
license - permissive license
-
quality - not tested

模型上下文协议 (MCP) Jenkins 集成是一个开源实现,它遵循 Anthropic 的 MCP 规范,将 Jenkins 与 AI 语言模型连接起来。该项目支持与 Jenkins 工具进行安全的、上下文相关的 AI 交互,同时确保数据隐私和安全。

  1. Cursor Demo
    1. Setup Guide
      1. Installation
      2. Configuration and Usage
    2. Available Tools
      1. Development & Debugging
        1. UT
      2. License
        ID: kjm03ssssr