Jenkins Server MCP

by hekmon8

Integrations

  • Provides tools for interacting with Jenkins CI/CD servers, allowing users to check build statuses, trigger builds with parameters, and retrieve build logs from Jenkins jobs.

  • Connects to TP-Link's Jenkins server (sohoci.rd.tp-link.net/jenkins) by default, enabling interaction with TP-Link's continuous integration environment.

Jenkins サーバー MCP

Jenkins CI/CDサーバーと連携するためのツールを提供するモデルコンテキストプロトコル(MCP)サーバー。このサーバーにより、AIアシスタントは標準化されたインターフェースを通じてビルドステータスの確認、ビルドのトリガー、ビルドログの取得が可能になります。

インストール

  1. このリポジトリをクローンします:
git clone https://github.com/yourusername/jenkins-server-mcp.git cd jenkins-server-mcp
  1. 依存関係をインストールします:
npm install
  1. プロジェクトをビルドします。
npm run build

構成

サーバーには次の環境変数が必要です。

  • JENKINS_URL : Jenkins サーバーの URL (デフォルトは ' http://sohoci.rd.tp-link.net/jenkins ')
  • JENKINS_USER : 認証用のJenkinsユーザー名
  • JENKINS_TOKEN : 認証用のJenkins APIトークン

MCP 設定ファイルで以下を構成します。

クロードデスクトップ向け

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%/Claude/claude_desktop_config.json

{ "mcpServers": { "jenkins-server": { "command": "node", "args": ["/path/to/jenkins-server-mcp/build/index.js"], "env": { "JENKINS_URL": "https://your-jenkins-server.com", "JENKINS_USER": "your-username", "JENKINS_TOKEN": "your-api-token" } } } }

ツールと使用方法

1. ビルドステータスを取得する

Jenkins ビルドのステータスを取得します。

// Example usage const result = await mcpClient.useTool("jenkins-server", "get_build_status", { jobPath: "view/xxx_debug", buildNumber: "lastBuild" // Optional, defaults to lastBuild });

入力スキーマ:

{ "jobPath": "string", // Path to Jenkins job "buildNumber": "string" // Optional, build number or "lastBuild" }

2. トリガービルド

パラメータを使用して新しい Jenkins ビルドをトリガーします。

// Example usage const result = await mcpClient.useTool("jenkins-server", "trigger_build", { jobPath: "view/xxx_debug", parameters: { BRANCH: "main", BUILD_TYPE: "debug" } });

入力スキーマ:

{ "jobPath": "string", // Path to Jenkins job "parameters": { // Build parameters as key-value pairs } }

3. ビルドログを取得する

Jenkins ビルドのコンソール出力を取得します。

// Example usage const result = await mcpClient.useTool("jenkins-server", "get_build_log", { jobPath: "view/xxx_debug", buildNumber: "lastBuild" });

入力スキーマ:

{ "jobPath": "string", // Path to Jenkins job "buildNumber": "string" // Build number or "lastBuild" }

発達

自動リビルドを使用した開発の場合:

npm run watch

デバッグ

MCP サーバーは stdio 経由で通信するため、デバッグには MCP Inspector を使用できます。

npm run inspector

これにより、ブラウザでデバッグ ツールにアクセスするための URL が提供されます。

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

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.

AI アシスタントが Jenkins CI/CD サーバーと対話できるようにし、ビルド ステータスの確認、ビルドのトリガー、ビルド ログの取得を行うツールを提供するモデル コンテキスト プロトコル サーバー。

  1. Installation
    1. Configuration
      1. For Claude Desktop
    2. Tools and Usage
      1. 1. Get Build Status
      2. 2. Trigger Build
      3. 3. Get Build Log
    3. Development
      1. Debugging
    4. License
      ID: a7wprn7goz