jenkins-http-mcp-server
MCP-сервер для Jenkins
Внешний Python MCP-сервер для Jenkins 2.563. Он подключается через стандартные HTTP API Jenkins, используя разрешения, доступные для JENKINS_USER и JENKINS_API_TOKEN.
Он не требует прав администратора Jenkins, не устанавливает плагины Jenkins и не зависит от официального плагина Jenkins MCP Server.
Настройка Python
Этот проект был инициализирован с помощью pyenv с использованием последней стабильной версии Python 3.14.x, доступной локально:
Python:
3.14.4pyenv virtualenv:
venv3144
Для воспроизведения:
pyenv local venv3144
python --version
which python
pyenv versionRelated MCP server: Jenkins MCP Server
Установка
python -m pip install -e '.[dev]'Окружение
Обязательно:
export JENKINS_URL="https://jenkins.example.com/"
export JENKINS_USER="your-user"
export JENKINS_API_TOKEN="your-api-token"Опционально:
export JENKINS_VERIFY_SSL=1
export JENKINS_TIMEOUT_SECONDS=30
export JENKINS_MCP_MAX_RESPONSE_BYTES=2000000
export JENKINS_MCP_MAX_LOG_BYTES=200000Шлюзы записи:
export JENKINS_MCP_ENABLE_WRITES=1
export JENKINS_MCP_ENABLE_JOB_CONFIG_WRITE=1
export JENKINS_MCP_ENABLE_DELETE=1Не храните реальные секреты Jenkins в файлах конфигурации клиента MCP.
Запуск STDIO-сервера
python -m jenkins_mcp_serverКонсольный скрипт:
jenkins-mcp-serverНастройка клиента
Codex CLI:
docs/codex-setup.mdGemini CLI:
docs/gemini-setup.md
Инструменты
Только для чтения:
jenkins_whoamijenkins_versionjenkins_healthjenkins_get_jsonjenkins_list_jobsjenkins_get_jobjenkins_get_job_configjenkins_list_buildsjenkins_get_buildjenkins_get_build_logjenkins_get_build_artifactsjenkins_get_test_reportjenkins_list_queuejenkins_get_queue_itemjenkins_list_viewsjenkins_get_viewjenkins_list_nodesjenkins_get_nodejenkins_list_plugins
Инструменты записи, ограниченные JENKINS_MCP_ENABLE_WRITES=1:
jenkins_trigger_buildjenkins_trigger_build_with_parametersjenkins_stop_buildjenkins_cancel_queue_itemjenkins_enable_jobjenkins_disable_job
Опциональные инструменты конфигурации заданий, ограниченные JENKINS_MCP_ENABLE_WRITES=1 и JENKINS_MCP_ENABLE_JOB_CONFIG_WRITE=1:
jenkins_create_jobjenkins_copy_jobjenkins_update_job_config
Удаление дополнительно требует JENKINS_MCP_ENABLE_DELETE=1:
jenkins_delete_job
Безопасность
По умолчанию только чтение.
Инструменты записи требуют явных флагов локального окружения и разрешений на стороне Jenkins.
Логи Jenkins и вывод заданий рассматриваются как недоверенный текст.
API-токены и заголовки авторизации не выводятся вспомогательными средствами сервера.
Ошибки 401, 403, 404, сбои crumb и ошибки разрешений возвращают структурированные ошибки.
Ограничения
Нет консоли скриптов.
Нет перезапуска, безопасного перезапуска или режима ожидания (quiet down).
Нет установки/обновления плагинов.
Нет чтения/записи учетных данных.
Нет создания/удаления узлов.
Нет изменений глобальной конфигурации.
Нет управления пользователями.
jenkins_get_test_reportзависит от плагина отчетов о тестировании, такого как JUnit, предоставляющегоtestReport; если он отсутствует, инструмент выдает понятную ошибку.Пути к вложенным папкам кодируются в URL как повторяющиеся компоненты пути
job/<segment>. Контроллеры, не имеющие нужного типа папки/задания, возвращают ошибку Jenkins 404.
Тестирование
Обычные тесты являются моковыми и не требуют работающего контроллера Jenkins:
python -m pytest
python -m compileall src
ruff checkОпциональные интеграционные тесты запускаются только при установке всех параметров:
export JENKINS_INTEGRATION_TESTS=1
export JENKINS_URL="https://jenkins.example.com/"
export JENKINS_USER="your-user"
export JENKINS_API_TOKEN="your-api-token"
python -m pytest tests/test_integration.pyДокументация с доказательствами
docs/source-truth.mddocs/source-skills-check.mddocs/existing-research.mddocs/architecture-decision.mddocs/tool-evidence.mddocs/security.md
Available Tools
40 toolsjenkins_cancel_artifact_downloadADestructive
Request cancellation of a running artifact download.
Inputs: operation_id (required). Returns: Structured content returned by successful Jenkins tools.
jenkins_cancel_queue_itemADestructive
Cancel a Jenkins queue item. Requires JENKINS_MCP_ENABLE_WRITES=1.
Inputs: item_id (required). Returns: Structured content returned by successful Jenkins tools.
jenkins_cancel_workspace_bundle_downloadBDestructive
Request cancellation of a running workspace bundle operation.
Inputs: operation_id (required). Returns: Structured content returned by successful Jenkins tools.
jenkins_cleanup_workspace_bundle_operationsADestructive
Delete bounded, terminal local workspace operations older than the requested age.
Inputs: max_operations, older_than_days. Returns: Structured content returned by successful Jenkins tools.
jenkins_copy_jobB
Copy a top-level job. Requires write and job-config flags.
Inputs: from_job (required), new_name (required). Returns: Structured content returned by successful Jenkins tools.
jenkins_create_jobA
Create a top-level job from config.xml. Requires write and job-config flags.
Inputs: name (required), config_xml (required). Returns: Structured content returned by successful Jenkins tools.
jenkins_delete_jobADestructive
Delete a job. Requires write, job-config, and delete flags.
Inputs: job (required). Returns: Structured content returned by successful Jenkins tools.
jenkins_disable_jobBDestructive
Disable a job. Requires JENKINS_MCP_ENABLE_WRITES=1.
Inputs: job (required). Returns: Structured content returned by successful Jenkins tools.
jenkins_enable_jobADestructive
Enable a job. Requires JENKINS_MCP_ENABLE_WRITES=1.
Inputs: job (required). Returns: Structured content returned by successful Jenkins tools.
jenkins_get_artifact_download_statusCDestructive
Get artifact download bytes, speed, paths, and final status.
Inputs: operation_id (required). Returns: Structured content returned by successful Jenkins tools.
jenkins_get_buildARead-only
Get a build by number or Jenkins permalink such as lastBuild.
Inputs: job (required), build (required), tree. Returns: Structured content returned by successful Jenkins tools.
jenkins_get_build_artifactsBRead-only
List artifacts exported on a build JSON API response.
Inputs: job (required), build (required). Returns: Structured content returned by successful Jenkins tools.
jenkins_get_build_logARead-only
Get consoleText for a build, truncated by JENKINS_MCP_MAX_LOG_BYTES.
Inputs: job (required), build (required). Returns: Structured content returned by successful Jenkins tools.
jenkins_get_build_log_chunkARead-only
Read one progressive log response and return Jenkins' next safe cursor.
Inputs: job (required), build (required), start. Returns: Structured content returned by successful Jenkins tools.
jenkins_get_jobARead-only
Get one job by Jenkins job path. Nested paths use slash-separated names or a list.
Inputs: job (required), tree. Returns: Structured content returned by successful Jenkins tools.
jenkins_get_job_configARead-only
Read serialized job config.xml; secrets may be redacted without Configure permission.
Inputs: job (required). Returns: Structured content returned by successful Jenkins tools.
jenkins_get_jsonBRead-only
GET a relative Jenkins JSON API path. Rejects external URLs and traversal.
Inputs: path (required), query. Returns: Structured content returned by successful Jenkins tools.
jenkins_get_nodeARead-only
Get one Jenkins computer/node by name. Use (built-in) for the built-in node.
Inputs: node (required). Returns: Structured content returned by successful Jenkins tools.
jenkins_get_queue_itemARead-only
Get one Jenkins queue item by ID.
Inputs: item_id (required). Returns: Structured content returned by successful Jenkins tools.
jenkins_get_test_reportARead-only
Get /testReport/api/json when a test-report plugin such as JUnit provides it.
Inputs: job (required), build (required). Returns: Structured content returned by successful Jenkins tools.
jenkins_get_viewARead-only
Get one Jenkins view by name.
Inputs: view (required), tree. Returns: Structured content returned by successful Jenkins tools.
jenkins_get_workspace_bundle_statusBDestructive
Get download/extract/log progress, bytes, speed, paths, and final status.
Inputs: operation_id (required). Returns: Structured content returned by successful Jenkins tools.
jenkins_get_workspace_treeARead-only
List a bounded live workspace tree. Paths are not bound to a build number.
Inputs: job (required), max_depth, max_entries, workspace_path. Returns: Structured content returned by successful Jenkins tools.
jenkins_healthARead-only
Return a small health snapshot from top-level Jenkins JSON and version headers.
Inputs: no named parameters. Returns: Structured content returned by successful Jenkins tools.
jenkins_list_buildsARead-only
List recent builds for a job.
Inputs: job (required), tree. Returns: Structured content returned by successful Jenkins tools.
jenkins_list_jobsBRead-only
List jobs visible to the Jenkins user.
Inputs: tree, depth. Returns: Structured content returned by successful Jenkins tools.
jenkins_list_nodesARead-only
List Jenkins computers/nodes visible to the user.
Inputs: tree. Returns: Structured content returned by successful Jenkins tools.
jenkins_list_pluginsBRead-only
List installed Jenkins plugins visible through pluginManager/api/json.
Inputs: tree. Returns: Structured content returned by successful Jenkins tools.
jenkins_list_queueBRead-only
List visible Jenkins queue items.
Inputs: tree. Returns: Structured content returned by successful Jenkins tools.
jenkins_list_viewsBRead-only
List Jenkins views visible to the user.
Inputs: tree. Returns: Structured content returned by successful Jenkins tools.
jenkins_search_build_logARead-only
Stream and search bounded consoleText for an exact, case-sensitive literal.
Inputs: job (required), build (required), pattern (required), max_matches, +1 more. Returns: Structured content returned by successful Jenkins tools.
jenkins_start_artifact_downloadB
Start a gated async download of one archived build artifact to local disk.
Inputs: job (required), artifact_path (required), build. Returns: Structured content returned by successful Jenkins tools.
jenkins_start_workspace_bundle_downloadCDestructive
Start or join a guarded workspace capture plus exact build console log.
Inputs: job (required), build, force_refresh. Returns: Structured content returned by successful Jenkins tools.
jenkins_start_workspace_path_downloadCDestructive
Start or join a guarded workspace file/folder capture plus exact console log.
Inputs: job (required), kind (required), workspace_path (required), build, +1 more. Returns: Structured content returned by successful Jenkins tools.
jenkins_stop_buildBDestructive
Stop a running build. Requires JENKINS_MCP_ENABLE_WRITES=1.
Inputs: job (required), build (required). Returns: Structured content returned by successful Jenkins tools.
jenkins_trigger_buildADestructive
Trigger a non-parameterized job build. Requires JENKINS_MCP_ENABLE_WRITES=1.
Inputs: job (required), delay. Returns: Structured content returned by successful Jenkins tools.
jenkins_trigger_build_with_parametersADestructive
Trigger a parameterized job build. Requires JENKINS_MCP_ENABLE_WRITES=1.
Inputs: job (required), parameters (required), delay. Returns: Structured content returned by successful Jenkins tools.
jenkins_update_job_configADestructive
Replace job config.xml; Jenkins reserializes it. Requires job-config write gates.
Inputs: job (required), config_xml (required). Returns: Structured content returned by successful Jenkins tools.
jenkins_versionARead-only
Return Jenkins version from the X-Jenkins response header.
Inputs: no named parameters. Returns: Structured content returned by successful Jenkins tools.
jenkins_whoamiARead-only
Return the authenticated Jenkins identity from /whoAmI/api/json.
Inputs: no named parameters. Returns: Structured content returned by successful Jenkins tools.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 40 tools
Most tools map cleanly to a distinct resource and action, such as list_jobs, get_build, trigger_build, delete_job. A few boundary cases—generic get_json versus named getters, the three build-log retrieval tools, and the workspace/artifact download variants—could cause mnisselection but are resolvable from descriptions.
All tools share the jenkins_ prefix and use snake_case, with a mostly consistent verb_noun pattern: list_jobs, get_job, trigger_build, delete_job, cancel_queue_item. Minor deviations such as jenkins_version, jenkins_health, and jenkins_whoami being noun-only or nonstandard keep it from a perfect 5.
40 tools is well above the 25+ threshold for a bloated tool surface. While Jenkins is a large domain, many of these could be consolidated—particularly the multiple download/status/cancel/cleanup bundles—making the set feel heavier than necessary for an MCP server.
The set covers core Jenkins workflows well: job create/read/update/delete/enable/disable, build trigger/stop/log/artifacts/test reports, queue management, and workspace/artifact retrieval. Minor gaps exist—node and view management are read-only, and there is no credential or plugin administration—but the generic get_json tool helps fill some edge cases.
Maintenance
Related MCP Connectors
- octoperfDeprecatedio.github.OctoPerf
Drive OctoPerf load testing from any AI agent: import, edit, validate, run scenarios, read metrics.
Connect AI agents to CloudBees Unify: feature flags, CI/CD, release orchestration, and security
Lets AI agents analyze API metrics, request logs, and traces, and manage apps and alerts.
Apache JMeter community documentation, conversion tools, linters, and calculators for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Jenkins CI/CD systems for build management, job monitoring, console log analysis, and debugging through natural language commands.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Jenkins to manage jobs, trigger builds with parameters, and monitor build queues. It provides comprehensive access to build histories, console logs, and organizational folder structures via the Jenkins REST API.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Jenkins instances to manage jobs, builds, and nodes through the Model Context Protocol. It provides capabilities to trigger builds, read console outputs, and search log sections using regular expressions.ISC
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Jenkins CI jobs, including triggering and stopping builds, retrieving job details, and fetching build logs.-