albs-mcp
Officialalbs-mcp
用于 AlmaLinux Build System (ALBS) 的 MCP 服务器和 CLI。
让 AI 编码助手直接访问 ALBS —— 通过自然语言调查构建失败、创建构建、签署软件包。
两种使用方式:
MCP 服务器 | CLI + Skill | |
工作原理 | AI 通过 MCP 协议调用工具 | AI 通过 shell 运行 |
设置 | 添加到 MCP 配置 | 安装 |
最适合 | 专用 ALBS 工作流 | 轻量设置,避免 MCP 上下文污染 |
无需 AI 也可用 | 否 | 是( |
它能做什么
无令牌(只读)
调查构建失败 —— 主要用例。给 agent 一个构建 ID,它会 grep 日志以查找失败特征(
search_log),精确定位文件、行号和诊断信息,然后扩大上下文。无需猜测行偏移,也不会在超过 10 万行的日志文件上浪费 token。获取构建详情 —— 所有任务、软件包、架构、签名任务的状态。
列出和搜索构建 —— 浏览最近的构建,按软件包名称或状态过滤。
获取平台 —— 动态获取所有平台及其支持的架构列表。
下载和读取日志 —— 任何构建的任何日志文件:用
search_loggrep、用read_log_tail从底部向上翻页,或读取指定行范围。任何读取都不会失控:每行截断为 500 个字符,整个结果截断为 40k 个字符(可用max_line_chars=0/max_chars=0解除限制),因此单行包含数 KB 编译器标志的日志会以精确拼接的页面返回,而不是一个超大块。如果日志尚未在磁盘上,读取时会自动下载。检查签名状态 —— 查看构建的签名任务是已完成还是失败。
列出产品 —— 所有发布目标(产品)及其平台、官方/社区标志和 ID。
查看发布计划 —— 任何现有发布的状态、源软件包和目标仓库。
使用 JWT 令牌(已认证)
创建构建 —— 指定软件包、平台、分支/标签/SRPM。支持在单个构建中使用多个平台(例如 AlmaLinux-8 + AlmaLinux-9)。除非你覆盖,否则架构默认为每个平台的完整列表。支持
git.almalinux.org之外仓库的自定义 Git URL(例如 GitHub、GitLab)。支持所有 mkbuild.py 选项:链接构建、mock 定义、排除项、flavors、secureboot、模块、with/without。签署构建 —— 使用所选密钥创建签名任务。
列出签名密钥 —— 查看可用密钥及其 ID 和平台映射。
创建发布计划 —— 为构建创建计划中的发布计划(哪些软件包进入哪些仓库),目标为所选平台 + 产品。实际发布永远不会执行 —— 这只会创建计划;提交/发布被有意阻止。
删除构建 —— 出于安全考虑被有意阻止。
日志类型
ALBS 为每个构建任务生成多个日志文件。调试时关键的有:
日志 | 内容 |
| chroot 设置、依赖解析。先检查这个 —— 如果依赖失败,其他都不重要。 |
| 构建过程的 stderr 输出。通常包含最清晰的错误信息。 |
| 完整构建日志(可能超过 10 万行)。完整的 rpmbuild 输出 —— 编译错误所在之处。用 |
| Mock 状态转换。 |
| 构建节点的硬件信息。 |
| chroot 中安装的软件包列表。 |
| ALBS 级任务日志(任务分配、上传)。 |
| 构建所用的 mock 配置。 |
Related MCP server: Kerneldev MCP
安装
pip install git+https://github.com/AlmaLinux/albs-mcp.git这会同时安装 MCP 服务器(albs-mcp)和 CLI(albs)。
认证
JWT 令牌从以下位置读取(按顺序检查):
ALBS_JWT_TOKEN环境变量~/.albs/credentials文件(包含token键的 Python 字典):
{"token": "eyJ..."}没有令牌时,MCP 和 CLI 都以只读模式工作。
切勿提交真实令牌。 使用环境变量或
~/.albs/credentials,不要使用 CLI 参数。
设置选项 1:MCP 服务器
添加到你的 MCP 客户端配置(例如 mcp.json 或等效文件):
{
"mcpServers": {
"albs": {
"command": "albs-mcp"
}
}
}设置选项 2:CLI + Skill
适用于担心 MCP 上下文污染,或使用不支持 MCP 的工具的情况。
第 1 步。 安装软件包(与上面相同 —— 提供 albs 命令):
pip install git+https://github.com/AlmaLinux/albs-mcp.git第 2 步。 将工作流说明添加到你的 AI 工具:
# Copy the skill directory to your tool's skills location, e.g.:
cp -r skills/albs-cli <YOUR_SKILLS_DIR>/albs-cli或者将 skills/albs-cli/SKILL.md 的内容复制到项目的 AGENTS.md 或等效说明文件中。
该 skill 教 AI agent 相同的工作流(调查顺序、EPEL 处理、签名),但通过 albs shell 命令而非 MCP 工具调用。
第 3 步。 验证:
albs --helpCLI 也可以独立使用 —— 无需 AI。适用于脚本和手动终端使用。
CLI 用法
# List platforms
albs platforms
# Investigate a build
albs build-info 52679
albs failed-tasks 52679
# log-search greps for the failure and shows it with context — start here.
# It auto-downloads the log if needed (download-log is optional)
albs log-search 52679 "mock_build.395391.1772974729.log"
# ...or grep for something specific
albs log-search 52679 "mock_build.395391.1772974729.log" -e "Hunk #\d+ FAILED" -A 3
# When the search finds nothing, page the log bottom-up: each page prints the
# exact command for the page above it, so the pages join up with no gaps
albs log-tail 52679 "mock_build.395391.1772974729.log"
albs log-tail 52679 "mock_build.395391.1772974729.log" --before-line 772
# Search builds
albs search --project bash --page 2
# Create a build (requires JWT)
albs create-build AlmaLinux-9 bash --branch c9s
albs create-build AlmaLinux-10 https://example.com/pkg.src.rpm \
--from-srpm --add-epel-dist --arch x86_64_v2 \
--flavor EPEL-10 --flavor EPEL-10_altarch
# Build on multiple platforms at once
albs create-build AlmaLinux-8 bash --branch c9s \
--add-platform AlmaLinux-9
# Build from an external Git repo (e.g. GitHub)
albs create-build AlmaLinux-10 \
--git-url https://github.com/ykohut/leapp-data.git \
--branch devel-ng-0.23.0
# Independent tasks (disable the default sequential per-platform task chain,
# so packages build in parallel within each platform)
albs create-build AlmaLinux-9 bash glibc openssl --branch c9s --independent-tasks
# Sign a build (requires JWT)
albs sign-keys
albs sign-build 52679 --key-id 4
# Check whether signing finished
albs sign-status 52679
# List products (release targets) and view an existing release plan
albs products
albs release-plan 39229
# Create a release plan (requires JWT) — never performs the actual release
albs create-release-plan 62316 --platform AlmaLinux-8 --product AlmaLinux
# Release a PARTIAL build (only fully-completed packages):
albs create-release-plan 62316 --platform AlmaLinux-8 --product AlmaLinux \
--whole-packages-only
# Pass token via flag or env var
albs --token "eyJ..." sign-keys
ALBS_JWT_TOKEN="eyJ..." albs sign-keys运行 albs --help 或 albs <command> --help 查看完整用法。
工具参考
只读(无需认证)
工具 | 描述 |
| 所有平台及其架构,从 ALBS 动态获取 |
| 构建摘要:每个任务的状态、架构、软件包、git 引用、日志数量,以及 Secure Boot 状态、flavors 和任何链接构建 |
| 仅列出失败的任务及其日志文件;关键日志用 ★ 标记 |
| 服务器上某个构建可用的所有日志/配置文件 |
| 将日志文件下载到本地磁盘( |
| 失败时从这里开始:grep 日志以查找构建失败特征(或你自己的正则表达式),获取每个命中及其行号和上下文;需要时自动下载 |
| 从日志末尾读取一页,并从那里向上翻页( |
| 从日志中读取特定行范围(例如围绕 |
| 按页浏览构建,按软件包名称或运行状态过滤 —— 将每个软件包显示为 NVR 以及构建的发布状态; |
| 构建的签名任务状态(idle/in_progress/completed/failed)—— 在 |
| 列出所有产品(发布目标):ID、名称、官方/社区、平台 |
| 查看现有发布:状态、源软件包、目标仓库 |
已认证(需要 JWT)
工具 | 描述 |
| 列出签名密钥:ID、名称、GPG keyid、激活状态、平台映射 |
| 创建构建:软件包或自定义 Git URL + 平台 + 分支/标签/srpm,包含所有 mock 选项 |
| 使用所选密钥为构建创建签名任务 |
| 为构建 + 平台 + 产品创建计划中的发布计划。永远不会执行实际发布 —— 仅创建计划 |
| 已阻止 —— 执行实际发布已被禁用;仅支持计划 |
| 已阻止 —— 出于安全考虑已禁用 |
提示
MCP 提示是用户调用的工作流入口点。在 Claude Code 等客户端中,它们以斜杠命令(/mcp__albs__<name>)的形式出现;由用户触发,而非 agent。
Prompt | Arguments | Description |
|
| 为某个构建 ID 启动构建失败调查工作流。相当于询问"构建 N 为什么失败?",但以一步参数化命令的形式完成。 |
|
| 为某个构建 ID 启动发布计划工作流(确认平台、选择产品、创建计划)。绝不执行实际发布。 |
示例(Claude Code):
/mcp__albs__investigate_build 52679
/mcp__albs__release_plan 52679investigate_build 展开为调查工作流(get_build_info → get_failed_tasks → 按顺序下载/读取关键日志),以构建 ID 作为参数。release_plan 展开为发布计划工作流(get_build_info → get_products → create_release_plan),并明确止步于计划——它从不提交/发布。
示例:调查失败的构建
让代理执行:"构建 52679 出了什么问题?"
代理将:
get_build_info(70368)— 发现只有 i686 任务失败;其余 7 个架构构建成功get_failed_tasks(70368)— 获取日志文件,★ 标记重要文件search_log(70368, "mock_build.441500.1785274367.log")— 在 936 行 / 600 KB 的日志中 进行 grep 搜索,并在一次调用中返回带上下文的失败原因:>>> 826 | usr/lib/common/mech_openssl.c:2766:52: error: passing argument 5 of 'EVP_PKEY_get_octet_string_param' from incompatible pointer type 833 | note: expected 'size_t *' {aka 'unsigned int *'} but argument is of type 'CK_ULONG *' {aka 'long unsigned int *'} >>> 853 | make[1]: *** [Makefile:9851: ...mech_openssl.lo] Error 1search_log(70368, "mock_root.441500.1785274367.log")— 无匹配结果:chroot 和 依赖均正常,因此这不是依赖失败报告:"
CK_ULONG *是unsigned long *,而 OpenSSL 需要size_t *;在 ILP32 (i686)上它们是不同的类型,因此 3.27.0 的重基线仅在 32 位架构上失败。"
如果搜索没有结果,下一步是 read_log_tail,然后使用它打印出的
↑ earlier: ... 调用,逐页向上翻阅日志。页面大小由
字符预算决定,而非行数——这个 mock_build 日志为 165 行,或同一构建的 mock_root 为
350 行——每一页都恰好从上一页停止的位置开始,因此不会跳过任何内容。
注意步骤 3 取代了什么。对该日志执行 read_log_tail 会返回
make: *** [Makefile:4615: all] Error 2——这只是症状,位于真正错误下方数百行处,
因为 make -j 在第一次失败后仍会继续编译。请求足够的尾部内容以
到达错误位置,反而会返回 167 KB 的 gcc 命令行,并可能超出调用方的
结果大小限制。search_log 仅返回 4 KB,且答案就在最前面。
示例:创建构建
让代理执行:"从 c9s 分支为 AlmaLinux-9 构建 bash"
代理将调用:
create_build(packages=["bash"], platform="AlmaLinux-9", branch="c9s")同时为多个平台构建:
create_build(packages=["bash"], platforms=["AlmaLinux-8", "AlmaLinux-9"], branch="c9s")对于外部 Git 仓库(如 GitHub),使用 git_urls:
create_build(git_urls=["https://github.com/ykohut/leapp-data.git"], platform="AlmaLinux-10", branch="devel-ng-0.23.0")架构默认为每个平台的完整列表。当为多个平台指定 arch_list 时,会针对每个平台分别进行验证。
示例:创建发布计划
让代理执行:"为 AlmaLinux-8 上的构建 62316 创建发布计划。"
代理将:
get_build_info(62316)— 确认平台以及构建已完成任务get_products()— 列出产品,以便选择目标(如AlmaLinux)create_release_plan(build_id=62316, platform="AlmaLinux-8", product="AlmaLinux")— 收集已完成的构建任务,将平台/产品名称解析为 ID,并创建一个已排定的计划报告计划(状态、源包、目标仓库),并明确说明未发布任何内容——这只是一个计划
实际发布(提交/发布计划)被有意不执行。让代理"真正发布"会路由到
commit_release,该操作被阻止,并会说明仅支持计划。
测试
pip install -e ".[test]"
# Unit tests (no network, 263 tests)
pytest tests/test_client_unit.py tests/test_server_unit.py tests/test_cli_unit.py -v
# Integration tests (hits real ALBS API, read-only, 30 tests)
pytest tests/test_integration.py -v
# All tests
pytest -v环境变量
变量 | 描述 | 默认值 |
| 用于认证操作的 JWT 令牌 | — |
| 下载日志的存放目录 |
|
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server and CLI for iOS development — build, test, automate, and diagnose from any AI agent or terminal.1MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server for intelligent Linux kernel configuration management and building. Enables AI assistants to generate, manage, and optimize kernel configurations and build kernels with comprehensive error detection.7GPL 2.0

evergreen-mcp-serverofficial
FlicenseAqualityAmaintenanceMCP server for MongoDB's Evergreen CI/CD platform, enabling AI assistants to manage projects, analyze builds, and troubleshoot failures via natural language.83- AlicenseAqualityDmaintenanceMCP server that bridges AI assistants with the SUSE Linux ecosystem, enabling safe access to openSUSE Wiki, OBS, and repositories for system management.221GPL 3.0
Related MCP Connectors
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server for Gainium — manage trading bots, deals, and balances via AI assistants
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AlmaLinux/albs-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server