Skip to main content
Glama

mcp-beaker

PyPI Version PyPI Downloads CI License Python

MCP-сервер для автоматизации лаборатории Beaker — подготовка систем, управление заданиями, поиск дистрибутивов и диагностика сбоев.

Работает с любым экземпляром сервера Beaker. Построен на FastMCP v3 и предназначен для использования с ИИ-ассистентами для программирования (Cursor, Claude Desktop и т. д.).

Возможности

  • 27 инструментов, охватывающих полный жизненный цикл Beaker: системы, задания, дистрибутивы, задачи

  • Совместимость с Beaker Py3: работает как с устаревшими, так и с модернизированными REST API Beaker

  • Гибкая аутентификация: Kerberos (нативный GSSAPI/SPNEGO или резервный вариант через CLI bkr) и пароль (XML-RPC)

  • Проверка XML заданий: автоматическое заполнение отсутствующих полей, определение семейств дистрибутивов

  • Диагностика сбоев: углублённый анализ с автоматическим повтором при исправимых ошибках

  • 10 документационных тем, доступных в качестве ресурсов MCP

  • 2 подсказки для рабочих процессов для типовых задач (резервирование системы, диагностика задания)

  • Универсальность: работает с любым URL Beaker, настраиваемые параметры SSL/CA

Related MCP server: zuul-mcp

Установка

Контейнер (рекомендуется)

Образ контейнера включает всё необходимое — никаких зависимостей на хосте, кроме podman (или docker). Аутентификация Kerberos выполняется внутри контейнера через переменные окружения KRB5_PRINCIPAL и KRB5_PASSWORD.

# Pull the pre-built image from GHCR
podman pull ghcr.io/faizbawa/mcp-beaker:latest

# Or build locally from the repo
podman build -t mcp-beaker:latest -f Containerfile .

Pip / uvx

# Using uv (recommended)
pip install uv
uvx mcp-beaker

# Using pip
pip install mcp-beaker
mcp-beaker

# With native Kerberos support (no bkr CLI needed -- requires krb5-devel on host)
pip install mcp-beaker[kerberos]

# Local development
uv run --directory /path/to/mcp-beaker mcp-beaker

Конфигурация

Cursor / VS Code

Добавьте в .cursor/mcp.json (или .vscode/mcp.json):

Контейнер (рекомендуется)

{
  "mcpServers": {
    "beaker": {
      "command": "podman",
      "args": [
        "run", "--rm", "-i", "--network=host",
        "-e", "BEAKER_URL=https://beaker.example.com",
        "-e", "KRB5_PRINCIPAL=your-user@YOUR.REALM",
        "-e", "KRB5_PASSWORD=your-kerberos-password",
        "ghcr.io/faizbawa/mcp-beaker:latest"
      ]
    }
  }
}

Контейнер запускает kinit внутри — никаких монтирований томов, никаких зависимостей на хосте. Используйте --network=host, чтобы контейнер мог достичь вашего KDC Kerberos и сервера Beaker (особенно через VPN).

Контейнер с смонтированным кэшем билетов (без пароля в конфигурации)

Вместо хранения пароля Kerberos в mcp.json вы можете смонтировать уже существующий кэш билетов с хоста:

Шаг 1 — Создайте файловый билет на хосте:

kinit -c FILE:/tmp/krb5cc_beaker your-user@YOUR.REALM

Повторяйте эту команду при истечении срока действия билета (обычно каждые 10 часов).

Шаг 2 — Смонтируйте билет в контейнер:

{
  "mcpServers": {
    "beaker": {
      "command": "podman",
      "args": [
        "run", "--rm", "-i", "--network=host",
        "-v", "/tmp/krb5cc_beaker:/tmp/krb5cc_0:ro,Z",
        "-e", "BEAKER_URL=https://beaker.example.com",
        "ghcr.io/faizbawa/mcp-beaker:latest"
      ]
    }
  }
}

Контейнер обнаруживает действующий билет и полностью пропускает kinit. KRB5_PRINCIPAL и KRB5_PASSWORD не нужны. Флаги монтирования :ro,Z обеспечивают доступ только для чтения с правильной маркировкой SELinux.

