npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zhubby/bxmcp

v0.1.0

Published

MCP server for build operations

Downloads

13

Readme

bxmcp

MCP server for build operations.

安装

npm install -g @org/bxmcp

使用

bxmcp --kubeconfig /path/to/kubeconfig --namespace default

说明

该包包含预编译二进制(darwin/linux/windows,amd64/arm64)。

bxmcp - BuildKit MCP Server

基于 Kubernetes 的容器镜像构建系统,通过 MCP (Model Context Protocol) 为 AI Agent 提供构建能力。

架构

┌─────────────┐     ┌─────────────┐     ┌─────────────────────────────────┐
│  AI Agent   │────▶│  MCP Server │────▶│        Kubernetes Cluster       │
│             │     │ (bxmcp-mcp) │     │                                 │
└─────────────┘     └─────────────┘     │  ┌─────────────┐                │
                                        │  │  Controller │                │
                                        │  │             │                │
                                        │  └──────┬──────┘                │
                                        │         │                       │
                                        │         ▼                       │
                                        │  ┌─────────────────────────┐    │
                                        │  │      BuildKit Pod       │    │
                                        │  │ ┌─────────┐ ┌─────────┐ │    │
                                        │  │ │uploader │▶│ buildkit│ │    │
                                        │  │ │ (init)  │ │ (main)  │ │    │
                                        │  │ └─────────┘ └─────────┘ │    │
                                        │  └─────────────────────────┘    │
                                        └─────────────────────────────────┘

组件

  • bxmcp-mcp: MCP Server,对 AI Agent 暴露 build.createbuild.getbuild.logs 工具
  • bxmcp-controller: Kubernetes Controller,管理 Build CRD 的生命周期
  • bxmcp-uploader: Init Container,接收并解压构建上下文
  • bxmcp-crd: Build CRD 定义
  • bxmcp-common: 共享类型和工具

快速开始

前置条件

  • Rust 1.75+
  • Kubernetes 集群 (kind/minikube/k3d 或远程集群)
  • kubectl 已配置

构建

# 构建所有组件
cargo build --release

# 构建 Docker 镜像
docker build -f docker/Dockerfile.controller -t bxmcp/controller:latest .
docker build -f docker/Dockerfile.uploader -t bxmcp/uploader:latest .
docker build -f docker/Dockerfile.mcp -t bxmcp/mcp:latest .

部署

# 安装 CRD
kubectl apply -f deploy/kubernetes/crd.yaml

# 创建命名空间和 RBAC
kubectl apply -f deploy/kubernetes/rbac.yaml

# 部署 Controller
kubectl apply -f deploy/kubernetes/controller.yaml

使用 MCP Server

MCP Server 通过 stdio 与 AI Agent 通信:

# 本地运行(需要 kubeconfig)
./target/release/bxmcp-mcp

MCP Tools

build.create

创建新的构建任务。

输入:

{
  "imageRef": "registry.example.com/myapp:v1.0",
  "push": true,
  "platforms": ["linux/amd64"],
  "dockerfilePath": "Dockerfile",
  "buildArgs": {"VERSION": "1.0.0"},
  "registrySecret": "my-registry-cred"
}

输出:

{
  "buildId": "build-20260125-143052-a1b2c3d4",
  "uploadUrl": "https://build-gw.example.com/builds/build-20260125-143052-a1b2c3d4/upload",
  "uploadToken": "xxxxx",
  "expiresAt": "2026-01-25T15:00:00Z"
}

build.get

查询构建状态。

输入:

{
  "buildId": "build-20260125-143052-a1b2c3d4"
}

build.logs

获取构建日志。

输入:

{
  "buildId": "build-20260125-143052-a1b2c3d4",
  "container": "build",
  "tailLines": 100
}

上传构建上下文

获取 uploadUrluploadToken 后,使用 HTTP POST 上传 tar 包:

cd /path/to/your/project
tar czf - . | curl -X POST \
  -H "Authorization: Bearer ${UPLOAD_TOKEN}" \
  --data-binary @- \
  "${UPLOAD_URL}"

配置

Controller 环境变量

| 变量 | 默认值 | 说明 | |------|--------|------| | BXMCP_NAMESPACE | build-system | 操作的命名空间 | | BXMCP_UPLOADER_IMAGE | bxmcp/uploader:latest | Uploader 镜像 | | BXMCP_BUILDKIT_IMAGE | moby/buildkit:buildx-stable-1 | BuildKit 镜像 | | BXMCP_INGRESS_HOST | - | Ingress 域名 | | BXMCP_INGRESS_PATH_PREFIX | /builds | Ingress 路径前缀 |

Uploader 环境变量

| 变量 | 默认值 | 说明 | |------|--------|------| | LISTEN_ADDR | 0.0.0.0:8080 | 监听地址 | | WORKSPACE | /workspace | 工作目录 | | UPLOAD_TOKEN_FILE | /var/run/secrets/upload/token | Token 文件路径 | | MAX_UPLOAD_BYTES | 2147483648 | 最大上传大小 (2GB) |

License

MIT