jenkins-slack-mcp

jenkins-slack-mcp

Enables triggering Jenkins builds from IDEs with Slack notifications, requiring only a one-time login.

Category
访问服务器

README

jenkins-slack-mcp

MCP server to trigger Jenkins builds from any IDE with Slack DM notifications. Auto-discovers all jobs on login — no manual configuration.

Install

npm install -g jenkins-slack-mcp

Register in your IDE

Amazon Q

~/.aws/amazonq/mcp.json:

{
  "mcpServers": {
    "jenkins-slack": {
      "command": "jenkins-slack-mcp",
      "args": [],
      "disabled": false
    }
  }
}

VS Code

.vscode/mcp.json:

{
  "mcpServers": {
    "jenkins-slack": { "command": "jenkins-slack-mcp" }
  }
}

Claude Desktop

~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "jenkins-slack": { "command": "jenkins-slack-mcp" }
  }
}

Cursor

.cursor/mcp.json:

{
  "mcpServers": {
    "jenkins-slack": { "command": "jenkins-slack-mcp" }
  }
}

Without global install

{
  "mcpServers": {
    "jenkins-slack": {
      "command": "npx",
      "args": ["-y", "jenkins-slack-mcp"]
    }
  }
}

Flow of Work

┌─────────────────────────────────────────────────────────┐
│  1. login_jenkins (baseUrl only)                        │
│     → Opens browser to Jenkins token page               │
│     → User copies API token + build trigger token       │
│                                                         │
│  2. login_jenkins (all params)                          │
│     → Validates credentials                             │
│     → Auto-discovers ALL jobs from Jenkins              │
│     → Stores encrypted at ~/.jenkins-slack-mcp/         │
│                                                         │
│  3. list_jobs / list_jobs filter="tms"                  │
│     → Shows jobs in table with status (✅ ❌ ⏸️)        │
│                                                         │
│  4. job_details jobName="my-job"                        │
│     → Shows all parameters (name, type, default,        │
│       choices) in table format                          │
│                                                         │
│  5. trigger_build jobName="my-job" params={...}         │
│     → Triggers build with params                        │
│     → Sends Slack DM to you (if configured)             │
│     → Posts to channel (if notifyChannel provided)      │
└─────────────────────────────────────────────────────────┘

Usage

Step 1: Login to Jenkins

First time — just provide the URL, browser opens automatically:

login_jenkins baseUrl="https://jenkins.example.com"

→ Browser opens Jenkins → Copy your API token and build trigger token.

Then login with full credentials:

login_jenkins:
  baseUrl: https://jenkins.example.com
  user: your_username
  apiToken: your_api_token
  buildToken: your_build_trigger_token

→ All jobs auto-discovered!

Step 2: Browse Jobs

list_jobs                    # all jobs
list_jobs filter="tms"       # filter by name

Output:

# Job Name Status
1 build-main ✅ Success
2 lib-packages ✅ Success
3 job-constant ✅ Success

Step 3: Check Parameters

job_details jobName="tms-docker-build-new"

Output:

Parameter Type Default Choices Description
BRANCH String main - Branch to build

Step 4: Trigger Build

trigger_build jobName="tms-docker-build-new" params={"BRANCH": "feature/xyz"}

Step 5 (Optional): Setup Slack DMs

setup_slack:
  botToken: xoxb-your-bot-token
  userId: U0123456789

How to get your Slack User ID:

  1. Open Slack → Click your profile picture
  2. Click "Profile" → Click "..." (more)
  3. Click "Copy Member ID"

How to get bot token:

  1. Go to https://api.slack.com/apps → Your App
  2. OAuth & Permissions → Bot User OAuth Token (starts with xoxb-)

After setup, every trigger_build sends you a DM automatically.


Available Tools

Tool Description
login_jenkins Login + auto-discover jobs (opens browser for new users)
setup_slack Configure Slack bot token + User ID for DM notifications
status Check login status + job count
list_jobs All jobs in table format (filterable)
job_details Show parameters for a job
trigger_build Trigger build + Slack DM + channel notify
refresh_jobs Re-fetch jobs from Jenkins
whoami Current user details
logout Clear all credentials

Security

BuildPilot follows OWASP security best practices:

Credential Storage

  • All credentials (API tokens, Slack tokens) are encrypted at rest using AES-256-GCM
  • Encryption key is machine-bound (derived from hostname + user identity)
  • Config file stored with 600 permissions (owner-read/write only)
  • Atomic file writes prevent data corruption and race conditions

Network Security

  • SSRF Protection — Private IPs, loopback, link-local, and cloud metadata endpoints (169.254.169.254) are blocked
  • TLS enforced — Only HTTP/HTTPS protocols allowed
  • Request timeouts — All HTTP calls have strict timeouts (10-30s)
  • Redirect protection — Auth headers stripped on redirects

Input Validation

  • Build parameter names validated against allowlist ([a-zA-Z0-9_\-.])
  • Reserved parameter keys (token, cause, json, submit) are blocked to prevent injection
  • Parameter values capped at 1000 characters
  • Jenkins URL validated and sanitized before use

OAuth Security

  • OAuth callback server binds to 127.0.0.1 only (not 0.0.0.0)
  • CSRF state parameter uses crypto.randomBytes(32)
  • Timing-safe comparison for state validation
  • Rate limiting on callback endpoint (max 5 attempts)
  • Auto-timeout after 2 minutes
  • All non-callback routes rejected with 404

Error Handling

  • Error messages sanitized to prevent credential leakage
  • URLs, auth headers, and tokens are redacted from error output
  • Error messages truncated to 200 characters

VS Code Extension

See vscode-extension/README.md for the full-featured VS Code extension with:

  • Inline search, grouped jobs, pin/unpin
  • Live build summary webview
  • Stop running builds from history
  • Slack notifications

Credentials

Stored encrypted at ~/.jenkins-slack-mcp/config.enc (AES-256-GCM, 600 permissions, owner-only).

Author

Seetharam1999

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选