Примечание: На хосте обычно используется KCM (D-Bus) для хранения учётных данных, к которому контейнеры не имеют доступа. Поэтому вам нужен kinit -c FILE:... для создания файлового кэша, который можно смонтировать.

SSL-сертификаты: На многих серверах Beaker используются внутренние сертификаты ЦС, которых нет в стандартном хранилище доверия контейнера. У вас есть три варианта:

  1. Отключить проверку (проще всего, допустимо в доверенной корпоративной сети):

"-e", "BEAKER_SSL_VERIFY=false",
  1. Передать сертификат ЦС встроенно через BEAKER_CA_CERT_DATA (без монтирования тома):

"-e", "BEAKER_CA_CERT_DATA=-----BEGIN CERTIFICATE-----\nMIID...your-ca-cert...\n-----END CERTIFICATE-----",
  1. Смонтировать пакет ЦС (один файл):

"-v", "/path/to/ca-bundle.crt:/tmp/ca-bundle.crt:ro",
"-e", "BEAKER_CA_CERT=/tmp/ca-bundle.crt",

Pip / uvx

{
  "mcpServers": {
    "beaker": {
      "command": "uvx",
      "args": ["mcp-beaker[kerberos]"],
      "env": {
        "BEAKER_URL": "https://beaker.example.com",
        "BEAKER_AUTH_METHOD": "kerberos",
        "BEAKER_KERBEROS_BACKEND": "http"
      }
    }
  }
}

Режим Streamable HTTP

uvx mcp-beaker --transport streamable-http --port 8000
{
  "mcpServers": {
    "beaker": {
      "url": "http://localhost:8000/mcp",
      "type": "streamableHttp"
    }
  }
}

Переменные окружения

Переменная

Обязательная

По умолчанию

Описание

BEAKER_URL

Да

--

Базовый URL вашего сервера Beaker

BEAKER_AUTH_METHOD

Нет

kerberos

kerberos или password

BEAKER_KERBEROS_BACKEND

Нет

http

http (нативный SPNEGO) или bkr (CLI bkr)

BEAKER_USERNAME

Для парольной аутентификации

--

Имя пользователя Beaker

BEAKER_PASSWORD

Для парольной аутентификации

--

Пароль Beaker

BEAKER_OWNER

Нет

$USER

Владелец по умолчанию для запросов заданий

BEAKER_SSL_VERIFY

Нет

true

Проверять SSL-сертификаты

BEAKER_CA_CERT

Нет

--

Путь к пакету сертификатов ЦС

KRB5_PRINCIPAL

Только контейнер

--

Принципал Kerberos для kinit внутри контейнера

KRB5_PASSWORD

Только контейнер

--

Пароль Kerberos для kinit внутри контейнера

BEAKER_CA_CERT_DATA

Только контейнер

--

PEM-кодированный сертификат ЦС, записываемый в файл при запуске

Параметры CLI

mcp-beaker [OPTIONS]

Options:
  --transport [stdio|sse|streamable-http]  Transport type (default: stdio)
  --port INTEGER                           Port for HTTP transports (default: 8000)
  --host TEXT                              Host for HTTP transports (default: 0.0.0.0)
  --path TEXT                              Path for streamable-http (default: /mcp)
  --beaker-url TEXT                        Beaker server URL
  --ssl-verify / --no-ssl-verify           Verify SSL certs (default: verify)
  --ca-cert TEXT                           CA certificate bundle path
  --auth-method [kerberos|password]        Authentication method
  --kerberos-backend [http|bkr]            Kerberos backend (default: http)
  --read-only                              Disable all write tools
  --enabled-tools TEXT                     Comma-separated tools to enable
  -v, --verbose                            Increase verbosity (-v info, -vv debug)
  --version                                Show version
  --help                                   Show this message

Инструменты

Инструменты чтения (15)

Инструмент

Описание

list_systems

Список систем по доступности (all/available/free)

search_systems

Поиск систем по CPU, архитектуре, памяти, пулу и другим аппаратным атрибутам

