Skip to main content
Glama

mcp-beaker

PyPI Version PyPI Downloads CI License Python

用于 Beaker 实验室自动化的 MCP 服务器 —— 系统供应、作业管理、distro 发现和失败诊断。

适用于任何 Beaker 服务器实例。基于 FastMCP v3 构建,专为 AI 编码助手(Cursor、Claude Desktop 等)设计。

功能特性

  • 27 个工具,覆盖 Beaker 的完整生命周期:系统、作业、distro、任务

  • Beaker Py3 兼容:同时兼容传统和现代化 Beaker REST API

  • 灵活的验证方式:Kerberos(原生 GSSAPI/SPNEGO 或 bkr CLI 回退)和密码(XML-RPC)

  • 作业 XML 验证:自动填充缺失字段,推断 distro 系列

  • 失败诊断:深度分析,并自动重试可纠正的失败

  • 10 个文档主题,作为 MCP 资源提供

  • 2 个工作流程提示,用于常见任务(保留系统、诊断作业)

  • 通用:适用于任何 Beaker URL,支持配置 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 让容器能访问你的 Kerberos KDC 和 Beaker 服务器(尤其是在 VPN 下)。

使用挂载的 kerberos 票据的容器(配置中无需密码)

无需在 mcp.json 中存储 Kerberos 密码,你可以在宿主机上挂载一个现有的 kerberos 票据缓存:

步骤 1 —— 在宿主机上创建文件型 kerberos 票据:

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 服务器使用内部的 CA 证书,这些证书不在容器的默认信任库中。你有三种选择:

  1. 禁用验证(最简单,在可信的办公网络中没问题):

"-e", "BEAKER_SSL_VERIFY=false",
  1. 通过 BEAKER_CA_CERT_DATA 直接传入 CA 证书(无需挂载卷):

"-e", "BEAKER_CA_CERT_DATA=-----BEGIN CERTIFICATE-----\nMIID...your-ca-cert...\n-----END CERTIFICATE-----",
  1. 挂载一个 CA 证书包(单个文件):

"-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

是

--

你的 Beaker 服务器的基础 URL

BEAKER_AUTH_METHOD

否(默认 kerberos)

kerberos

kerberos 或 password

BEAKER_KERBEROS_BACKEND

否

http

http(原生 SPNEGO)或 bkr(bkr CLI)

BEAKER_USERNAME

使用密码时

--

Beaker 用户名

BEAKER_PASSWORD

使用密码时

--

Beaker 密码

BEAKER_OWNER

否

$USER

作业查询的默认所有者

BEAKER_SSL_VERIFY

否

true

是否验证 SSL 证书

BEAKER_CA_CERT

否

--

CA 证书包的路径

KRB5_PRINCIPAL

仅容器

--

容器内执行 kinit 所需的主体的 principal

KRB5_PASSWORD

仅容器

--

容器内执行 kinit 所需的密码

BEAKER_CA_CERT_DATA

仅容器

--

启动时写入文件的 PEM 编码 CA 证书

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

当前状态、保留情况(reservation)、借用状态(loan)

get_system_history

一个系统的活动历史

get_system_arches

支持的 OS 系列和架构

list_jobs

按所有者、状态、 whiteboard 过滤作业

get_job_status

作业状态,包含失败诊断信息

get_job_results_xml

以 XML 格式导出作业结果

get_job_logs

列出作业/配方/任务的日志文件

list_distro_trees

按名称、家族、架构、标签搜索发行版

list_os_families

列出所有已知的操作系统家族

each

显示当前已认证用户的信息

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

为已保留的系统使用某个 distro 进行小规模初始化

extend_watchdog

延长当前任务的操作看门狗定时器

set_job_response

确认/拒绝(waive)一个配方集的结果

认证

Kerberos(推荐)

确保你有一张有效的 Kerberos 票据:

kinit your-username@YOUR.REALM

服务器支持两种 Kerberos 后端,由 BEAKER_KERBEROS_BACKEND 控制:

值

后端

安装方式

http(默认)

原生 GSSAPI/SPNEGO —— 轻量,可通过 pip 安装

pip install mcp-beaker[kerberos]

bkr

bkr CLI 子进程 —— 传统方式,需要安装 RPM

yum install beaker-client

两者后端都使用 kinit 产生的同一张 Kerberos 票据。

密码

设置 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