jenkctl is a Rust-based Jenkins CLI and MCP gateway organized with a DDD-style architecture. The CLI and MCP server share the same application service layer so one core implementation can serve both terminal workflows and editor agents.
- Jenkins CLI for system, job, build, pipeline, node, and monitoring operations
- MCP server powered by rmcp 0.16 over stdio
- JSON response envelope by default, with
--prettyfor human-readable output - JSONL audit logging for request tracking
- Capability detection for Pipeline Linter, Pipeline WFAPI, Credentials API, and Blue Ocean
- System proxy disabled by default to reduce interference from local proxy settings
- Release workflow that prebuilds common binaries for Linux, macOS, and Windows
src/domain: domain models, value objects, and portssrc/application: use-case services and response envelopessrc/infrastructure: Jenkins HTTP client, environment config, and audit loggersrc/interface: CLI, MCP server, and shared runtime bootstrap
Required:
JENKCTL_JENKINS_URLorJENKINS_URLJENKCTL_JENKINS_USERorJENKINS_USERJENKCTL_JENKINS_TOKENorJENKINS_TOKEN
Optional:
JENKCTL_SERVER_ALIAS, defaults todefaultJENKCTL_TIMEOUT_SECONDS, defaults to30JENKCTL_INSECURE_TLS, defaults tofalseJENKCTL_USE_SYSTEM_PROXY, defaults tofalseJENKCTL_AUDIT_ENABLED, defaults totrueJENKCTL_AUDIT_FILE, defaults to~/.jenkctl/audit.logJENKCTL_ACTOR, defaults to<entrypoint>:$USER, for examplecli:aliceormcp:stdio:alice
Example:
export JENKCTL_JENKINS_URL="https://jenkins.example.com"
export JENKCTL_JENKINS_USER="ci-bot"
export JENKCTL_JENKINS_TOKEN="xxxxx"
export JENKCTL_SERVER_ALIAS="production"From the repository root:
cargo run --manifest-path ./Cargo.toml -- system ping --pretty
cargo run --manifest-path ./Cargo.toml -- job list --prettyBuild release binaries:
cargo build --manifest-path ./Cargo.toml --release
./target/release/jenkctl system ping --prettycargo run --manifest-path ./Cargo.toml -- system ping --pretty
cargo run --manifest-path ./Cargo.toml -- system capabilities --pretty
cargo run --manifest-path ./Cargo.toml -- job list --pretty
cargo run --manifest-path ./Cargo.toml -- job info team/backend-service --pretty
cargo run --manifest-path ./Cargo.toml -- build trigger team/backend-service -p BRANCH=main -p DEPLOY_ENV=staging --pretty
cargo run --manifest-path ./Cargo.toml -- build wait team/backend-service 1024 --timeout 900 --interval 5 --pretty
cargo run --manifest-path ./Cargo.toml -- build log team/backend-service 1024 --tail 200 --pretty
cargo run --manifest-path ./Cargo.toml -- build artifacts team/backend-service 1024 --pretty
cargo run --manifest-path ./Cargo.toml -- build cause team/backend-service 1024 --pretty
cargo run --manifest-path ./Cargo.toml -- build test-report team/backend-service 1024 --pretty
cargo run --manifest-path ./Cargo.toml -- pipeline validate --file ./Jenkinsfile --pretty
cargo run --manifest-path ./Cargo.toml -- pipeline stages team/backend-service 1024 --pretty
cargo run --manifest-path ./Cargo.toml -- pipeline step-log team/backend-service 1024 8 --max-lines 100 --pretty
cargo run --manifest-path ./Cargo.toml -- node list --pretty
cargo run --manifest-path ./Cargo.toml -- node info Linux --pretty
cargo run --manifest-path ./Cargo.toml -- monitor failures --limit 10 --history-window 5 --pretty
cargo run --manifest-path ./Cargo.toml -- monitor success-rate --limit 10 --history-window 5 --pretty
cargo run --manifest-path ./Cargo.toml -- monitor long-running --limit 10 --threshold-secs 1800 --prettyThe stdio MCP server is exposed through the main binary and is the recommended entrypoint:
cargo run --manifest-path ./Cargo.toml -- mcpOr use the release binary directly:
cargo build --manifest-path ./Cargo.toml --release
./target/release/jenkctl mcpRecommended VS Code MCP configuration:
{
"servers": {
"jenkctl": {
"type": "stdio",
"command": "/absolute/path/to/jenkctl/target/release/jenkctl",
"args": ["mcp"]
}
},
"inputs": []
}The standalone jenkctl-mcp binary is still shipped for compatibility, but jenkctl mcp is the preferred operational path for packaging, editor setup, and day-to-day MCP usage.
Current MCP surface:
initializepingtools/listtools/call
Current MCP tools:
jenkins_system_pingjenkins_system_infojenkins_system_capabilitiesjenkins_system_queuejenkins_job_listjenkins_job_getjenkins_job_searchjenkins_build_triggerjenkins_build_statusjenkins_build_waitjenkins_build_logjenkins_build_historyjenkins_build_artifactsjenkins_build_causejenkins_build_test_reportjenkins_pipeline_validatejenkins_pipeline_stagesjenkins_pipeline_step_logjenkins_node_listjenkins_node_getjenkins_monitor_failuresjenkins_monitor_success_ratejenkins_monitor_long_running
This repository ships a project-scoped GitHub Copilot skill at .github/skills/jenkctl-cli. Load it when an agent needs to map Jenkins tasks to exact jenkctl commands, understand required environment variables, or decide whether to use the CLI or MCP entrypoint.
The workflow in .github/workflows/ci.yml does the following:
- runs a cross-platform
cargo testmatrix on Linux, macOS, and Windows for pushes tomain, pull requests targetingmain, and release tags - builds release bundles for
x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu,x86_64-apple-darwin,aarch64-apple-darwin, andx86_64-pc-windows-msvc - packages both
jenkctlandjenkctl-mcpin each archive - publishes artifacts to GitHub Releases when a
v*tag is pushed
- Authentication uses Jenkins Basic Auth with API tokens.
- Mutating requests automatically attempt crumb acquisition.
- Audit logging masks sensitive build parameter keys such as
TOKEN,PASSWORD,SECRET,KEY,AUTH, andCREDENTIAL. - Pipeline features depend on Jenkins plugins; unsupported features return explicit error codes.
pipeline step-logdepends on the Pipeline REST API or WFAPI and returnsUNSUPPORTED_CAPABILITYwhen the server does not expose that surface.- To avoid proxy-related TLS and connectivity issues, system proxies are disabled by default. Set
JENKCTL_USE_SYSTEM_PROXY=trueonly when proxy routing is required.