get_system_details

Аппаратные характеристики, информация о CPU, членство в пуле, владелец, статус системы

get_system_status

Текущее состояние, резервирование и статус ссуды для системы

get_system_history

История активности для системы

get_system_arches

Поддерживаемые семейства ОС и архитектуры

list_jobs

Фильтрация заданий по владельцу, статусу, whiteboard

get_job_status

Статус задания с диагностикой сбоев

get_job_results_xml

Экспорт результатов задания в формате XML

get_job_logs

Список файлов журналов для задания/рецепта/задачи

list_distro_trees

Поиск дистрибутивов по имени, семейству, архитектуре, тегам

list_os_families

Список всех известных семейств ОС

whoami

Показать информацию об аутентифицированном пользователе

list_lab_controllers

Список всех контроллеров лаборатории

search_tasks

Поиск в библиотеке задач

Инструменты записи (12)

Инструмент

Описание

submit_job

Отправка задания из XML (с проверкой и автозаполнением)

clone_job

Клонирование и повторная отправка существующего задания

cancel_job

Отмена выполняющегося/стоящего в очереди задания

watch_job

Ожидание завершения с анализом сбоев и автоматическим повтором

reserve_system

Ручное резервирование системы

release_system

Освобождение вручную зарезервированной системы

loan_system

Выдача ссуды на систему пользователю

return_loan

Возврат текущей ссуды на систему

power_system

Включение/выключение/перезагрузка системы

provision_system

Подготовка зарезервированной системы с дистрибутивом

extend_watchdog

Продление таймера watchdog выполняющейся задачи

set_job_response

Подтверждение/отклонение (waive) результата набора рецептов

Аутентификация

Kerberos (рекомендуется)

Убедитесь, что у вас есть действующий билет:

kinit your-username@YOUR.REALM

Сервер поддерживает два бэкенда Kerberos, управляемых через BEAKER_KERBEROS_BACKEND:

Значение

Бэкенд

Установка

http (по умолчанию)

Нативный GSSAPI/SPNEGO — лёгкий, устанавливается через pip

pip install mcp-beaker[kerberos]

bkr

Субпроцессы CLI bkr — традиционный, требует RPM

yum install beaker-client

Оба бэкенда используют один и тот же билет Kerberos от kinit.

Пароль

Установите BEAKER_AUTH_METHOD=password вместе с BEAKER_USERNAME и BEAKER_PASSWORD. Сервер выполняет аутентификацию через метод XML-RPC auth.login_password(). Обратите внимание: для этого на сервере должен быть включён LDAP.

Архитектура

src/mcp_beaker/
  __init__.py           # Click CLI entry point
  config.py             # BeakerConfig dataclass
  exceptions.py         # Custom exceptions
  client.py             # BeakerClient (XML-RPC + REST)
  models/               # Pydantic response models
  servers/
    __init__.py         # FastMCP server, lifespan, DI helper
    systems.py          # System tools (6 read + 6 write)
    jobs.py             # Job tools (4 read + 6 write)
    distros.py          # Distro tools (2 read)
    tasks.py            # Task tools (1 read)
    general.py          # General tools (2 read)
    prompts.py          # Workflow prompt templates
    resources.py        # Beaker documentation resources
  utils/
    xml_validation.py   # Job XML validation/auto-fill
    diagnosis.py        # Failure analysis engine
    formatting.py       # Human-readable formatters
    bkr_cli.py          # bkr CLI helpers
    parsing.py          # ID parsing utilities

Разработка

cd mcp-beaker
uv sync --dev
uv run pytest
uv run ruff check src/

Лицензия

MIT

Available Tools

27 tools
cancel_jobCancel JobA

Cancel a running or queued Beaker job.

Note: cancelling any part of a job (recipe, recipe set) cancels the entire job. The reason is recorded in the job history.

Inputs: task_id (required), reason. Returns: result

clone_jobClone JobA

Clone (re-submit) an existing Beaker job.

Fetches the original job's XML in clone mode, then submits it as a new job. Useful for retrying failed jobs or running the same test again.

