jenkins-cicd
Jenkins CI/CD Skill
Purpose
Manage Jenkins CI/CD pipelines for network automation workflows. This skill provides operational workflows for monitoring job and build status, triggering builds with parameters, analyzing build logs for troubleshooting, and tracking SCM changes across Jenkins projects.
The Jenkins MCP server is an official Jenkins plugin running natively inside Jenkins via Streamable HTTP transport — netclaw connects to it as a remote HTTP client.
Golden Rule
Never trigger a build or modify build metadata without explicit operator confirmation. All write operations (triggerBuild, updateBuild) require human-in-the-loop approval per Constitution XIV. Always read current state before proposing any write action (Constitution II — Read-Before-Write).
Workflow 1: Pipeline and Build Monitoring (US1 — MVP)
Monitor Jenkins job status, build results, queue state, and pipeline run history.
Steps
-
List all jobs — Use
getJobswith optional pagination (offset,limit) and regex name filter to discover available jobs.Tool: getJobs Parameters: { "nameFilter": "deploy-.*", "offset": 0, "limit": 25 } -
Get job details — Use
getJobwith the full job name (supports folder paths likefolder1/folder2/job-name) to retrieve job configuration, last build number, and health status.Tool: getJob Parameters: { "fullName": "network-automation/deploy-network-config" } -
Get build details — Use
getBuildwith job name and build number to retrieve result, duration, timestamp, parameters, and causes.Tool: getBuild Parameters: { "jobFullName": "deploy-network-config", "buildNumber": 42 } -
Check queue status — Use
getQueueItemto inspect queued build requests — waiting reason, position, estimated start time.Tool: getQueueItem Parameters: { "queueId": 1234 } -
View pipeline run history — Use
getPipelineRunsto list pipeline execution history with status, duration, and branch info.Tool: getPipelineRuns Parameters: { "jobFullName": "deploy-network-config" }
Example Prompts
- "Show me all Jenkins jobs"
- "What is the status of the last build for deploy-network-config?"
- "List all failed builds for job network-validation"
- "Are there any builds waiting in the queue?"
- "Show pipeline run history for deploy-network-config"
Workflow 2: Build Triggering and Tracking (US2)
Trigger new builds with parameters, track queue-to-build progression, and update build metadata. All write operations require operator confirmation.
Steps
-
Verify job exists and check parameters — Use
getJobto confirm the job exists and inspect its parameter definitions before triggering (read-before-write, Constitution II).Tool: getJob Parameters: { "fullName": "deploy-network-config" } → Returns parameter definitions: BRANCH (String), DRY_RUN (Boolean), ENVIRONMENT (Choice) -
Present parameters and confirm with operator — Display the job's parameter definitions and proposed values. Wait for explicit operator approval before proceeding (Constitution XIV — Human-in-the-Loop).
Confirmation prompt: "Ready to trigger build for 'deploy-network-config' with parameters: - BRANCH: main (String) - DRY_RUN: true (Boolean) - ENVIRONMENT: staging (Choice: [dev, staging, prod]) Proceed? [yes/no]" -
Trigger the build — Use
triggerBuildwith the confirmed parameters. Supported parameter types: String, Boolean, Choice, Text, Password, Run.Tool: triggerBuild Parameters: { "jobFullName": "deploy-network-config", "parameters": [ { "name": "BRANCH", "value": "main" }, { "name": "DRY_RUN", "value": "true" }, { "name": "ENVIRONMENT", "value": "staging" } ] } → Returns queue item ID -
Track queue progression — Use
getQueueItemto monitor until the build starts, then switch togetBuild.Tool: getQueueItem Parameters: { "queueId": <returned-queue-id> } → When build starts, returns build number -
Monitor build until completion — Use
getBuildto poll build status until result is available.Tool: getBuild Parameters: { "jobFullName": "deploy-network-config", "buildNumber": <build-number> } → Result: SUCCESS | FAILURE | UNSTABLE | ABORTED | NOT_BUILT -
Update build metadata (optional) — Use
updateBuildto set a descriptive display name or mark the build as keep-forever. Requires confirmation.Tool: updateBuild Parameters: { "jobFullName": "deploy-network-config", "buildNumber": <build-number>, "displayName": "Production Deploy - v2.4.1", "keepLog": true }
Example Prompts
- "Trigger a build for deploy-network-config with BRANCH=main"
- "Start job network-validation with DRY_RUN=true and ENVIRONMENT=staging"
- "Mark build #42 of deploy-network-config as keep-forever"
- "Track queue item 1234 until the build completes"
Workflow 3: Build Log Analysis (US3)
Retrieve and search build logs for troubleshooting failed builds, identifying errors, and diagnosing pipeline issues.
Steps
-
Retrieve build log — Use
getBuildLogwith job name and build number. For large logs, use thestartoffset parameter for pagination.Tool: getBuildLog Parameters: { "jobFullName": "deploy-network-config", "buildNumber": 42 } → Returns console output text -
Paginate large logs — If the log is truncated, use the
startoffset to retrieve subsequent sections.Tool: getBuildLog Parameters: { "jobFullName": "deploy-network-config", "buildNumber": 42, "start": 50000 } → Returns output starting from byte offset 50000 -
Search logs by pattern — Use
searchBuildLogwith a regex pattern to find specific lines (errors, warnings, timeouts).Tool: searchBuildLog Parameters: { "jobFullName": "deploy-network-config", "buildNumber": 42, "pattern": "ERROR|FATAL|Exception" } → Returns matching log lines -
Retrieve pipeline-specific logs — Use
getPipelineRunLogfor pipeline jobs that produce structured run logs.Tool: getPipelineRunLog Parameters: { "jobFullName": "deploy-network-config", "runId": "42" }
Example Prompts
- "Show me the build log for deploy-network-config build #42"
- "Show the last 100 lines of the build log for network-validation #15"
- "Search the build log for 'ERROR' in deploy-network-config build #42"
- "Find timeout messages in the latest build of network-validation"
- "Show the pipeline log for deploy-network-config run #42"
Handling Large Logs
Build logs can be very large (hundreds of MB for verbose builds). Guidelines:
- Start with
searchBuildLogto find relevant sections before retrieving the full log - Use
startoffset pagination to retrieve specific sections - For troubleshooting, search for
ERROR,FATAL,Exception,FAILURE, ortimeoutfirst
Workflow 4: SCM Change Tracking (US4)
Track source code changes associated with Jenkins jobs and builds — correlate builds with commits, find jobs by repository, and review change history.
Steps
-
Get job SCM configuration — Use
getJobScmto view the repository URL, branch spec, and polling configuration for a job.Tool: getJobScm Parameters: { "jobFullName": "deploy-network-config" } → Returns: repository URL, branches, credential ID, polling config -
Get build SCM details — Use
getBuildScmto see the exact revision (commit hash) and branch checked out for a specific build.Tool: getBuildScm Parameters: { "jobFullName": "deploy-network-config", "buildNumber": 42 } → Returns: revision hash, branch name at build time -
List change sets (commits) — Use
getBuildChangeSetsto see all commits included in a build — author, message, timestamp, and affected files.Tool: getBuildChangeSets Parameters: { "jobFullName": "deploy-network-config", "buildNumber": 42 } → Returns: list of change sets with commit details -
Find jobs by repository — Use
findJobsWithScmUrlto discover all Jenkins jobs configured to build from a specific repository.Tool: findJobsWithScmUrl Parameters: { "scmUrl": "https://github.com/org/network-configs" } → Returns: list of jobs using this repository
Example Prompts
- "What repository does deploy-network-config use?"
- "Show me the commits in build #42 of deploy-network-config"
- "Which commit triggered build #42?"
- "Find all Jenkins jobs that use the network-configs repository"
- "What files changed in the latest build of deploy-network-config?"
Workflow 5: Health Check and Setup Verification (US5)
Verify Jenkins connectivity, authentication, and instance health. Recommended as a pre-flight check before first use and as a diagnostic tool when other operations fail.
Steps
-
Verify authentication — Use
whoAmIto confirm the connection works and inspect the authenticated user's identity and permissions.Tool: whoAmI Parameters: {} → Returns: user name, authorities/permissions list -
Check instance health — Use
getStatusto verify Jenkins is healthy and operational.Tool: getStatus Parameters: {} → Returns: mode (NORMAL/SHUTDOWN), version, quietingDown status
When to Use
- First-time setup: Run both
whoAmIandgetStatusto validate the connection - Authentication failures: Run
whoAmIto diagnose credential issues - Unexpected errors: Run
getStatusto check if Jenkins is shutting down or in maintenance mode - Permission problems: Run
whoAmIto verify the user has required authorities
Example Prompts
- "Check my Jenkins connection"
- "Who am I on Jenkins?"
- "Is Jenkins healthy?"
- "Verify Jenkins is running and I have access"
GAIT Audit Logging
All Jenkins interactions are logged to the GAIT audit trail via gait_mcp tools at the skill invocation level (per Constitution IV — GAIT Audit Trail).
Logging Pattern
For each Jenkins operation:
-
Before invocation: Log the tool name and parameters being sent
gait_mcp.log_action({ action: "jenkins_tool_call", tool: "getJobs", parameters: { "nameFilter": "deploy-.*" }, status: "initiated" }) -
After invocation: Log the result summary
gait_mcp.log_action({ action: "jenkins_tool_call", tool: "getJobs", result_summary: "Returned 12 jobs matching filter", status: "completed" }) -
For write operations: Log the confirmation step
gait_mcp.log_action({ action: "jenkins_write_confirmation", tool: "triggerBuild", parameters: { "jobFullName": "deploy-network-config", "parameters": [...] }, operator_confirmed: true, status: "approved" })
What Gets Logged
- Tool name and parameters for every invocation
- Result summary (success/failure, record count, key identifiers)
- Operator confirmation for write operations
- Error details when operations fail
Integration with Other Skills
- suzieq-observability: After a network deployment build completes, use SuzieQ to validate network state post-change
- aci-change-deploy: Coordinate ACI changes with Jenkins pipeline execution — trigger build after change approval
- gitlab-devops: Correlate GitLab merge requests with Jenkins builds via SCM change tracking
- canvas-a2ui: Visualize build status trends and pipeline health in network dashboards
- gait_mcp: All Jenkins operations are audit-logged for compliance and traceability
Important Rules
- Read-before-write: Always use
getJobto verify a job exists and inspect its parameters beforetriggerBuildorupdateBuild - Human-in-the-loop: All write operations require explicit operator confirmation — never auto-trigger builds
- Folder-aware job names: Jenkins jobs in folders use path notation (e.g.,
folder1/folder2/job-name) — always use the full name - Parameterized builds: Check parameter definitions via
getJobbefore triggering — pass correct types (String, Boolean, Choice, Text, Password, Run) - Large log handling: Use
searchBuildLogbefore full log retrieval to avoid overwhelming context with large console output - GAIT logging: Every Jenkins tool invocation must be logged to the audit trail
- Credential safety: Never log or display raw API tokens — credentials are managed via environment variables (Constitution XIII)
- Remote server: This MCP server is a remote HTTP service — connectivity depends on network access to the Jenkins instance
More from automateyournetwork/netclaw
pyats-topology
Network topology discovery via CDP/LLDP neighbors, ARP tables, routing peers, and interface mapping to build complete network maps. Use when mapping the network, building a diagram, discovering what is connected to what, or documenting device neighbors and links.
20drawio-diagram
Generate draw.io network diagrams — native .drawio files with CLI export (PNG/SVG/PDF), plus browser-based Mermaid/XML/CSV via MCP server. Use when creating network topology diagrams, generating architecture visuals, exporting diagrams to PNG or PDF, or building draw.io files from discovery data.
19aws-architecture-diagram
AWS architecture diagrams — generate visual network topology diagrams from live AWS infrastructure. Use when drawing AWS network diagrams, visualizing VPCs, mapping Transit Gateway topology, or generating architecture documentation.
19grafana-observability
Grafana observability platform — dashboards, Prometheus PromQL, Loki LogQL, alerting, incidents, OnCall schedules, annotations, datasource queries, panel rendering (75+ tools). Use when querying Grafana dashboards, running PromQL for interface metrics, searching Loki logs for syslog events, investigating firing alerts, or checking who is on call.
18pyats-health-check
Comprehensive network device health monitoring - CPU, memory, interfaces, hardware, NTP, logging, environment, and uptime analysis. Use when running a device health check, monitoring CPU or memory usage, checking interface errors, or validating NTP sync.
17aws-security-audit
AWS security auditing — IAM users/roles/policies, CloudTrail API events, security posture analysis. Use when auditing IAM permissions, investigating security incidents, checking MFA compliance, or tracing API activity in CloudTrail.
16