loading…
Search for a command to run...
loading…
Jenkins MCP server with bearer token authentication support
██╗███████╗███╗ ██╗██╗ ██╗██╗███╗ ██╗███████╗ ███╗ ███╗ ██████╗██████╗
██║██╔════╝████╗ ██║██║ ██╔╝██║████╗ ██║██╔════╝ ████╗ ████║██╔════╝██╔══██╗
██║█████╗ ██╔██╗ ██║█████╔╝ ██║██╔██╗ ██║███████╗ ██╔████╔██║██║ ██████╔╝
██ ██║██╔══╝ ██║╚██╗██║██╔═██╗ ██║██║╚██╗██║╚════██║ ██║╚██╔╝██║██║ ██╔═══╝
╚█████╔╝███████╗██║ ╚████║██║ ██╗██║██║ ╚████║███████║ ██║ ╚═╝ ██║╚██████╗██║
╚════╝ ╚══════╝╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚═╝ ╚═════╝╚═╝
TypeScript Node.js MCP License
A Jenkins MCP server with 37 tools for managing jobs, builds, nodes, views, and CI/CD workflows
Features • Quick Start • Installation • Tools • Development
MCP_JENKINS_* env vars (priority-based)MCP_JENKINS_ALLOW_TOOLS / MCP_JENKINS_BLOCK_TOOLSOption 1: Via npm (recommended once published):
# No installation needed! Just use npx in your MCP config
npx --yes @kud/mcp-jenkins@latest
Option 2: Local installation:
git clone https://github.com/kud/mcp-jenkins.git
cd mcp-jenkins
npm install
npm run build
The server supports 2 ways to provide configuration (highest to lowest priority):
--url, --user, --api-token, --bearer-tokenMCP_JENKINS_* environment variables - MCP_JENKINS_URL, MCP_JENKINS_USER, etc.Using environment variables (recommended):
claude mcp add --transport stdio --scope user jenkins \
--env MCP_JENKINS_URL=https://your-jenkins.com \
--env MCP_JENKINS_USER=your_username \
--env MCP_JENKINS_API_TOKEN=your_token \
-- npx --yes @kud/mcp-jenkins@latest
Using CLI arguments (override env vars):
claude mcp add --transport stdio --scope user jenkins \
-- npx --yes @kud/mcp-jenkins@latest \
--url https://your-jenkins.com \
--user your_username \
--api-token your_token
If installed locally:
claude mcp add --transport stdio --scope user jenkins \
-- node ~/path/to/mcp-jenkins/dist/index.js \
--url https://your-jenkins.com \
--user your_username \
--api-token your_token
✅ Done! Now you can use Jenkins commands in your AI assistant.
Choose your development environment:
For: Claude AI via command line interface
Add the Jenkins MCP server to Claude CLI:
Via npm with env vars (recommended):
claude mcp add --transport stdio --scope user jenkins \
--env MCP_JENKINS_URL=https://pipeline.yourcompany.com \
--env MCP_JENKINS_USER=your_username \
--env MCP_JENKINS_API_TOKEN=your_api_token \
-- npx --yes @kud/mcp-jenkins@latest
Via npm with CLI args:
claude mcp add --transport stdio --scope user jenkins \
-- npx --yes @kud/mcp-jenkins@latest \
--url https://pipeline.yourcompany.com \
--user your_username \
--api-token your_api_token
Local installation with CLI args:
claude mcp add --transport stdio --scope user jenkins \
-- node $HOME/path/to/mcp-jenkins/dist/index.js \
--url https://pipeline.yourcompany.com \
--user your_username \
--api-token your_api_token
Multiple Jenkins instances:
claude mcp add --transport stdio --scope user jenkins \
--env MCP_JENKINS_URL="https://pipeline.yourcompany.com,https://scheduler.yourcompany.com" \
--env MCP_JENKINS_USER="your_username,your_username" \
--env MCP_JENKINS_API_TOKEN="token1,token2" \
-- npx --yes @kud/mcp-jenkins@latest
# Instances named "pipeline" and "scheduler" automatically from hostnames
Verify: claude mcp list should show jenkins
For: Claude.ai in your browser
⚠️ Not supported. Claude.ai web interface doesn't support custom MCP servers yet.
Alternatives:
npm run inspect:dev → http://localhost:5173For: Claude AI desktop application
macOS:
open ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows:
notepad %APPDATA%\Claude\claude_desktop_config.json
Via npm with env vars (recommended):
{
"mcpServers": {
"jenkins": {
"command": "npx",
"args": ["--yes", "@kud/mcp-jenkins@latest"],
"env": {
"MCP_JENKINS_URL": "https://pipeline.yourcompany.com",
"MCP_JENKINS_USER": "your_username",
"MCP_JENKINS_API_TOKEN": "your_api_token"
}
}
}
}
Via npm with CLI args:
{
"mcpServers": {
"jenkins": {
"command": "npx",
"args": [
"--yes",
"@kud/mcp-jenkins@latest",
"--url",
"https://pipeline.yourcompany.com",
"--user",
"your_username",
"--api-token",
"your_api_token"
]
}
}
}
Local installation with CLI args:
{
"mcpServers": {
"jenkins": {
"command": "node",
"args": [
"/absolute/path/to/mcp-jenkins/dist/index.js",
"--url",
"https://pipeline.yourcompany.com",
"--user",
"your_username",
"--api-token",
"your_api_token"
]
}
}
}
Bearer token example:
{
"mcpServers": {
"jenkins": {
"command": "npx",
"args": [
"--yes",
"@kud/mcp-jenkins@latest",
"--url",
"https://pipeline.yourcompany.com",
"--bearer-token",
"your_bearer_token"
]
}
}
}
Multiple Jenkins instances:
{
"mcpServers": {
"jenkins": {
"command": "npx",
"args": ["--yes", "@kud/mcp-jenkins@latest"],
"env": {
"MCP_JENKINS_URL": "https://pipeline.yourcompany.com,https://scheduler.yourcompany.com",
"MCP_JENKINS_USER": "your_username,your_username",
"MCP_JENKINS_API_TOKEN": "token1,token2"
}
}
}
}
Quit (Cmd+Q / Alt+F4) and reopen Claude Desktop
For: VSCode with MCP-compatible extensions (Cline, Claude Dev, Continue)
Cline:
Settings (Cmd+, / Ctrl+,) → Search "Cline: MCP Settings" → Edit in settings.json:
{
"cline.mcpServers": {
"jenkins": {
"command": "npx",
"args": ["@kud/mcp-jenkins"],
"env": {
"MCP_JENKINS_URL": "https://pipeline.yourcompany.com",
"MCP_JENKINS_USER": "your_username",
"MCP_JENKINS_API_TOKEN": "your_api_token"
}
}
}
}
Multiple Jenkins instances:
{
"cline.mcpServers": {
"jenkins": {
"command": "npx",
"args": ["@kud/mcp-jenkins"],
"env": {
"MCP_JENKINS_URL": "https://pipeline.yourcompany.com,https://scheduler.yourcompany.com",
"MCP_JENKINS_USER": "your_username,your_username",
"MCP_JENKINS_API_TOKEN": "token1,token2"
}
}
}
}
Or for local installation, use "command": "node" and "args": ["/absolute/path/to/mcp-jenkins/dist/index.js"]
Claude Dev / Continue:
Command Palette (Cmd+Shift+P) → "MCP: Edit Config" → Add similar configuration
Reload window after configuration
For: Cursor IDE with built-in AI
Settings (Cmd+, / Ctrl+,) → Search "MCP" → Edit Config or open ~/.cursor/mcp_config.json:
{
"mcpServers": {
"jenkins": {
"command": "npx",
"args": ["--yes", "@kud/mcp-jenkins@latest"],
"env": {
"MCP_JENKINS_URL": "https://pipeline.yourcompany.com",
"MCP_JENKINS_USER": "your_username",
"MCP_JENKINS_API_TOKEN": "your_api_token"
}
}
}
}
Multiple Jenkins instances:
{
"mcpServers": {
"jenkins": {
"command": "npx",
"args": ["--yes", "@kud/mcp-jenkins@latest"],
"env": {
"MCP_JENKINS_URL": "https://pipeline.yourcompany.com,https://scheduler.yourcompany.com",
"MCP_JENKINS_USER": "your_username,your_username",
"MCP_JENKINS_API_TOKEN": "token1,token2"
}
}
}
}
Or for local installation, use "command": "node" and "args": ["/absolute/path/to/mcp-jenkins/dist/index.js"]
Restart Cursor (Cmd+Q / Alt+F4) after configuration
For: Windsurf AI-powered code editor
Settings → AI Settings → Model Context Protocol → Add Server:
{
"mcpServers": {
"jenkins": {
"command": "npx",
"args": ["--yes", "@kud/mcp-jenkins@latest"],
"env": {
"MCP_JENKINS_URL": "https://pipeline.yourcompany.com",
"MCP_JENKINS_USER": "your_username",
"MCP_JENKINS_API_TOKEN": "your_api_token"
}
}
}
}
Multiple Jenkins instances:
{
"mcpServers": {
"jenkins": {
"command": "npx",
"args": ["--yes", "@kud/mcp-jenkins@latest"],
"env": {
"MCP_JENKINS_URL": "https://pipeline.yourcompany.com,https://scheduler.yourcompany.com",
"MCP_JENKINS_USER": "your_username,your_username",
"MCP_JENKINS_API_TOKEN": "token1,token2"
}
}
}
}
Or edit ~/.windsurf/mcp_settings.json directly. For local installation, use "command": "node" with full path.
Restart Windsurf after configuration.
For: GitHub Copilot in VSCode or other editors
⚠️ Not supported. GitHub Copilot doesn't support MCP servers.
Options:
src/lib/jenkins-client.ts as examples for direct API callsFor: New GitHub Copilot CLI (@github/copilot) in your terminal
Note: This is for the NEW Copilot CLI (npm install -g @github/copilot), not the old gh copilot extension.
Create or edit ~/.copilot/mcp-config.json:
{
"mcpServers": {
"jenkins": {
"command": "npx",
"args": ["--yes", "@kud/mcp-jenkins@latest"],
"env": {
"MCP_JENKINS_URL": "https://pipeline.yourcompany.com",
"MCP_JENKINS_USER": "your_username",
"MCP_JENKINS_API_TOKEN": "your_api_token"
}
}
}
}
Then run: copilot
{
"mcpServers": {
"jenkins": {
"command": "npx",
"args": [
"--yes",
"@kud/mcp-jenkins@latest",
"--url",
"https://pipeline.yourcompany.com",
"--user",
"your_username",
"--api-token",
"your_api_token"
]
}
}
}
Pass MCP config directly via command line:
copilot --additional-mcp-config '{
"mcpServers": {
"jenkins": {
"command": "npx",
"args": [
"--yes", "@kud/mcp-jenkins@latest",
"--url", "https://pipeline.yourcompany.com",
"--user", "your_username",
"--api-token", "your_api_token"
]
}
}
}'
Or save to a file and reference it:
# Save config to jenkins-mcp.json
copilot --additional-mcp-config @jenkins-mcp.json
For local installation, use "command": "node" with path in args:
"args": ["/absolute/path/to/mcp-jenkins/dist/index.js", "--url", "...", "--user", "...", "--api-token", "..."]
{
"mcpServers": {
"jenkins": {
"command": "npx",
"args": ["--yes", "@kud/mcp-jenkins@latest"],
"env": {
"MCP_JENKINS_URL": "https://pipeline.yourcompany.com,https://scheduler.yourcompany.com",
"MCP_JENKINS_USER": "your_username,your_username",
"MCP_JENKINS_API_TOKEN": "token1,token2"
}
}
}
}
For scripts and automation:
copilot --allow-all-tools -p "Check status of mobile-pipeline build"
For: IntelliJ IDEA, WebStorm, PyCharm, GoLand, RubyMine, PhpStorm, Rider, CLion, DataGrip
Settings (Cmd+, / Ctrl+,) → Tools → AI Assistant → Model Context Protocol → Add Server:
npx--yes @kud/mcp-jenkins@latestMCP_JENKINS_URL=https://pipeline.yourcompany.com
MCP_JENKINS_USER=your_username
MCP_JENKINS_API_TOKEN=your_api_token
Multiple Jenkins instances: set these environment variables:
MCP_JENKINS_URL=https://pipeline.yourcompany.com,https://scheduler.yourcompany.com
MCP_JENKINS_USER=your_username,your_username
MCP_JENKINS_API_TOKEN=token1,token2
For local installation, use Command: node and Arguments: /absolute/path/to/mcp-jenkins/dist/index.js
Apply and restart the IDE.
Alternative: If MCP not available, use MCP-compatible CLI from built-in terminal (Alt+F12 / ⌥F12)
Notes:
| Tool | Description |
|---|---|
jenkins_list_jobs |
List all Jenkins jobs |
jenkins_search_jobs |
Search jobs by name |
jenkins_get_job_status |
Get last build status |
jenkins_enable_job |
Enable a disabled job |
jenkins_disable_job |
Disable a job |
jenkins_delete_job |
Delete a job (⚠️ permanent) |
jenkins_get_job_config |
Get job XML configuration |
jenkins_create_job |
Create a new job from XML config |
jenkins_update_job_config |
Update an existing job's XML config |
jenkins_rename_job |
Rename a job |
jenkins_copy_job |
Copy/duplicate a job |
| Tool | Description |
|---|---|
jenkins_get_build_status |
Get specific build status |
jenkins_get_recent_builds |
Get recent builds (last N) |
jenkins_trigger_build |
Trigger a new build |
jenkins_stop_build |
Stop/abort running build |
jenkins_delete_build |
Delete a build |
jenkins_replay_build |
Replay a pipeline build |
jenkins_get_console_log |
Get build console output |
jenkins_get_build_changes |
Get Git commits for build |
jenkins_get_pipeline_stages |
Get pipeline stage status |
| Tool | Description |
|---|---|
jenkins_get_test_results |
Get test pass/fail counts |
jenkins_list_artifacts |
List build artifacts |
jenkins_get_artifact |
Download artifact (base64) |
| Tool | Description |
|---|---|
jenkins_get_queue |
View pending builds |
jenkins_cancel_queue |
Cancel queued build |
| Tool | Description |
|---|---|
jenkins_list_nodes |
List all agents/nodes |
jenkins_get_node |
Get detailed info on a specific node |
jenkins_toggle_node_offline |
Toggle a node online/offline |
jenkins_get_system_info |
Get Jenkins system info |
jenkins_get_version |
Get Jenkins version |
jenkins_get_plugins |
List installed plugins |
jenkins_quiet_down |
Enable quiet mode (⚠️ requires confirm) |
jenkins_cancel_quiet_down |
Cancel quiet mode |
| Tool | Description |
|---|---|
jenkins_list_views |
List all views with their jobs |
jenkins_get_view |
Get details for a specific view |
| Tool | Description |
|---|---|
jenkins_list_instances |
List all configured instances with their URLs |
jenkins_safe_restart |
Safely restart Jenkins (⚠️ requires confirm) |
Total: 37 Tools covering ~95% of Jenkins API operations!
Once configured, interact with Jenkins naturally:
You: "List all my Jenkins jobs"
AI: *Shows list of all jobs*
You: "What's the status of the 'api-backend' build?"
AI: *Shows latest build status, duration, result*
You: "Get the test results for build #42 of 'mobile-pipeline'"
AI: *Shows pass/fail counts, test suites*
You: "Show me the pipeline stages for that failed build"
AI: *Shows which stage failed and durations*
You: "Trigger a build for 'deploy-staging' with VERSION=2.1.0"
AI: *Triggers build with parameters*
You: "Stop build #966 of 'mobile-pipeline'"
AI: *Stops the running build*
You: "Show me the queue"
AI: *Lists all pending builds*
You: "What version of Jenkins are we running?"
AI: *Shows Jenkins version*
mcp-jenkins/
├── src/
│ ├── common/ # Shared utilities
│ │ ├── env.ts # Environment config
│ │ ├── errors.ts # Error handling
│ │ ├── http.ts # HTTP client (native fetch)
│ │ ├── logger.ts # JSON logging
│ │ └── index.ts # Exports
│ ├── lib/
│ │ └── jenkins-client.ts # Jenkins API client
│ ├── tools/ # 25 MCP tool implementations
│ │ ├── get-job-status.ts
│ │ ├── trigger-build.ts
│ │ ├── get-test-results.ts
│ │ ├── stop-build.ts
│ │ └── ... (21 more)
│ └── index.ts # MCP server entrypoint
├── dist/ # Compiled output
├── package.json
├── tsconfig.json
└── README.md
| Script | Description |
|---|---|
npm run build |
Compile TypeScript to JavaScript |
npm run build:watch |
Watch mode - rebuild on changes |
npm run dev |
Run in development (tsx) |
npm start |
Run compiled server |
npm run inspect |
Open MCP inspector |
npm run inspect:dev |
Inspector in dev mode (no build) |
npm run typecheck |
Type check without building |
npm run clean |
Remove build artifacts |
# Terminal 1: Watch mode
npm run build:watch
# Terminal 2: Test with inspector
npm run inspect:dev
export MCP_JENKINS_URL=https://pipeline.yourcompany.com
export MCP_JENKINS_USER=your_username
export MCP_JENKINS_API_TOKEN=your_token
npm run inspect:dev
Opens http://localhost:5173 - test all tools interactively!
src/tools/:// src/tools/my-new-tool.ts
import { JenkinsClient } from "../lib/jenkins-client.js"
export interface MyToolInput {
someParam: string
}
export const myNewTool = async (client: JenkinsClient, input: MyToolInput) => {
// Implementation
return { result: "success" }
}
Add method to JenkinsClient (src/lib/jenkins-client.ts)
Register in src/index.ts:
tools arraytoolHandlers mapRebuild:
npm run build
The server uses a 2-tier priority system for configuration:
CLI Arguments (Highest Priority)
--url <url> - Jenkins server URL--user <username> - Username for Basic auth--api-token <token> - API token for Basic auth--bearer-token <token> - Bearer token for OAuth/token authMCP_JENKINS_* Environment Variables
MCP_JENKINS_URLMCP_JENKINS_USERMCP_JENKINS_API_TOKENMCP_JENKINS_BEARER_TOKENConnect to more than one Jenkins server in a single MCP entry using comma or pipe-separated values.
Automatic naming (derived from URL hostname):
export MCP_JENKINS_URL="https://pipeline.yourcompany.com,https://scheduler.yourcompany.com"
export MCP_JENKINS_USER="your_username,your_username"
export MCP_JENKINS_API_TOKEN="token1,token2"
# Instances are automatically named "pipeline" and "scheduler"
Custom naming with MCP_JENKINS_INSTANCES:
Use MCP_JENKINS_INSTANCES when you want explicit names (e.g., the hostname isn't descriptive enough, or both instances share the same host):
export MCP_JENKINS_INSTANCES="ci,prod"
export MCP_JENKINS_URL="https://jenkins.yourcompany.com/ci,https://jenkins.yourcompany.com/prod"
export MCP_JENKINS_USER="your_username,your_username"
export MCP_JENKINS_API_TOKEN="token1,token2"
# Instances are named "ci" and "prod"
The number of values in MCP_JENKINS_INSTANCES must match the number of URLs.
Then pass instance in tool calls:
"Trigger a build for 'deploy' on the scheduler instance"
"List jobs on ci"
The first instance is always the default — tools work without instance if you only have one server.
Note: Use
|as delimiter instead of,if any value might contain a comma (e.g., unusual URLs).
Control which tools are exposed to the AI using an allowlist or blocklist.
Allowlist — expose only specific tools:
export MCP_JENKINS_ALLOW_TOOLS="jenkins_list_jobs,jenkins_get_job_status,jenkins_get_build_status"
Blocklist — hide specific tools (all others remain available):
export MCP_JENKINS_BLOCK_TOOLS="jenkins_delete_job,jenkins_trigger_build,jenkins_safe_restart"
If both are set, MCP_JENKINS_ALLOW_TOOLS takes precedence.
Read-only monitoring preset — block all write/destructive tools:
export MCP_JENKINS_BLOCK_TOOLS="jenkins_trigger_build,jenkins_stop_build,jenkins_delete_build,jenkins_cancel_queue,jenkins_enable_job,jenkins_disable_job,jenkins_delete_job,jenkins_create_job,jenkins_update_job_config,jenkins_rename_job,jenkins_copy_job,jenkins_toggle_node_offline,jenkins_quiet_down,jenkins_cancel_quiet_down,jenkins_safe_restart,jenkins_replay_build"
All CLI args:
node dist/index.js --url https://jenkins.com --user admin --api-token abc123
Mixed (CLI overrides env):
MCP_JENKINS_USER=dev_user node dist/index.js --url https://jenkins.com --api-token xyz789
# Uses: URL from CLI, token from CLI, user from env
Follow these steps to create an API token for the MCP server:
Store the token securely - you'll need it for configuration:
MCP_JENKINS_BEARER_TOKENMCP_JENKINS_API_TOKEN (along with MCP_JENKINS_USER)Example token format: 11abcd1234567890abcdef1234567890ab
💡 Tip: You can see all your active tokens in the "Current token(s)" list. Each shows when it was created and last used, helping you manage and rotate tokens regularly.
Bearer Token (Recommended):
--env MCP_JENKINS_BEARER_TOKEN=your_token
Basic Auth:
--env MCP_JENKINS_USER=your_username
--env MCP_JENKINS_API_TOKEN=your_token
This server forwards any Authorization header to Jenkins. If your Jenkins uses OAuth (via plugins), just pass the OAuth token as MCP_JENKINS_BEARER_TOKEN.
npm install && npm run build# Test your credentials
curl -u username:token https://your-jenkins.com/api/json
If this returns JSON, your credentials are valid!
# Clean rebuild
npm run clean && npm run build
Claude Desktop logs:
~/Library/Logs/Claude/mcp*.log%APPDATA%\Claude\logs\mcp*.logClaude Code CLI logs:
claude mcp get jenkins
claude_desktop_config.json)Contributions welcome! Please ensure:
npm run buildtools array and toolHandlersMIT License - see LICENSE file
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"jenkins": {
"command": "npx",
"args": [
"-y",
"@kud/mcp-jenkins"
]
}
}
}PRs, issues, code search, CI status
автор: GitHubDatabase, auth and storage
автор: SupabaseReference / test server with prompts, resources, and tools.
Secure file operations with configurable access controls.
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development