Skip to main content

Jenkins CLI + MCP server — manage nodes, users, and jobs from the terminal or from AI agents

Project description

ijenk

CI

A Jenkins CLI + MCP server — manage nodes, users, and jobs from the terminal or from AI agents.

Features

  • Node Management: Add, remove, and list worker nodes/agents.
  • Account Management: Create and configure Jenkins user accounts.
  • Job Overview: List jobs and their status.
  • CSRF Token / Crumb Handling: Automatically acquires and attaches Jenkins-Crumb for Jenkins 2.x instances with security enabled.
  • Dual Mode: Works as a standalone terminal CLI (ijenk) or as an MCP server for AI agents (ijenk-mcp).

Install

pip install ijenk

or with uv:

uv tool install ijenk

Quickstart

export JENKINS_URL="https://jenkins.example.com"
export JENKINS_USER="admin"
export JENKINS_PASSWORD="your-api-token"

ijenk status

CLI Usage

# Check status of all nodes
ijenk status

# Add a worker node
ijenk node add worker-01 --ip 192.0.2.10 --labels "linux worker"

# Remove a worker node
ijenk node remove worker-01

# Create a new user account
ijenk user create someuser 'a-strong-password' --email someuser@example.com

# List all jobs
ijenk jobs

# Run the MCP stdio server
ijenk serve

Credentials can also be passed explicitly, overriding env vars / config file:

ijenk --url https://jenkins.example.com --user admin --password '...' status

Configuration

ijenk never ships with credentials. It resolves connection settings in this order, first match wins:

  1. Explicit CLI flags: --url, --user, --password
  2. Environment variables: JENKINS_URL, JENKINS_USER, JENKINS_PASSWORD
  3. A JSON config file at ~/.config/ijenk/config.json

If no username/password is found by any of the above, the command exits with a clear error instead of connecting anonymously.

Environment variables

export JENKINS_URL="https://jenkins.example.com"
export JENKINS_USER="your-jenkins-username"
export JENKINS_PASSWORD="your-jenkins-api-token"

Config file

Create ~/.config/ijenk/config.json:

{
  "url": "https://jenkins.example.com",
  "username": "your-jenkins-username",
  "password": "your-jenkins-api-token"
}

Running as an MCP Server for AI Agents

ijenk ships a dedicated entry point for the MCP server:

ijenk-mcp

(equivalent to ijenk serve)

Register it with Claude Code:

claude mcp add jenkins -- ijenk-mcp

Exposed MCP Tools:

  • jenkins_get_status()
  • jenkins_add_node(name, ip, labels, remote_fs)
  • jenkins_remove_node(name)
  • jenkins_create_user(username, password, email)
  • jenkins_list_jobs()

Security

Requests use HTTP Basic Auth, which sends username:password base64-encoded on every request — base64 is trivially reversible, not encryption. Use an https:// Jenkins URL, or make sure the connection stays on a trusted network, before sending real credentials.

Prefer a Jenkins API token over your account password: generate one under your Jenkins user profile ("Configure" → "API Token") and set it as JENKINS_PASSWORD. ijenk accepts an API token anywhere it accepts a password, and tokens can be revoked independently of your login credentials.

Development

git clone https://github.com/ml-lubich/ijenk.git
cd ijenk
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Running Tests

pytest -q

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ijenk-0.1.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ijenk-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file ijenk-0.1.0.tar.gz.

File metadata

  • Download URL: ijenk-0.1.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for ijenk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c332869881bc734f0f0b5f9c941607431aae163b26cf48f358ab0e9d22396c2c
MD5 2bd7cdda49c5ead75c7c6000794ce405
BLAKE2b-256 f9e6693915600c87a4d71a3b91b07ff341e84545973f71ebcc9ea7b28e061a3b

See more details on using hashes here.

File details

Details for the file ijenk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ijenk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for ijenk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bfb6507b1c507a661af6be890efd2f9b94bad193b149b69a23f0376a2c99252c
MD5 7206f7631af52a663474450a9e8ace3e
BLAKE2b-256 5e0d99d53ae0c8176ee15bc00d720a1ad28774ffe156791b46b23eb472186479

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page