Skip to main content
Glama
hekmon8

Jenkins Server MCP

by hekmon8

get_build_log

Retrieve the console output of a Jenkins build by specifying the job path and build number. Use to monitor build details and debug CI/CD pipelines efficiently.

Instructions

Get the console output of a Jenkins build

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buildNumberYesBuild number (use "lastBuild" for most recent)
jobPathYesPath to the Jenkins job

Implementation Reference

  • The main handler function that fetches the console log from Jenkins API endpoint `/{jobPath}/{buildNumber}/consoleText` using axios and returns it as MCP tool response content.
    private async getBuildLog(args: any) {
      const response = await this.axiosInstance.get(
        `/${args.jobPath}/${args.buildNumber}/consoleText`
      );
    
      return {
        content: [
          {
            type: 'text',
            text: response.data,
          },
        ],
      };
    }
  • src/index.ts:99-116 (registration)
    Registers the 'get_build_log' tool in the MCP server's ListTools response, including name, description, and input schema.
    {
      name: 'get_build_log',
      description: 'Get the console output of a Jenkins build',
      inputSchema: {
        type: 'object',
        properties: {
          jobPath: {
            type: 'string',
            description: 'Path to the Jenkins job',
          },
          buildNumber: {
            type: 'string',
            description: 'Build number (use "lastBuild" for most recent)',
          },
        },
        required: ['jobPath', 'buildNumber'],
      },
    },
  • Input schema definition for the get_build_log tool, specifying required jobPath and optional buildNumber parameters.
    inputSchema: {
      type: 'object',
      properties: {
        jobPath: {
          type: 'string',
          description: 'Path to the Jenkins job',
        },
        buildNumber: {
          type: 'string',
          description: 'Build number (use "lastBuild" for most recent)',
        },
      },
      required: ['jobPath', 'buildNumber'],
    },
Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hekmon8/Jenkins-server-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server