Inputs: job_id (required). Returns: result

extend_watchdogExtend WatchdogA

Extend the watchdog timer for a running Beaker task.

Use this to extend a Beaker reservation and prevent the system from being reclaimed. Beaker's watchdog automatically aborts recipes that exceed their timeout — this tool pushes that deadline forward.

Provide either a task_id directly, or a job_id and the tool will find the currently running task for you.

Inputs: seconds (required), job_id, task_id. Returns: result

get_job_logsGet Job LogsA
Read-only

List all log files for a Beaker job, recipe, or task.

Returns URLs to log files including console.log, anaconda logs, and task output. Critical for debugging installation failures.

Inputs: task_id (required). Returns: result

get_job_results_xmlGet Job Results XMLA
Read-only

Export Beaker job results as XML.

Returns the XML representation of a job component including its current state. Use clone=true to get XML suitable for resubmission.

Inputs: task_id (required), clone. Returns: result

get_job_statusGet Job StatusA
Read-only

Check the status of a Beaker job and diagnose any failures.

Fetches detailed job information including recipe sets, recipes, and tasks, then highlights any problems found with failure analysis.

Inputs: job_id (required). Returns: result

get_system_archesGet System ArchitecturesA
Read-only

Get supported OS families and architectures for a Beaker system.

Returns a mapping of distro family names to their supported architecture list for the given system.

Inputs: fqdn (required). Returns: result

get_system_detailsGet System DetailsA
Read-only

Get detailed information about a specific Beaker system.

Returns hardware specs, ownership, status, architectures, and lab controller assignment for the given system FQDN.

Inputs: fqdn (required). Returns: result

get_system_historyGet System HistoryB
Read-only

Get activity history for a Beaker system.

Shows who used the system, what changed, and when. Useful for investigating system state changes and usage patterns.

Inputs: fqdn (required), since. Returns: result

get_system_statusGet System StatusA
Read-only

Get the current status of a Beaker system: who has it loaned and who is using it.

Returns the system condition (Automated/Manual/Broken/Removed), current loan details (recipient and comment), and current reservation details (user and recipe).

Inputs: fqdn (required). Returns: result

list_distro_treesList Distro TreesA
Read-only

Search available distro trees on the Beaker server.

Query the distro library to discover which distros are available before submitting a job. At least one search criterion is required.

Inputs: arch, name, tags, limit, +1 more. Returns: result

list_jobsList JobsA
Read-only

List Beaker jobs filtered by owner and other criteria.

Uses XML-RPC jobs.filter() to find matching job IDs, then optionally fetches full details for each via the REST API.

Inputs: limit, owner, max_id, min_id, +3 more. Returns: result

list_lab_controllersList Lab ControllersA
Read-only

List all lab controllers attached to the Beaker server.

Lab controllers manage system provisioning in specific labs. Useful for troubleshooting distro availability issues.

Inputs: no named parameters. Returns: result

list_os_familiesList OS FamiliesA
Read-only

List all distro families (OS major versions) known to Beaker.

Returns family names like 'RedHatEnterpriseLinux10', 'Fedora41', etc. Optionally filter to families that have distros with specific tags.

Inputs: tags. Returns: result

list_systemsList SystemsA
Read-only

List Beaker systems matching the filter criteria.

Returns a list of system FQDNs filtered by availability status and optional hostname substring. Use 'available' for systems you can reserve, 'free' for idle ones, or 'all' for the complete inventory.

Inputs: limit, hostname, filter_type. Returns: result

loan_systemLoan SystemA

Grant a loan for a Beaker system.

The loan recipient gets full permissions to reserve, provision, and schedule jobs on the system. While loaned, only the recipient and the system owner can use it. You must have permission to loan the system (typically the owner or an admin).

Inputs: fqdn (required), comment, recipient. Returns: result

power_systemPower SystemA

Control power for a Beaker system (on, off, or reboot).

Power control is not normally permitted when the system is in use by someone else. Use force=true to override this safety check.

Inputs: fqdn (required), action (required), force. Returns: result

