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 getJobs with 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 getJob with the full job name (supports folder paths like folder1/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 getBuild with 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 getQueueItem to inspect queued build requests — waiting reason, position, estimated start time.
Tool: getQueueItem
Parameters: { "queueId": 1234 }
View pipeline run history — Use getPipelineRuns to 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 getJob to 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 triggerBuild with 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 getQueueItem to monitor until the build starts, then switch to getBuild.
Tool: getQueueItem
Parameters: { "queueId": <returned-queue-id> }
→ When build starts, returns build number
Monitor build until completion — Use getBuild to 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 updateBuild to 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 getBuildLog with job name and build number. For large logs, use the start offset 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 start offset 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 searchBuildLog with 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 getPipelineRunLog for 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
searchBuildLog to find relevant sections before retrieving the full log
- Use
start offset pagination to retrieve specific sections
- For troubleshooting, search for
ERROR, FATAL, Exception, FAILURE, or timeout first
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 getJobScm to 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 getBuildScm to 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 getBuildChangeSets to 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 findJobsWithScmUrl to 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 whoAmI to 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 getStatus to verify Jenkins is healthy and operational.
Tool: getStatus
Parameters: {}
→ Returns: mode (NORMAL/SHUTDOWN), version, quietingDown status
When to Use
- First-time setup: Run both
whoAmI and getStatus to validate the connection
- Authentication failures: Run
whoAmI to diagnose credential issues
- Unexpected errors: Run
getStatus to check if Jenkins is shutting down or in maintenance mode
- Permission problems: Run
whoAmI to 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
getJob to verify a job exists and inspect its parameters before triggerBuild or updateBuild
- 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
getJob before triggering — pass correct types (String, Boolean, Choice, Text, Password, Run)
- Large log handling: Use
searchBuildLog before 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
1---2name: jenkins-cicd3description: Jenkins CI/CD pipeline management — monitor builds, trigger pipelines, analyze logs, and track SCM changes for network automation workflows.4license: Apache-2.05---6
7# Jenkins CI/CD Skill
8
9## Purpose
10
11Manage 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.
12
13The 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.
14
15## Golden Rule
16
17**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).
18
19---
20
21## Workflow 1: Pipeline and Build Monitoring (US1 — MVP)
22
23Monitor Jenkins job status, build results, queue state, and pipeline run history.
24
25### Steps
26
271. **List all jobs** — Use `getJobs` with optional pagination (`offset`, `limit`) and regex name filter to discover available jobs.
28 ```
29 Tool: getJobs
30 Parameters: { "nameFilter": "deploy-.*", "offset": 0, "limit": 25 }
31 ```
32
332. **Get job details** — Use `getJob` with the full job name (supports folder paths like `folder1/folder2/job-name`) to retrieve job configuration, last build number, and health status.
34 ```
35 Tool: getJob
36 Parameters: { "fullName": "network-automation/deploy-network-config" }
37 ```
38
393. **Get build details** — Use `getBuild` with job name and build number to retrieve result, duration, timestamp, parameters, and causes.
40 ```
41 Tool: getBuild
42 Parameters: { "jobFullName": "deploy-network-config", "buildNumber": 42 }
43 ```
44
454. **Check queue status** — Use `getQueueItem` to inspect queued build requests — waiting reason, position, estimated start time.
46 ```
47 Tool: getQueueItem
48 Parameters: { "queueId": 1234 }
49 ```
50
515. **View pipeline run history** — Use `getPipelineRuns` to list pipeline execution history with status, duration, and branch info.
52 ```
53 Tool: getPipelineRuns
54 Parameters: { "jobFullName": "deploy-network-config" }
55 ```
56
57### Example Prompts
58
59- "Show me all Jenkins jobs"
60- "What is the status of the last build for deploy-network-config?"
61- "List all failed builds for job network-validation"
62- "Are there any builds waiting in the queue?"
63- "Show pipeline run history for deploy-network-config"
64
65---
66
67## Workflow 2: Build Triggering and Tracking (US2)
68
69Trigger new builds with parameters, track queue-to-build progression, and update build metadata. All write operations require operator confirmation.
70
71### Steps
72
731. **Verify job exists and check parameters** — Use `getJob` to confirm the job exists and inspect its parameter definitions before triggering (read-before-write, Constitution II).
74 ```
75 Tool: getJob
76 Parameters: { "fullName": "deploy-network-config" }
77 → Returns parameter definitions: BRANCH (String), DRY_RUN (Boolean), ENVIRONMENT (Choice)
78 ```
79
802. **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).
81 ```
82 Confirmation prompt:
83 "Ready to trigger build for 'deploy-network-config' with parameters:
84 - BRANCH: main (String)
85 - DRY_RUN: true (Boolean)
86 - ENVIRONMENT: staging (Choice: [dev, staging, prod])
87 Proceed? [yes/no]"
88 ```
89
903. **Trigger the build** — Use `triggerBuild` with the confirmed parameters. Supported parameter types: String, Boolean, Choice, Text, Password, Run.
91 ```
92 Tool: triggerBuild
93 Parameters: {
94 "jobFullName": "deploy-network-config",
95 "parameters": [
96 { "name": "BRANCH", "value": "main" },
97 { "name": "DRY_RUN", "value": "true" },
98 { "name": "ENVIRONMENT", "value": "staging" }
99 ]
100 }
101 → Returns queue item ID
102 ```
103
1044. **Track queue progression** — Use `getQueueItem` to monitor until the build starts, then switch to `getBuild`.
105 ```
106 Tool: getQueueItem
107 Parameters: { "queueId": <returned-queue-id> }
108 → When build starts, returns build number
109 ```
110
1115. **Monitor build until completion** — Use `getBuild` to poll build status until result is available.
112 ```
113 Tool: getBuild
114 Parameters: { "jobFullName": "deploy-network-config", "buildNumber": <build-number> }
115 → Result: SUCCESS | FAILURE | UNSTABLE | ABORTED | NOT_BUILT
116 ```
117
1186. **Update build metadata (optional)** — Use `updateBuild` to set a descriptive display name or mark the build as keep-forever. Requires confirmation.
119 ```
120 Tool: updateBuild
121 Parameters: {
122 "jobFullName": "deploy-network-config",
123 "buildNumber": <build-number>,
124 "displayName": "Production Deploy - v2.4.1",
125 "keepLog": true
126 }
127 ```
128
129### Example Prompts
130
131- "Trigger a build for deploy-network-config with BRANCH=main"
132- "Start job network-validation with DRY_RUN=true and ENVIRONMENT=staging"
133- "Mark build #42 of deploy-network-config as keep-forever"
134- "Track queue item 1234 until the build completes"
135
136---
137
138## Workflow 3: Build Log Analysis (US3)
139
140Retrieve and search build logs for troubleshooting failed builds, identifying errors, and diagnosing pipeline issues.
141
142### Steps
143
1441. **Retrieve build log** — Use `getBuildLog` with job name and build number. For large logs, use the `start` offset parameter for pagination.
145 ```
146 Tool: getBuildLog
147 Parameters: { "jobFullName": "deploy-network-config", "buildNumber": 42 }
148 → Returns console output text
149 ```
150
1512. **Paginate large logs** — If the log is truncated, use the `start` offset to retrieve subsequent sections.
152 ```
153 Tool: getBuildLog
154 Parameters: { "jobFullName": "deploy-network-config", "buildNumber": 42, "start": 50000 }
155 → Returns output starting from byte offset 50000
156 ```
157
1583. **Search logs by pattern** — Use `searchBuildLog` with a regex pattern to find specific lines (errors, warnings, timeouts).
159 ```
160 Tool: searchBuildLog
161 Parameters: {
162 "jobFullName": "deploy-network-config",
163 "buildNumber": 42,
164 "pattern": "ERROR|FATAL|Exception"
165 }
166 → Returns matching log lines
167 ```
168
1694. **Retrieve pipeline-specific logs** — Use `getPipelineRunLog` for pipeline jobs that produce structured run logs.
170 ```
171 Tool: getPipelineRunLog
172 Parameters: { "jobFullName": "deploy-network-config", "runId": "42" }
173 ```
174
175### Example Prompts
176
177- "Show me the build log for deploy-network-config build #42"
178- "Show the last 100 lines of the build log for network-validation #15"
179- "Search the build log for 'ERROR' in deploy-network-config build #42"
180- "Find timeout messages in the latest build of network-validation"
181- "Show the pipeline log for deploy-network-config run #42"
182
183### Handling Large Logs
184
185Build logs can be very large (hundreds of MB for verbose builds). Guidelines:
186- Start with `searchBuildLog` to find relevant sections before retrieving the full log
187- Use `start` offset pagination to retrieve specific sections
188- For troubleshooting, search for `ERROR`, `FATAL`, `Exception`, `FAILURE`, or `timeout` first
189
190---
191
192## Workflow 4: SCM Change Tracking (US4)
193
194Track source code changes associated with Jenkins jobs and builds — correlate builds with commits, find jobs by repository, and review change history.
195
196### Steps
197
1981. **Get job SCM configuration** — Use `getJobScm` to view the repository URL, branch spec, and polling configuration for a job.
199 ```
200 Tool: getJobScm
201 Parameters: { "jobFullName": "deploy-network-config" }
202 → Returns: repository URL, branches, credential ID, polling config
203 ```
204
2052. **Get build SCM details** — Use `getBuildScm` to see the exact revision (commit hash) and branch checked out for a specific build.
206 ```
207 Tool: getBuildScm
208 Parameters: { "jobFullName": "deploy-network-config", "buildNumber": 42 }
209 → Returns: revision hash, branch name at build time
210 ```
211
2123. **List change sets (commits)** — Use `getBuildChangeSets` to see all commits included in a build — author, message, timestamp, and affected files.
213 ```
214 Tool: getBuildChangeSets
215 Parameters: { "jobFullName": "deploy-network-config", "buildNumber": 42 }
216 → Returns: list of change sets with commit details
217 ```
218
2194. **Find jobs by repository** — Use `findJobsWithScmUrl` to discover all Jenkins jobs configured to build from a specific repository.
220 ```
221 Tool: findJobsWithScmUrl
222 Parameters: { "scmUrl": "https://github.com/org/network-configs" }
223 → Returns: list of jobs using this repository
224 ```
225
226### Example Prompts
227
228- "What repository does deploy-network-config use?"
229- "Show me the commits in build #42 of deploy-network-config"
230- "Which commit triggered build #42?"
231- "Find all Jenkins jobs that use the network-configs repository"
232- "What files changed in the latest build of deploy-network-config?"
233
234---
235
236## Workflow 5: Health Check and Setup Verification (US5)
237
238Verify Jenkins connectivity, authentication, and instance health. Recommended as a pre-flight check before first use and as a diagnostic tool when other operations fail.
239
240### Steps
241
2421. **Verify authentication** — Use `whoAmI` to confirm the connection works and inspect the authenticated user's identity and permissions.
243 ```
244 Tool: whoAmI
245 Parameters: {}
246 → Returns: user name, authorities/permissions list
247 ```
248
2492. **Check instance health** — Use `getStatus` to verify Jenkins is healthy and operational.
250 ```
251 Tool: getStatus
252 Parameters: {}
253 → Returns: mode (NORMAL/SHUTDOWN), version, quietingDown status
254 ```
255
256### When to Use
257
258- **First-time setup**: Run both `whoAmI` and `getStatus` to validate the connection
259- **Authentication failures**: Run `whoAmI` to diagnose credential issues
260- **Unexpected errors**: Run `getStatus` to check if Jenkins is shutting down or in maintenance mode
261- **Permission problems**: Run `whoAmI` to verify the user has required authorities
262
263### Example Prompts
264
265- "Check my Jenkins connection"
266- "Who am I on Jenkins?"
267- "Is Jenkins healthy?"
268- "Verify Jenkins is running and I have access"
269
270---
271
272## GAIT Audit Logging
273
274All Jenkins interactions are logged to the GAIT audit trail via `gait_mcp` tools at the skill invocation level (per Constitution IV — GAIT Audit Trail).
275
276### Logging Pattern
277
278For each Jenkins operation:
279
2801. **Before invocation**: Log the tool name and parameters being sent
281 ```
282 gait_mcp.log_action({
283 action: "jenkins_tool_call",
284 tool: "getJobs",
285 parameters: { "nameFilter": "deploy-.*" },
286 status: "initiated"
287 })
288 ```
289
2902. **After invocation**: Log the result summary
291 ```
292 gait_mcp.log_action({
293 action: "jenkins_tool_call",
294 tool: "getJobs",
295 result_summary: "Returned 12 jobs matching filter",
296 status: "completed"
297 })
298 ```
299
3003. **For write operations**: Log the confirmation step
301 ```
302 gait_mcp.log_action({
303 action: "jenkins_write_confirmation",
304 tool: "triggerBuild",
305 parameters: { "jobFullName": "deploy-network-config", "parameters": [...] },
306 operator_confirmed: true,
307 status: "approved"
308 })
309 ```
310
311### What Gets Logged
312
313- Tool name and parameters for every invocation
314- Result summary (success/failure, record count, key identifiers)
315- Operator confirmation for write operations
316- Error details when operations fail
317
318---
319
320## Integration with Other Skills
321
322- **suzieq-observability**: After a network deployment build completes, use SuzieQ to validate network state post-change
323- **aci-change-deploy**: Coordinate ACI changes with Jenkins pipeline execution — trigger build after change approval
324- **gitlab-devops**: Correlate GitLab merge requests with Jenkins builds via SCM change tracking
325- **canvas-a2ui**: Visualize build status trends and pipeline health in network dashboards
326- **gait_mcp**: All Jenkins operations are audit-logged for compliance and traceability
327
328---
329
330## Important Rules
331
3321. **Read-before-write**: Always use `getJob` to verify a job exists and inspect its parameters before `triggerBuild` or `updateBuild`
3332. **Human-in-the-loop**: All write operations require explicit operator confirmation — never auto-trigger builds
3343. **Folder-aware job names**: Jenkins jobs in folders use path notation (e.g., `folder1/folder2/job-name`) — always use the full name
3354. **Parameterized builds**: Check parameter definitions via `getJob` before triggering — pass correct types (String, Boolean, Choice, Text, Password, Run)
3365. **Large log handling**: Use `searchBuildLog` before full log retrieval to avoid overwhelming context with large console output
3376. **GAIT logging**: Every Jenkins tool invocation must be logged to the audit trail
3387. **Credential safety**: Never log or display raw API tokens — credentials are managed via environment variables (Constitution XIII)
3398. **Remote server**: This MCP server is a remote HTTP service — connectivity depends on network access to the Jenkins instance