provision_systemProvision SystemA

Provision a reserved Beaker system with a specific distro.

The system must be in 'Manual' condition and already reserved by you. Use list_distro_trees to find the distro_tree_id first.

Inputs: fqdn (required), distro_tree_id (required), reboot, ks_meta, +3 more. Returns: result

release_systemRelease SystemA

Release a manually reserved Beaker system.

You must be the current user of the system (i.e. you reserved it).

Inputs: fqdn (required). Returns: result

reserve_systemReserve SystemA

Manually reserve a Beaker system.

The system must be in 'Manual' condition and not currently in use. You must have permission to use the system. After reserving, you can provision it at will.

Inputs: fqdn (required). Returns: result

return_loanReturn System LoanA

Return a current loan on a Beaker system.

Either the loan recipient or a user with permission to loan the system can return it. The system reverts to its normal access policy.

Inputs: fqdn (required). Returns: result

search_systemsSearch SystemsA
Read-only

Search Beaker systems by hardware attributes and ownership.

Find systems matching hostname, CPU, architecture, memory, pool, owner, and other criteria. All filters are combined with AND logic.

Inputs: arch, pool, user, limit, +10 more. Returns: result

search_tasksSearch TasksA
Read-only

Search the Beaker task library for available test tasks.

Find tasks compatible with a given OS, distro, or package list. Returns task names and their excluded architectures.

Inputs: types, osmajor, packages, distro_name. Returns: result

set_job_responseSet Job ResponseA

Set the response (ack/nak) for a Beaker recipe set or job.

Used to acknowledge or waive recipe set results. Setting 'nak' is equivalent to waiving the result.

Inputs: task_id (required), response (required). Returns: result

submit_jobSubmit JobA

Submit a Beaker job from a complete job XML document.

The XML is validated before submission. Missing optional fields are auto-filled with sensible defaults. Uses Kerberos auth via the bkr CLI if available, otherwise falls back to XML-RPC password auth.

Inputs: job_xml (required), force. Returns: result

watch_jobWatch JobA

Watch a Beaker job until completion, with failure analysis and auto-retry.

Polls the job continuously. On success, returns a report. On failure, performs deep analysis (failure reasons, constraints, suggestions) and can auto-generate a corrected XML and resubmit up to max_retries times. Also works on already-finished jobs for post-mortem analysis.

Inputs: job_id (required), max_retries, poll_interval. Returns: result

whoamiWho Am IA
Read-only

Show the currently authenticated Beaker user.

Verifies that credentials are working and returns the username and email associated with the current session.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 27 tools

    Disambiguation3/5

    Several tools occupy adjacent territory: list_systems/search_systems, get_system_details/get_system_status, and get_job_status/watch_job can all be selected for similar intents. Most actions are still distinct after reading descriptions, but the 27-tool surface makes misselection possible.

    Naming Consistency4/5

    The set overwhelmingly uses a clear verb_noun snake_case pattern (submit_job, cancel_job, list_systems, reserve_system, provision_system). Minor inconsistencies such as return_loan versus loan_system, the extra _xml suffix on get_job_results_xml, and one-word whoami prevent a perfect score.

    Tool Count2/5

    At 27 tools, the set exceeds the 25+ threshold and feels heavier than necessary for the two core workflows of job management and system management. Some list/search/detail/status tools are close enough that consolidation would improve the surface.

    Completeness4/5

    Job and system lifecycles are well represented: jobs can be submitted, cloned, canceled, watched, inspected, logged, and acked, while systems can be discovered, reserved, provisioned, powered, loaned, and released. The only gap is the lack of destructive/admin operations such as deleting jobs or editing system metadata, but primary workflows have no dead ends.

    Maintenance

    ActivityNo data
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      MCP server for Zuul CI/CD with 25 tools for builds, pipelines, queue management (enqueue/dequeue/promote), infrastructure visibility, and autohold management. Supports stdio, HTTP, and SSE transports.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for infrastructure discovery and remote management, enabling SSH command execution, file transfer, log tailing, and machine/service inventory with a companion web dashboard.
      2
      MIT